Changeset 11650 in josm for trunk/src/org
- Timestamp:
- 2017-03-02T02:16:00+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r11642 r11650 21 21 import java.util.Arrays; 22 22 import java.util.Collection; 23 import java.util.Collections;24 23 import java.util.EnumSet; 25 24 import java.util.HashMap; … … 156 155 157 156 /** 158 * Command-line arguments used to run the application.159 */160 protected static final List<String> COMMAND_LINE_ARGS = new ArrayList<>();161 162 /**163 157 * The worker thread slave. This is for executing all long and intensive 164 158 * calculations. The executed runnables are guaranteed to be executed separately … … 212 206 public static final FileWatcher fileWatcher = new FileWatcher(); 213 207 214 pr otectedstatic final Map<String, Throwable> NETWORK_ERRORS = new HashMap<>();208 private static final Map<String, Throwable> NETWORK_ERRORS = new HashMap<>(); 215 209 216 210 private static final Set<OnlineResource> OFFLINE_RESOURCES = EnumSet.noneOf(OnlineResource.class); … … 1384 1378 1385 1379 /** 1386 * Returns the command-line arguments used to run the application.1387 * @return the command-line arguments used to run the application1388 * @since 83561389 */1390 public static List<String> getCommandLineArgs() {1391 return Collections.unmodifiableList(COMMAND_LINE_ARGS);1392 }1393 1394 /**1395 1380 * Returns the JOSM website URL. 1396 1381 * @return the josm website URL -
trunk/src/org/openstreetmap/josm/actions/RestartAction.java
r11093 r11650 17 17 import org.openstreetmap.josm.Main; 18 18 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec; 19 import org.openstreetmap.josm.gui.MainApplication; 19 20 import org.openstreetmap.josm.gui.io.SaveLayersDialog; 20 21 import org.openstreetmap.josm.tools.ImageProvider; … … 165 166 } 166 167 // finally add program arguments 167 cmd.addAll(Main .getCommandLineArgs());168 cmd.addAll(MainApplication.getCommandLineArgs()); 168 169 return cmd; 169 170 } -
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r11620 r11650 29 29 import org.openstreetmap.josm.data.preferences.Setting; 30 30 import org.openstreetmap.josm.gui.ExtendedDialog; 31 import org.openstreetmap.josm.gui.MainApplication; 31 32 import org.openstreetmap.josm.gui.preferences.SourceEditor; 32 33 import org.openstreetmap.josm.gui.preferences.map.MapPaintPreference; … … 166 167 Main.trace(e); 167 168 } 168 List<String> commandLineArgs = Main .getCommandLineArgs();169 List<String> commandLineArgs = MainApplication.getCommandLineArgs(); 169 170 if (!commandLineArgs.isEmpty()) { 170 171 text.append("Program arguments: ").append(Arrays.toString(paramCleanup(commandLineArgs).toArray())).append('\n'); -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r11509 r11650 23 23 import java.security.Policy; 24 24 import java.security.cert.CertificateException; 25 import java.util.ArrayList; 25 26 import java.util.Arrays; 26 27 import java.util.Collection; 28 import java.util.Collections; 27 29 import java.util.List; 28 30 import java.util.Locale; 31 import java.util.Map; 29 32 import java.util.Optional; 30 33 import java.util.Set; … … 80 83 public class MainApplication extends Main { 81 84 85 /** 86 * Command-line arguments used to run the application. 87 */ 88 private static final List<String> COMMAND_LINE_ARGS = new ArrayList<>(); 89 82 90 private MainFrame mainFrame; 83 91 … … 118 126 } 119 127 super.shutdown(); 128 } 129 130 /** 131 * Returns the command-line arguments used to run the application. 132 * @return the command-line arguments used to run the application 133 * @since 11650 134 */ 135 public static List<String> getCommandLineArgs() { 136 return Collections.unmodifiableList(COMMAND_LINE_ARGS); 120 137 } 121 138 … … 239 256 } 240 257 241 Main.COMMAND_LINE_ARGS.addAll(Arrays.asList(argArray));258 COMMAND_LINE_ARGS.addAll(Arrays.asList(argArray)); 242 259 243 260 boolean skipLoadingPlugins = args.hasOption(Option.SKIP_PLUGINS); … … 567 584 568 585 private static boolean handleNetworkErrors() { 569 boolean condition = !NETWORK_ERRORS.isEmpty(); 586 Map<String, Throwable> networkErrors = Main.getNetworkErrors(); 587 boolean condition = !networkErrors.isEmpty(); 570 588 if (condition) { 571 589 Set<String> errors = new TreeSet<>(); 572 for (Throwable t : NETWORK_ERRORS.values()) {590 for (Throwable t : networkErrors.values()) { 573 591 errors.add(t.toString()); 574 592 } … … 580 598 "It may be due to a missing proxy configuration.<br>" + 581 599 "Would you like to change your proxy settings now?", 582 Utils.joinAsHtmlUnorderedList( NETWORK_ERRORS.keySet()),600 Utils.joinAsHtmlUnorderedList(networkErrors.keySet()), 583 601 Utils.joinAsHtmlUnorderedList(errors) 584 602 ));
Note:
See TracChangeset
for help on using the changeset viewer.