Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2005

Tip: Looking for answers? Try searching our database.

Find coding patterns

Thread view: 
Daniel Schneller - 27 Jan 2005 08:43 GMT
Hi!

I am looking for a way to detect certan patterns in our project's code.
For example I'd like to find all occurences of something like

LOOP
 |
 +-- CLASS_INSTANCEOF_CERTAINSUPERCLASS.METHODCALL

I. e. I'd like to find out, if and where someone calls methods of
classes of a certain superclass in any kind of loop, because usually
those classes contain only methods that should be called with caution.

Would Checkstyle be suitable? As far as I have seen it concentrates on
syntactic problems, but for the "instanceof" check I'd have to have a
little more of a semantic means of checking.

I'd be happy to hear about any other tool (preferrably with Eclipse
integration) or way to find such things.

Daniel
bugbear - 27 Jan 2005 13:46 GMT
> Hi!
>
[quoted text clipped - 8 lines]
> classes of a certain superclass in any kind of loop, because usually
> those classes contain only methods that should be called with caution.

take a look at findbug, which does something similar and is
extensible/customisable

   BugBear
Andrea Desole - 27 Jan 2005 14:33 GMT
> take a look at findbug, which does something similar and is
> extensible/customisable

Maybe you meant FindBugs?

http://findbugs.sourceforge.net/
Daniel Schneller - 27 Jan 2005 14:35 GMT
> Maybe you meant FindBugs?
>
> http://findbugs.sourceforge.net/

Thank you!
I will take a look at it. Any other hints/suggestions would still be
highly appreciated :)

Daniel
Andrea Desole - 27 Jan 2005 14:47 GMT
> Thank you!
> I will take a look at it. Any other hints/suggestions would still be
> highly appreciated :)

Forgot to mention that: I just heard someone talking about PMD, but I
don't know that much about it (don't know that much about FindBugs either):

http://pmd.sourceforge.net/
bugbear - 28 Jan 2005 14:13 GMT
>> take a look at findbug, which does something similar and is
>> extensible/customisable
>
> Maybe you meant FindBugs?
>
> http://findbugs.sourceforge.net/

(see recursion :-)

   BugBear
Andrew McDonagh - 27 Jan 2005 20:06 GMT
> Hi!
>
[quoted text clipped - 17 lines]
>
> Daniel

Take a look at PMD, there's loads of rules supplied and you can write
your own too.

http://pmd.sourceforge.net/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.