Menu

How to go beyond JDK 1.5?

ilionyl
2008-02-22
2013-04-19
  • ilionyl

    ilionyl - 2008-02-22

    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.

     
    • ilionyl

      ilionyl - 2008-07-10

      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.

       

Log in to post a comment.