Community
Participate
Working Groups
we're getting following error: line 10: The method format(String, Object, Object) in the type Assert is not applicable for the arguments (String) line 11: The method format(String, Object, Object) from the type Assert is not visible the test code is as follows: ---code--- package bug; import static java.lang.String.format; import junit.framework.TestCase; public class Bug extends TestCase { static public void main(String[] args) { String msg = "something's rotten in the state of Denmark"; // bug System.out.println(format(msg)); System.out.println(format(msg, 1, 2)); } } ---end-of-code--- NOTES: 1) javac compiles this with no problems 2) inherited Assert.format(...) (which compiler tries to compile against) is package private (therefore not accessible) which means there's no conflict IMPACT: since we use static imports a lot, this is a show-stopper for us :-( WORKAROUND: - avoid static import and use String.format() explicitly
ok, lowering severity: at first sight, this kind of conflicts is maybe not so frequent... there useability impact might not be so fatal however, i guess described behaviour may have other side effects not directly related to static imports. this makes eclipse compiler sort of "unreliable" :-(
Created attachment 30526 [details] test case attaching simple test case classes: Bug - primary test case, demonstrates described problem Base + Xtended - alternate test case: demonstrates scope resolution problem
Added StaticImport test035 Released into HEAD and the 3.1.2 stream
Verified for 3.2M4 in I20051212-2000
Verified for 3.1.2 using build M20060109-1200.
*** Bug 129388 has been marked as a duplicate of this bug. ***