Community
Participate
Working Groups
Build Identifier: 20110916-0149 Eclipse suggests methods could be made static, even if they refer to non-static stuff, namely generic stuff. It would be nice if it considered the non-static generics stuff when determining this error/warning. Example class to reproduce the problem... public class Foo<T> { private final T blah; public Foo( final T t ) { this.blah = t; } /** * @return the blah */ public T getBlah() { return blah; } //...... //...... public List<T> doSomeBlahThing( final Object[] blahs ) { final List<T> result = new ArrayList<T>( blahs.length ); for( final Object candidateBlah : blahs ) { result.add( (T) candidateBlah ); } return result; } } Reproducible: Always Steps to Reproduce: 1. Create a new java class called Foo 2. Ensure errors/warning for "Method can be static" is set to warning or above
Ayush, please follow up, TIA.
Jesper, please see if this is a duplicate of bug 378674. If there is value in generating a test case out of here, please do so.
I verified that Jesper's fix from https://bugs.eclipse.org/bugs/show_bug.cgi?id=378674#c27 solves this problem by verifying that on master where this fix has been released, we don't see the bogus hint anymore while continuing to get the bogus hint on the Java8 branch where this fix has not been cherry picked yet. *** This bug has been marked as a duplicate of bug 378674 ***
Verified for 4.3 M7 with build I20130428-2000
Verified for build SDK-I20130428-2000