Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java code analysis tools.

 
Piyush Tripathi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm looking for some java code analysis tools to analyze the java code from performance point of view.The specific feature that i'm looking for is the ability of the tool to recognize a specific pattern in the code and point it out.For example if I want to search whether there is a use of nested for or while loop in the code then the tool should be able to recognize it.This was one example ,similarly the tool should be able to recognize a pattern in the code.

Please point out the appropriate tool for the purpose.Also point out the tools which can be used as plugins to Eclipse for the above mentioned purpose.

Thanks in advance,
Piyush
 
Balagopal Kannampallil
Ranch Hand
Posts: 136
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use JProfiler
 
Piyush Tripathi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the information.
What i read about Jprofiler is that it can give views on memory usage ,finding instances which are on the heap,shows call sequences and shows list of most time consuming methods.
What i wanted was a tool that could find a particular pattern in the code and list the ocurrence of it , if there is any such tool.

Piyush

 
Piyush Tripathi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was reading about a tool called PMD on the net.Has anyone worked on it .I read it can check for unused try/catch block.Can it find whether there is use of nested for or while loop in the code.

Thanks,
Piyush
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's possible to extend PMD with new rules to check. See "Customizing PMD" on the PMD site, especially "How to write a rule" and "Writing XPath rules".
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Piyush Tripathi wrote:Hi,
I was reading about a tool called PMD on the net.Has anyone worked on it .I read it can check for unused try/catch block.Can it find whether there is use of nested for or while loop in the code.

Yes it can find any Java construct. Keeping in mind nested loops aren't always a performance problem.
 
Deepak Lal
Ranch Hand
Posts: 561
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
One of the Ranchers has suggested using JProfiler,Can you tell me from where to download this tool.

My requirement is to to "independently" test java application.

Note:JDK used is 1.5

--
Deepak Lal
 
Prashant Saraf
Ranch Hand
Posts: 57
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i use two tools for Java code analysis. PDM and findbugs, both of them are available as plug-in for eclipse. They are best tool to review your code.

Piyush Tripathi wrote:Hi,
I was reading about a tool called PMD on the net.Has anyone worked on it .I read it can check for unused try/catch block.Can it find whether there is use of nested for or while loop in the code.


PDM does that even Findbugs does it for your

Thanks
Prashant Saraf
 
Deepak Lal
Ranch Hand
Posts: 561
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm new to using plugin(PDM and findbugs) in an Eclipse IDE. Can you tell me the steps for using these plugin in eclipse IDE.
--
Deepak Lal
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak Lal wrote:Hi,
I'm new to using plugin(PDM and findbugs) in an Eclipse IDE. Can you tell me the steps for using these plugin in eclipse IDE.
--
Deepak Lal

PMD and FindBugs.

Do you remember in your thread about EJBs where I asked you to show you made an effort? It took me less than a minute to find these two links. Did you spend any time trying to search for an answer before asking here? If so, please post an indication of what you tried next time you have a question. If not, why not? Are you less able to use Google than others?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic