Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#228 Bug in UnusedPrivateMethod

release_3.4
closed
Rick Giles
None
5
2012-10-10
2004-05-08
WassongP
No

When using the following check :

<module name="Checker">
<module name="TreeWalker">
<module name="usage.UnusedPrivateMethod"/>
</module>
</module>

on the following code :

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JButton;

public final class Test {
public static void show() {
JButton b = new JButton( new AbstractAction() {
public void actionPerformed( ActionEvent e ) {
if ( e != null ) {
doSomething();
}
}
} );
}

private static void doSomething() {
}

}

I get the error :

Starting audit...
Test.java:16:25: Unused private method 'doSomething'.
Audit done.

Check Style exited abnormally with code 1 at Sat May 8
21:38:30

This result does not seem correct to me.

Discussion

  • Rick Giles
    Rick Giles
    2004-05-11

    Logged In: YES
    user_id=539926

    Fix committed to 3.5 CVS