@Test public void testNonParseable() { assertThat(LiveJvmServiceImpl.parseProcessId("")).isNull(); assertThat(LiveJvmServiceImpl.parseProcessId("x")).isNull(); assertThat(LiveJvmServiceImpl.parseProcessId("x:y")).isNull(); assertThat(LiveJvmServiceImpl.parseProcessId("@y")).isNull(); assertThat(LiveJvmServiceImpl.parseProcessId("x@y")).isNull(); }
@VisibleForTesting static @Nullable Long parseProcessId(String runtimeName) { int index = runtimeName.indexOf('@'); if (index > 0) { String pid = runtimeName.substring(0, index); try { return Long.parseLong(pid); } catch (NumberFormatException e) { logger.debug(e.getMessage(), e); return null; } } else { return null; } }
LiveJvmServiceImpl implements LiveJvmService { @VisibleForTesting static @Nullable Long parseProcessId(String runtimeName) { int index = runtimeName.indexOf('@'); if (index > 0) { String pid = runtimeName.substring(0, index); try { return Long.parseLong(pid); } catch (NumberFormatException e) { logger.debug(e.getMessage(), e); return null; } } else { return null; } } }
LiveJvmServiceImpl implements LiveJvmService { @VisibleForTesting static @Nullable Long parseProcessId(String runtimeName) { int index = runtimeName.indexOf('@'); if (index > 0) { String pid = runtimeName.substring(0, index); try { return Long.parseLong(pid); } catch (NumberFormatException e) { logger.debug(e.getMessage(), e); return null; } } else { return null; } } LiveJvmServiceImpl(LazyPlatformMBeanServer lazyPlatformMBeanServer,
            TransactionRegistry transactionRegistry, TransactionCollector transactionCollector,
            Availability threadAllocatedBytesAvailability, ConfigService configService,
            @Nullable File glowrootJarFile); }
LiveJvmServiceImpl implements LiveJvmService { @VisibleForTesting static @Nullable Long parseProcessId(String runtimeName) { int index = runtimeName.indexOf('@'); if (index > 0) { String pid = runtimeName.substring(0, index); try { return Long.parseLong(pid); } catch (NumberFormatException e) { logger.debug(e.getMessage(), e); return null; } } else { return null; } } LiveJvmServiceImpl(LazyPlatformMBeanServer lazyPlatformMBeanServer,
            TransactionRegistry transactionRegistry, TransactionCollector transactionCollector,
            Availability threadAllocatedBytesAvailability, ConfigService configService,
            @Nullable File glowrootJarFile); @Override boolean isAvailable(String agentId); @Override ThreadDump getThreadDump(String agentId); @Override String getJstack(String agentId); @Override long getAvailableDiskSpace(String agentId, String directory); @Override HeapDumpFileInfo heapDump(String agentId, String directory); @Override HeapHistogram heapHistogram(String agentId); @Override boolean isExplicitGcDisabled(String agentId); @Override void forceGC(String agentId); @Override MBeanDump getMBeanDump(String agentId, MBeanDumpKind mbeanDumpKind,
            List<String> objectNames); @Override List<String> getMatchingMBeanObjectNames(String agentId, String partialObjectName,
            int limit); @Override MBeanMeta getMBeanMeta(String agentId, String mbeanObjectName); @Override Map<String, String> getSystemProperties(String agentId); @Override Capabilities getCapabilities(String agentId); static @Nullable Long getProcessId(); }
LiveJvmServiceImpl implements LiveJvmService { @VisibleForTesting static @Nullable Long parseProcessId(String runtimeName) { int index = runtimeName.indexOf('@'); if (index > 0) { String pid = runtimeName.substring(0, index); try { return Long.parseLong(pid); } catch (NumberFormatException e) { logger.debug(e.getMessage(), e); return null; } } else { return null; } } LiveJvmServiceImpl(LazyPlatformMBeanServer lazyPlatformMBeanServer,
            TransactionRegistry transactionRegistry, TransactionCollector transactionCollector,
            Availability threadAllocatedBytesAvailability, ConfigService configService,
            @Nullable File glowrootJarFile); @Override boolean isAvailable(String agentId); @Override ThreadDump getThreadDump(String agentId); @Override String getJstack(String agentId); @Override long getAvailableDiskSpace(String agentId, String directory); @Override HeapDumpFileInfo heapDump(String agentId, String directory); @Override HeapHistogram heapHistogram(String agentId); @Override boolean isExplicitGcDisabled(String agentId); @Override void forceGC(String agentId); @Override MBeanDump getMBeanDump(String agentId, MBeanDumpKind mbeanDumpKind,
            List<String> objectNames); @Override List<String> getMatchingMBeanObjectNames(String agentId, String partialObjectName,
            int limit); @Override MBeanMeta getMBeanMeta(String agentId, String mbeanObjectName); @Override Map<String, String> getSystemProperties(String agentId); @Override Capabilities getCapabilities(String agentId); static @Nullable Long getProcessId();  }