Now UTF8ResourceBundle is interface compatible with JDK 1.5 because I simply copy and paste the source code from java.util.ResourceBundle of JDK 1.5.
But how to make it also compatible to JDK 1.6 interface, and any future version?
The first thing that comes into my mind is to "inherit" java.util.ResourceBundle. But that's very risky because ResourceBundle provide all the "good features" in with package or private accessibility. Therefore, if you inherit it, you almost have to implement the "longest prefix match" by yourself, which is potentially risky.
However, I think I possibly will do it eventually. Since my master thesis was actually about longest prefix match implementation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Now UTF8ResourceBundle is interface compatible with JDK 1.5 because I simply copy and paste the source code from java.util.ResourceBundle of JDK 1.5.
But how to make it also compatible to JDK 1.6 interface, and any future version?
The first thing that comes into my mind is to "inherit" java.util.ResourceBundle. But that's very risky because ResourceBundle provide all the "good features" in with package or private accessibility. Therefore, if you inherit it, you almost have to implement the "longest prefix match" by yourself, which is potentially risky.
However, I think I possibly will do it eventually. Since my master thesis was actually about longest prefix match implementation.
I found the solution. That is, to inherit ResourceBundle.Control, a inner public static class introduced with JDK6.
Release 1.1 has a new class net.sf.j18n.J18n. This class is implemented this way to guarantee forward compatibility.