Code example for TreeSet

Methods: toArray

0
	public String getEnvVar(String name) {
		return (String) vars.get(name);
	} 
 
	public String[] getEnvVarNames() {
		return (String[]) (String[]) (new TreeSet(vars.keySet())).toArray(new String[vars.size()]);
	} 
 
	private void load() { 
		try { 
			if (!JREUtils.isJava5OrLater()) { 
				// Mac, Linux, Solaris, etc. should be covered by this default 
				// command... 
				String command = "env";
				if (OSUtils.isWindows()) 
					command = System.getProperty("os.name").toLowerCase().startsWith("windows 9") ? "command.com /vars set" : "cmd.exe /vars set";
				vars = new HashMap();
				Runtime runtime = Runtime.getRuntime();
				Process process = runtime.exec(command);
				BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(process.getInputStream()));
				String line;