Searching for (and remove) unreferenced methods

Discussion in 'Java' started by Rogue Chameleon, Dec 2, 2004.

  1. Hi all

    FYI: We are using WSAD 5.0 as our IDE.

    Is there a simple (perhaps automated) way to find all methods in a
    project that are not referenced by any other methods/classes? I'm sure
    that there are some in our project, but short of checking each method
    individually, I don't know how to get at them.

    rogue chameleon
     
    Rogue Chameleon, Dec 2, 2004
    #1
    1. Advertising

  2. Rogue Chameleon wrote
    > FYI: We are using WSAD 5.0 as our IDE.
    >
    > Is there a simple (perhaps automated) way to find all methods in a
    > project that are not referenced by any other methods/classes? I'm sure
    > that there are some in our project, but short of checking each method
    > individually, I don't know how to get at them.
    >
    > rogue chameleon
    >


    In Menu Window -> Preferences -> Java -> Compiler -> Problems
    is possible to set:
    unused private types, methods or fields:
    Warning

    This works only for private methods, but for other scopes.

    It's possible to using public methods per reflection.
    This is the reason for no checking this methods.

    Heiner Kuecker
    Internet: http://www.heinerkuecker.de http://www.heiner-kuecker.de
    JSP WorkFlow PageFlow Page Flow FlowControl Navigation: http://www.control-and-command.de
    Expression Language Parser: http://www.heinerkuecker.de/Expression.html
     
    Heiner Kücker, Dec 2, 2004
    #2
    1. Advertising

  3. > Is there a simple (perhaps automated) way to find all methods in a
    > project that are not referenced by any other methods/classes? I'm sure
    > that there are some in our project, but short of checking each method
    > individually, I don't know how to get at them.

    You should look at ProGuard - it's an optimisation tool that does that -
    but to the compiled class-files, though. However, I reckon you can ask
    it to tell which methods are unused...

    // Martin Egholm
     
    Martin Egholm Nielsen, Dec 3, 2004
    #3
  4. Thanks for the tips!
     
    Rogue Chameleon, Dec 14, 2004
    #4
    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. John Dalberg

    Tool to get unreferenced image files?

    John Dalberg, Feb 4, 2005, in forum: HTML
    Replies:
    1
    Views:
    419
    Spartanicus
    Feb 4, 2005
  2. Tzu-Chien Chiu
    Replies:
    1
    Views:
    437
    White Wolf
    Sep 15, 2003
  3. Alzane

    unreferenced local variable

    Alzane, Nov 29, 2004, in forum: C++
    Replies:
    11
    Views:
    16,709
    Method Man
    Nov 30, 2004
  4. Halfdan Holger Knudsen

    unreferenced (???) variable; prob. simple

    Halfdan Holger Knudsen, Sep 15, 2003, in forum: Python
    Replies:
    2
    Views:
    336
    Terry Reedy
    Sep 16, 2003
  5. Andy Jewell
    Replies:
    0
    Views:
    397
    Andy Jewell
    Sep 15, 2003
Loading...

Share This Page