105 |
*/ |
*/ |
106 |
private Locale locale; |
private Locale locale; |
107 |
|
|
108 |
|
private static Class resourceBundleClass; |
109 |
|
private static Class securityClass; |
110 |
|
|
111 |
|
static { |
112 |
|
try { |
113 |
|
resourceBundleClass = Class.forName("java.util.ResourceBundle"); |
114 |
|
securityClass = Class.forName("java.util.ResourceBundle$Security"); |
115 |
|
} catch (ClassNotFoundException e) { |
116 |
|
|
117 |
|
} |
118 |
|
} |
119 |
|
|
120 |
/** |
/** |
121 |
* We override SecurityManager in order to access getClassContext(). |
* We override SecurityManager in order to access getClassContext(). |
122 |
*/ |
*/ |
136 |
ClassLoader getCallingClassLoader() |
ClassLoader getCallingClassLoader() |
137 |
{ |
{ |
138 |
Class[] stack = getClassContext(); |
Class[] stack = getClassContext(); |
139 |
for (int i = 0; i < stack.length; i++) |
for (int i = 0; i < stack.length; i++) { |
140 |
if (stack[i] != Security.class && stack[i] != ResourceBundle.class) |
if (stack[i] != securityClass && stack[i] != resourceBundleClass) |
141 |
return stack[i].getClassLoader(); |
return stack[i].getClassLoader(); |
142 |
|
} |
143 |
|
|
144 |
return null; |
return null; |
145 |
} |
} |
146 |
} |
} |
235 |
catch (MissingResourceException ex) |
catch (MissingResourceException ex) |
236 |
{ |
{ |
237 |
} |
} |
238 |
throw new MissingResourceException("Key not found", |
|
239 |
getClass().getName(), key); |
throw new MissingResourceException("Key not found", getClass().getName(), key); |
240 |
} |
} |
241 |
|
|
242 |
/** |
/** |
523 |
catch (Exception ex) |
catch (Exception ex) |
524 |
{ |
{ |
525 |
// ignore them all |
// ignore them all |
526 |
|
foundBundle = null; |
527 |
} |
} |
528 |
if (foundBundle == null) |
if (foundBundle == null) |
529 |
{ |
{ |