Java code analyzer recommendations?

Discussion in 'Java' started by Harpstein, Nov 18, 2003.

  1. Harpstein

    Harpstein Guest

    Hey all,

    I'm wondering if any products exist out there that will analyze my Java code
    and report back to me about what JDK calls I'm making and what version the
    calls are in. I'd prefer a free product, but anything will do at this point.

    The problem I have is that my stuff has to work on Mac OS X, and since they
    are still at 1.3.1 of the JDK I'm concerned that I have a bunch of "hidden"
    bugs where I'm making calls to 1.4 methods that will fail on Mac. However,
    they're runtime failures so the only way I know to find them right now is
    through testing. One example I've already found is that I was using
    String.replaceAll() which is a 1.4 method, and it was failing on Mac OS X.

    Any help/suggestions would be greatly appreciated.

    Thanks,

    harpstein
    Harpstein, Nov 18, 2003
    #1
    1. Advertising

  2. Harpstein

    ak Guest

    you can install on your computer java 1.3.1 and recompile all with 1.3.1
    compiler.

    I use to compile my library 1.18 and for javadoc creating 1.3 or 1.4
    I just switch it in my IDE (Intellij IDEA).

    "Harpstein" <> schrieb im Newsbeitrag
    news:...
    > Hey all,
    >
    > I'm wondering if any products exist out there that will analyze my Java

    code
    > and report back to me about what JDK calls I'm making and what version the
    > calls are in. I'd prefer a free product, but anything will do at this

    point.
    >
    > The problem I have is that my stuff has to work on Mac OS X, and since

    they
    > are still at 1.3.1 of the JDK I'm concerned that I have a bunch of

    "hidden"
    > bugs where I'm making calls to 1.4 methods that will fail on Mac. However,
    > they're runtime failures so the only way I know to find them right now is
    > through testing. One example I've already found is that I was using
    > String.replaceAll() which is a 1.4 method, and it was failing on Mac OS X.
    >
    > Any help/suggestions would be greatly appreciated.
    >
    > Thanks,
    >
    > harpstein
    >
    >
    ak, Nov 18, 2003
    #2
    1. Advertising

  3. Harpstein

    Harpstein Guest

    My stuff is in a jar and I did compile it on my Mac with 1.3.1 and it didn't
    complain about anything. Yet, there was the String.replaceAll method that
    was invalid.

    It seems like I always find these NoSuchMethodError errors at runtime
    instead of compile-time...

    -harpstein

    "ak" <> wrote in message news:bpdbfv$1ql$...
    > you can install on your computer java 1.3.1 and recompile all with 1.3.1
    > compiler.
    >
    > I use to compile my library 1.18 and for javadoc creating 1.3 or 1.4
    > I just switch it in my IDE (Intellij IDEA).
    >
    > "Harpstein" <> schrieb im Newsbeitrag
    > news:...
    > > Hey all,
    > >
    > > I'm wondering if any products exist out there that will analyze my Java

    > code
    > > and report back to me about what JDK calls I'm making and what version

    the
    > > calls are in. I'd prefer a free product, but anything will do at this

    > point.
    > >
    > > The problem I have is that my stuff has to work on Mac OS X, and since

    > they
    > > are still at 1.3.1 of the JDK I'm concerned that I have a bunch of

    > "hidden"
    > > bugs where I'm making calls to 1.4 methods that will fail on Mac.

    However,
    > > they're runtime failures so the only way I know to find them right now

    is
    > > through testing. One example I've already found is that I was using
    > > String.replaceAll() which is a 1.4 method, and it was failing on Mac OS

    X.
    > >
    > > Any help/suggestions would be greatly appreciated.
    > >
    > > Thanks,
    > >
    > > harpstein
    > >
    > >

    >
    >
    Harpstein, Nov 18, 2003
    #3
  4. Harpstein wrote:
    > My stuff is in a jar and I did compile it on my Mac with 1.3.1 and it didn't
    > complain about anything. Yet, there was the String.replaceAll method that
    > was invalid.
    >
    > It seems like I always find these NoSuchMethodError errors at runtime
    > instead of compile-time...


    Then you're doing something wrong. There WAS NO String.replaceAll() method
    prior to 1.4, so the code could never compile on a 1.3 JDK.

    Either you did not compile it, or you did not use a 1.3 JDK.
    Michael Borgwardt, Nov 18, 2003
    #4
  5. Harpstein

    Harpstein Guest

    Well, 1.4.1 is installed on my Mac, but it's not the default runtime so I
    just assumed that it wasn't the default compile either. Maybe that's what's
    goofing me up...

    -harpstein

    "Michael Borgwardt" <> wrote in message
    news:bpde1o$1m491o$-berlin.de...
    > Harpstein wrote:
    > > My stuff is in a jar and I did compile it on my Mac with 1.3.1 and it

    didn't
    > > complain about anything. Yet, there was the String.replaceAll method

    that
    > > was invalid.
    > >
    > > It seems like I always find these NoSuchMethodError errors at runtime
    > > instead of compile-time...

    >
    > Then you're doing something wrong. There WAS NO String.replaceAll() method
    > prior to 1.4, so the code could never compile on a 1.3 JDK.
    >
    > Either you did not compile it, or you did not use a 1.3 JDK.
    >
    Harpstein, Nov 18, 2003
    #5
  6. Harpstein

    ak Guest

    if you use IDE then you should "rebuild projekt", otherwise first manuell
    delete all your class files and then recompile.


    "Harpstein" <> schrieb im Newsbeitrag
    news:...
    > Well, 1.4.1 is installed on my Mac, but it's not the default runtime so I
    > just assumed that it wasn't the default compile either. Maybe that's

    what's
    > goofing me up...
    >
    > -harpstein
    >
    > "Michael Borgwardt" <> wrote in message
    > news:bpde1o$1m491o$-berlin.de...
    > > Harpstein wrote:
    > > > My stuff is in a jar and I did compile it on my Mac with 1.3.1 and it

    > didn't
    > > > complain about anything. Yet, there was the String.replaceAll method

    > that
    > > > was invalid.
    > > >
    > > > It seems like I always find these NoSuchMethodError errors at runtime
    > > > instead of compile-time...

    > >
    > > Then you're doing something wrong. There WAS NO String.replaceAll()

    method
    > > prior to 1.4, so the code could never compile on a 1.3 JDK.
    > >
    > > Either you did not compile it, or you did not use a 1.3 JDK.
    > >

    >
    >
    ak, Nov 18, 2003
    #6
  7. Harpstein wrote:
    > Well, 1.4.1 is installed on my Mac, but it's not the default runtime so I
    > just assumed that it wasn't the default compile either. Maybe that's what's
    > goofing me up...


    Yes, that sounds like it.

    You can explicitly specify the API to compile against with the -bootclasspath
    and -extdirs options to javac. Using that and -target 1.3 you can compile code
    that should definitely run on 1.3 no matter which compiler it is.
    Michael Borgwardt, Nov 18, 2003
    #7
  8. Harpstein

    Harpstein Guest

    thanks for the ptrs. I'm using Ant to build so it should be too difficult to
    do that at all.

    -matt

    "Michael Borgwardt" <> wrote in message
    news:bpdgp6$1nhu99$-berlin.de...
    > Harpstein wrote:
    > > Well, 1.4.1 is installed on my Mac, but it's not the default runtime so

    I
    > > just assumed that it wasn't the default compile either. Maybe that's

    what's
    > > goofing me up...

    >
    > Yes, that sounds like it.
    >
    > You can explicitly specify the API to compile against with

    the -bootclasspath
    > and -extdirs options to javac. Using that and -target 1.3 you can compile

    code
    > that should definitely run on 1.3 no matter which compiler it is.
    >
    Harpstein, Nov 18, 2003
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    4,048
  2. Manfred Schneider
    Replies:
    6
    Views:
    3,168
    Manfred Schneider
    Dec 17, 2005
  3. Alex Hunsley
    Replies:
    6
    Views:
    472
    opalinski from opalpaweb
    Mar 28, 2006
  4. Software

    Code/Object analyzer for fixing

    Software, Mar 5, 2004, in forum: C Programming
    Replies:
    4
    Views:
    343
    Rob Thorpe
    Mar 7, 2004
  5. Assertor
    Replies:
    2
    Views:
    463
    Jaspreet
    Feb 13, 2006
Loading...

Share This Page