Menu

#154 Usage of J2SE-1.5 methods in filemanipulators package

closed
None
9
2008-04-07
2008-04-07
No

AntBuildfileManipulator and MSBuildBuildFileManipulator uses Boolean's parseBoolean(String) method. This method was introduced in Java 1.5 and causes Emonic to not compile properly in a J2SE-1.4 environment.

Discussion

  • Bernhard Brem

    Bernhard Brem - 2008-04-07

    Logged In: YES
    user_id=1245734
    Originator: NO

    Fixed in CVS

     
  • Bernhard Brem

    Bernhard Brem - 2008-04-07
    • assigned_to: nobody --> bernhardbrem
    • status: open --> closed
     
  • Remy Chi Jian Suen

    • status: closed --> open
     
  • Remy Chi Jian Suen

    Logged In: YES
    user_id=1299552
    Originator: YES

    Reopening.

    Replacing the call with the getBoolean(String) is not correct. getBoolean(String) and parseBoolean(String) do not do the same thing. If they did they wouldn't have added parseBoolean(String). ;)
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Boolean.html#getBoolean\(java.lang.String)

     
  • Remy Chi Jian Suen

    Logged In: YES
    user_id=1299552
    Originator: YES

    I suggest replacing it with something like Boolean.valueOf(cscNode.getAttribute(CSC_OPTIMIZE_ATTRIBUTE_NAME)).booleanValue(). The check ignores casing and the code is quite readable.

     
  • Bernhard Brem

    Bernhard Brem - 2008-04-07

    Logged In: YES
    user_id=1245734
    Originator: NO

    OK, this is a little bit better since the build files might origin not from emonic. So I updated it. Inside the build mechanisms: Since the manipulators write _exactly_ "true" and "false" it would not matter.....

     
  • Bernhard Brem

    Bernhard Brem - 2008-04-07
    • status: open --> closed
     
  • Remy Chi Jian Suen

    Logged In: YES
    user_id=1299552
    Originator: YES

    Well, users could technically change those values themselves. ;)

    In any case, it is compiling fine now, thanks Bernhard.

    I do recommend you get a 1.4.2 JDK setup in your environment though to prevent this from happening in the future.

     
  • Remy Chi Jian Suen

    • status: closed --> open
     
  • Bernhard Brem

    Bernhard Brem - 2008-04-07
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB