diff options
author | lana <none@none> | 2010-06-21 22:08:10 -0700 |
---|---|---|
committer | lana <none@none> | 2010-06-21 22:08:10 -0700 |
commit | 6048cc17b3db3a7a2fa986cf3d0f054cbd7e996f (patch) | |
tree | 40a0618c9173281cbf753620cca05e723795a460 /src/share/classes/sun/tools/jstat/Arguments.java | |
parent | 8f9dfbf06f99413917a4a9073a1d20cef6791766 (diff) | |
parent | 005b672c17171b2e3d5763bc82eb4d91b752e724 (diff) |
Merge
Diffstat (limited to 'src/share/classes/sun/tools/jstat/Arguments.java')
-rw-r--r-- | src/share/classes/sun/tools/jstat/Arguments.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/share/classes/sun/tools/jstat/Arguments.java b/src/share/classes/sun/tools/jstat/Arguments.java index a6453203a..151917559 100644 --- a/src/share/classes/sun/tools/jstat/Arguments.java +++ b/src/share/classes/sun/tools/jstat/Arguments.java @@ -47,6 +47,7 @@ public class Arguments { private static final String JVMSTAT_USERDIR = ".jvmstat"; private static final String OPTIONS_FILENAME = "jstat_options"; + private static final String UNSUPPORTED_OPTIONS_FILENAME = "jstat_unsupported_options"; private static final String ALL_NAMES = "\\w*"; private Comparator<Monitor> comparator; @@ -411,8 +412,8 @@ public class Arguments { return optionFormat; } - public URL[] optionsSources() { - URL[] sources = new URL[2]; + public List<URL> optionsSources() { + List<URL> sources = new ArrayList<URL>(); int i = 0; String filename = OPTIONS_FILENAME; @@ -421,7 +422,7 @@ public class Arguments { String userHome = System.getProperty("user.home"); String userDir = userHome + "/" + JVMSTAT_USERDIR; File home = new File(userDir + "/" + filename); - sources[i++] = home.toURL(); + sources.add(home.toURI().toURL()); } catch (Exception e) { if (debug) { System.err.println(e.getMessage()); @@ -430,8 +431,15 @@ public class Arguments { throw new IllegalArgumentException("Internal Error: Bad URL: " + e.getMessage()); } - sources[i] = this.getClass().getResource("resources/" + filename); - assert sources[i] != null; + URL u = this.getClass().getResource("resources/" + filename); + assert u != null; + sources.add(u); + + if (showUnsupported) { + u = this.getClass().getResource("resources/" + UNSUPPORTED_OPTIONS_FILENAME); + assert u != null; + sources.add(u); + } return sources; } } |