Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java code analyzer recommendations?

Reply
Thread Tools

Java code analyzer recommendations?

 
 
Harpstein
Guest
Posts: n/a
 
      11-18-2003
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


 
Reply With Quote
 
 
 
 
ak
Guest
Posts: n/a
 
      11-18-2003
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" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Harpstein
Guest
Posts: n/a
 
      11-18-2003
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" <(E-Mail Removed)> wrote in message news:bpdbfv$1ql$(E-Mail Removed)...
> 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" <(E-Mail Removed)> schrieb im Newsbeitrag
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
Michael Borgwardt
Guest
Posts: n/a
 
      11-18-2003
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.

 
Reply With Quote
 
Harpstein
Guest
Posts: n/a
 
      11-18-2003
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" <(E-Mail Removed)> wrote in message
news:bpde1o$1m491o$(E-Mail Removed)-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.
>



 
Reply With Quote
 
ak
Guest
Posts: n/a
 
      11-18-2003
if you use IDE then you should "rebuild projekt", otherwise first manuell
delete all your class files and then recompile.


"Harpstein" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:bpde1o$1m491o$(E-Mail Removed)-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.
> >

>
>



 
Reply With Quote
 
Michael Borgwardt
Guest
Posts: n/a
 
      11-18-2003
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.

 
Reply With Quote
 
Harpstein
Guest
Posts: n/a
 
      11-18-2003
thanks for the ptrs. I'm using Ant to build so it should be too difficult to
do that at all.

-matt

"Michael Borgwardt" <(E-Mail Removed)> wrote in message
news:bpdgp6$1nhu99$(E-Mail Removed)-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.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JSP Code Review Tool or Syntax Analyzer? scottleff@hotmail.com Java 1 08-05-2011 06:36 AM
What was that Java code analyzer link someone posted a few days ago? Alex Hunsley Java 6 03-28-2006 03:20 PM
Is there any code analyzer for c/c++ header file Assertor C++ 2 02-13-2006 02:39 AM
Source code analyzer tools for J2SE / J2EE code base Manfred Schneider Java 6 12-17-2005 12:39 PM
Code/Object analyzer for fixing Software C Programming 4 03-07-2004 03:20 PM



Advertisments