1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

[262731] - make access thread safe

This commit is contained in:
Alena Laskavaia 2009-01-28 15:38:40 +00:00
parent 233b122712
commit bc804b6935

View file

@ -19,7 +19,7 @@ public class EnvironmentReader {
private static Properties envVars = null; private static Properties envVars = null;
private static ArrayList<String> rawVars = null; private static ArrayList<String> rawVars = null;
public static Properties getEnvVars() { public static synchronized Properties getEnvVars() {
if (null != envVars) { if (null != envVars) {
return (Properties)envVars.clone(); return (Properties)envVars.clone();
} }
@ -41,9 +41,9 @@ public class EnvironmentReader {
return p.getProperty(key); return p.getProperty(key);
} }
public static String[] getRawEnvVars() { public static synchronized String[] getRawEnvVars() {
if (rawVars==null) if (rawVars==null)
getEnvVars(); getEnvVars();
return rawVars.toArray(new String[0]); return rawVars.toArray(new String[rawVars.size()]);
} }
} }