net.so ... java.lang.StringBuffer_

christo00
2006-12-08
2013-04-23
  • christo00
    christo00
    2006-12-08

    I just tested  retroweaver-2.0Beta1/ because the previous stable version changed the semantics of
    my java program leading to a NullPointerException in the retroweaved code. Details see bug list.
    I wanted to see whether this is fixed in the 2.0Beta1.

    In the beta version I find many  more classes in the  retroweaver-rt.jar and  I do not completetly understand why these additional classes had been introduced.

    Consider the code

    CharSequence cs="";
    sb.append(cs);

    The problem under java  1.4 is that there is no method
    StringBuffer#append(CharSequence).

    To make it running under 1.4 I used to change my code to
    sb.append((Object)cs);

    In the new version retroweaver is doing this automatically by using
    a new replacement for java.lang.StringBuffer
    net.sourceforge.retroweaver.runtime.java.lang.StringBuffer_

    Apart from the  NullPointerException problem this works fine.
    But I wonder whether it is really necessary to make so many new classes and I am concerned about the size of the retroweaved classes and possible loss of speed.

    Each reference to a class makes a class file larger and classloading slower.