@Test public void testUpgradeToCollectorAddressOnlyPortEmpty() { List<String> lines = ImmutableList.of("before=test", "collector.host=localhost", "collector.port=", "after=test"); List<String> newLines = MainEntryPoint.upgradeToCollectorAddressIfNeeded(lines); assertThat(newLines).containsExactly("before=test", "collector.address=localhost:8181", "after=test"); }
private static void upgradeToCollectorAddressIfNeeded(File propFile) throws IOException { List<String> lines = readPropertiesFile(propFile); List<String> newLines = upgradeToCollectorAddressIfNeeded(lines); if (!newLines.equals(lines)) { writePropertiesFile(propFile, newLines); } }
MainEntryPoint { private static void upgradeToCollectorAddressIfNeeded(File propFile) throws IOException { List<String> lines = readPropertiesFile(propFile); List<String> newLines = upgradeToCollectorAddressIfNeeded(lines); if (!newLines.equals(lines)) { writePropertiesFile(propFile, newLines); } } }
MainEntryPoint { private static void upgradeToCollectorAddressIfNeeded(File propFile) throws IOException { List<String> lines = readPropertiesFile(propFile); List<String> newLines = upgradeToCollectorAddressIfNeeded(lines); if (!newLines.equals(lines)) { writePropertiesFile(propFile, newLines); } } private  MainEntryPoint(); }
MainEntryPoint { private static void upgradeToCollectorAddressIfNeeded(File propFile) throws IOException { List<String> lines = readPropertiesFile(propFile); List<String> newLines = upgradeToCollectorAddressIfNeeded(lines); if (!newLines.equals(lines)) { writePropertiesFile(propFile, newLines); } } private  MainEntryPoint(); static void premain(Instrumentation instrumentation, Class<?>[] allPriorLoadedClasses,
            @Nullable File glowrootJarFile); static void runOfflineViewer(Directories directories,
            GlowrootAgentInitFactory glowrootAgentInitFactory); @EnsuresNonNull("startupLogger") static void initLogging(File confDir, @Nullable File sharedConfDir, File logDir,
            @Nullable Instrumentation instrumentation); @OnlyUsedByTests static void start(Map<String, String> properties); @OnlyUsedByTests static @Nullable GlowrootAgentInit getGlowrootAgentInit(); }
MainEntryPoint { private static void upgradeToCollectorAddressIfNeeded(File propFile) throws IOException { List<String> lines = readPropertiesFile(propFile); List<String> newLines = upgradeToCollectorAddressIfNeeded(lines); if (!newLines.equals(lines)) { writePropertiesFile(propFile, newLines); } } private  MainEntryPoint(); static void premain(Instrumentation instrumentation, Class<?>[] allPriorLoadedClasses,
            @Nullable File glowrootJarFile); static void runOfflineViewer(Directories directories,
            GlowrootAgentInitFactory glowrootAgentInitFactory); @EnsuresNonNull("startupLogger") static void initLogging(File confDir, @Nullable File sharedConfDir, File logDir,
            @Nullable Instrumentation instrumentation); @OnlyUsedByTests static void start(Map<String, String> properties); @OnlyUsedByTests static @Nullable GlowrootAgentInit getGlowrootAgentInit(); static final boolean PRINT_CLASS_LOADING; }