Community
Participate
Working Groups
If code in a 1.4 project is using a method (static or otherwise) from code inside a 1.5 project that has generics in the signature, an error marker appears saying 'The method xxx ... is undefined for the type ...'. Any methods using generics do not appear in code assist. Although the error is displayed, the class file is still generated and runs fine. I am using Eclipse 3.1 (build I20050513-1415). This bug only seems to happen with generics, and only when referring to the project in the classpath (the new enumerations and varargs are unaffected). The marker and code assist behave correctly if using a jar or the 1.5 project's class folder from the Libraries tab when setting the build path.
You can only use 5.0 constructs if the project is set to 5.0. That's how the builder works.
Created attachment 22392 [details] Sample projects
I'm not suggesting that 1.4 should be able to make use of 1.5 constructs. What I'm saying is that if you have a 1.5 project and older 1.4 code is using it, markers incorrectly appear saying that methods do not exist. Please look at the two projects I'm attaching. Project A is 1.4 compliant, Project B is 1.5 compliant. You'll see that in A, there is a marker saying 'The method foo(List) is undefined for the type Blah'. If you use code assist to get methods for Blah, foo is not on the list. The appropriate behaviour should be that "Blah.foo(List arg0)" appear in code assist (whereas 1.5 projects would see "Blah.foo(List<String> list)"), and that marker should not be there. This is the bug, and it only happens with projects in the buildpath. If you export B into a jar and use it in A, "Blah.foo(List arg0)" appears. The project and the JAR should behave the same way.
Created attachment 22408 [details] Editor with temporary error There's no error marker reported but a temporary problem is reported (see attached picture) by JDT Core and the method is not reported by code assist.
+1 for RC2 Source type converter should filter out 1.5 artifacts when client project is not 1.5 source level.
*** Bug 98262 has been marked as a duplicate of this bug. ***
Changed SourceTypeConverter to not convert 1.5 constructs if in 1.4 mode or below. Added regression test ReconcilerTest#testTwoProjectsWithDifferentCompliance()
Verified with N20050609-0010 + JDT/Core HEAD
Verified for 3.1 RC2 using build I20050610-0010