Boolean.parseBoolean

2006-04-28
2013-04-23
  • Sascha Ledinsky

    Sascha Ledinsky - 2006-04-28

    Hello,
    I just tried RetroWeaver for my application, and so far everything seems to work well, but I ran into a minor problem.
    It seems that Boolean.parseBoolean(String s) is a new(!) feature of Java 1.5.0.
    Now of course it's easy to replace all calls to this method to something like s.equals("true"), but it would be great if RetroWeaver could take care of that.

     
    • Devesh Parekh

      Devesh Parekh - 2006-07-07

      I ran into the same problem. It is more correct to replace it with s.equalsIgnoreCase("true").

       
      • Garret Wilson

        Garret Wilson - 2006-07-07

        It is even more correct to replace it with a method that also checks s for null; otherwise, code that would work fine in JDK 5.0 will crash with a NullPointerException.

         
    • Bro

      Bro - 2007-03-16

      Hi

      Is parseBoolean included in version 2?

      I've got some trouble getting version 2 to work.
      I get this:

      E:\Programmer\Java\retroweaver\retroweaver-2.0>java -cp release\retroweaver-2.0.
      jar;lib\asm-3.0.jar;lib\asm-commons-3.0.jar;lib\asm-util-3.0.jar net.sourceforge
      .retroweaver.RetroWeaver JNative.jar JNative2.jar
      java.lang.NullPointerException
              at net.sourceforge.retroweaver.RetroWeaver.isRuntimeInClassPath(RetroWea
      ver.java:318)
              at net.sourceforge.retroweaver.RetroWeaver.weave(RetroWeaver.java:328)
              at net.sourceforge.retroweaver.RetroWeaver.weave(RetroWeaver.java:239)
              at net.sourceforge.retroweaver.RetroWeaver.main(RetroWeaver.java:413)

      Bro

       
      • Xavier Le Vourch

        Thanks for posting that exception trace even if it wasn't directly related to the parseBoolean problem. There was indeed a problem with an NPE in recent changes. That's now fixed in the svn repository.

        In fact, you should probably use Weaver instead of RetroWeaver as the main class as the former has more argument checkings and is considered the main entry point. I may remove the ability to use RetroWeaver as the main class in the future.

        Xavier

         
    • Bro

      Bro - 2007-03-16

      Hi

      Just ignore that silly error.
      The command is obviously totally wrong.

      parseBoolean doesn't seem to work in version 2 though...

      Bro

       
    • Bro

      Bro - 2007-03-16

      Please hit me in the head!
      Wrong runtime library in the classpath...

      Works like a charm, thanks!

      BRo

       
      • Xavier Le Vourch

        I'm glad you figured out what the problem was. Please let me know in the forum or using a Feature Request if some errors or messages are not clear and should be improved.

        Xavier

         

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks