Reported by bernd_hohmann on 2004-11-12 23:57 UTC
Two minor compatibility issues:
- Class ErrorMessages, declaration part
It's dangerous to create an instance of RessourceBundle
here because the IBM implementation reads the ressource
file asap which causes an ExceptionInInitializerError
in the class and it is hard to track this down.
Suggested change in declaration part:
private static ResourceBundle RESOURCE_BUNDLE = null;
Suggested change in public static String
get(ErrorMessages msg)
try {
if (RESOURCE_BUNDLE == null) {
RESOURCE_BUNDLE =
ResourceBundle.getBundle("JFlex.Messages");
}
return RESOURCE_BUNDLE.getString(msg.key);
} catch (MissingResourceException e) {
return '!' + msg.key + '!';
}
Or a warning to System.out if .getBundle(...) throwed a
MissingResourceException
- Skeleton#readDefault()
suggested Change:
//ClassLoader l = Skeleton.class.getClassLoader();
//URL url = l.getResource("JFlex/skeleton.default");
URL url =
ClassLoader.getSystemResource("JFlex/skeleton.default");
At least for me, the first variant returns NULL as
classloader, the second variant works because jflex.jar
is in the classpath
Reported by bernd_hohmann on 2004-11-12 23:57 UTC
Two minor compatibility issues:
It's dangerous to create an instance of RessourceBundle
here because the IBM implementation reads the ressource
file asap which causes an ExceptionInInitializerError
in the class and it is hard to track this down.
Suggested change in declaration part:
private static ResourceBundle RESOURCE_BUNDLE = null;
Suggested change in public static String
get(ErrorMessages msg)
try {
if (RESOURCE_BUNDLE == null) {
RESOURCE_BUNDLE =
ResourceBundle.getBundle("JFlex.Messages");
}
return RESOURCE_BUNDLE.getString(msg.key);
} catch (MissingResourceException e) {
return '!' + msg.key + '!';
}
Or a warning to System.out if .getBundle(...) throwed a
MissingResourceException
suggested Change:
//ClassLoader l = Skeleton.class.getClassLoader();
//URL url = l.getResource("JFlex/skeleton.default");
URL url =
ClassLoader.getSystemResource("JFlex/skeleton.default");
At least for me, the first variant returns NULL as
classloader, the second variant works because jflex.jar
is in the classpath