Changeset 5992 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2013-06-06T20:10:29+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r5955 r5992 30 30 import org.openstreetmap.josm.tools.BugReportExceptionHandler; 31 31 import org.openstreetmap.josm.tools.OpenBrowser; 32 import org.openstreetmap.josm.tools.PlatformHookWindows; 32 33 import org.openstreetmap.josm.tools.Shortcut; 33 34 import org.openstreetmap.josm.tools.Utils; … … 57 58 } 58 59 60 private static void shortenParam(ListIterator<String> it, String[] param, String source, String target) { 61 if (source != null && target.length() < source.length() && param[1].startsWith(source)) { 62 it.set(param[0] + "=" + param[1].replace(source, target)); 63 } 64 } 65 59 66 /** 60 67 * Replies the report header (software and system info) … … 79 86 text.append("\n"); 80 87 try { 88 final String env_java_home = System.getenv("JAVA_HOME"); 89 final String env_java_home_alt = Main.platform instanceof PlatformHookWindows ? "%JAVA_HOME%" : "${JAVA_HOME}"; 90 final String prop_java_home = System.getProperty("java.home"); 91 final String prop_java_home_alt = "<java.home>"; 81 92 // Build a new list of VM parameters to modify it below if needed (default implementation returns an UnmodifiableList instance) 82 93 List<String> vmArguments = new ArrayList<String>(ManagementFactory.getRuntimeMXBean().getInputArguments()); 83 // Hide some parameters for privacy concerns84 94 for (ListIterator<String> it = vmArguments.listIterator(); it.hasNext(); ) { 85 95 String value = it.next(); 86 if (value.contains("=") && value.toLowerCase().startsWith("-dproxy")) { 87 it.set(value.split("=")[0]+"=xxx"); 96 if (value.contains("=")) { 97 String[] param = value.split("="); 98 // Hide some parameters for privacy concerns 99 if (param[0].toLowerCase().startsWith("-dproxy")) { 100 it.set(param[0]+"=xxx"); 101 // Shorten some parameters for readability concerns 102 } else { 103 shortenParam(it, param, env_java_home, env_java_home_alt); 104 shortenParam(it, param, prop_java_home, prop_java_home_alt); 105 } 88 106 } 89 107 }
Note:
See TracChangeset
for help on using the changeset viewer.