Bug 219298 - No error markers displayed, when using generics with AJDT
Summary: No error markers displayed, when using generics with AJDT
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.4   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 1.6.0 M2   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-18 05:34 EST by Jochen Unger CLA
Modified: 2008-02-19 13:55 EST (History)
1 user (show)

See Also:


Attachments
Screenshot (485.68 KB, image/bmp)
2008-02-18 05:34 EST, Jochen Unger CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jochen Unger CLA 2008-02-18 05:34:59 EST
Created attachment 89966 [details]
Screenshot

Hello everyone,

we are using AspectJ within a RCP project and found the following problem, when using Java 5 Generics:

The code

public class TestMarkers {
	public class SuperGenericsType {}
	
	public class SubGenericsType 
		//Following line would produce correct code
		//extends SuperGenericsType
	{}
	
	public class Super<T extends SuperGenericsType> {}
	
	public class Sub extends Super<SubGenericsType> {}
}

is semantically not correct, because the class "Super" defines its typed parameter to be a subclass of type "SuperGenericsType". The extending class "Sub" defines "SubGenericsType" as the typed parameter. Because "SubGenericsType" is not extending "SuperGenericsType" (the code is commented out), this leads to an error.

When not using the AspectJ capabilities, the error is displayed correct (underlined as an error, error marker in the vertical ruler and listed in the problem view).
When using this code with AspectJ capabilities, the error is only underlined but neither shown in the problem view nor marked in the vertical ruler.

Also the compilation unit is not marked as semantical incorrect, which makes it hard to find those errors in a big project.

I attached a screenshot of the editor window.

Greets Jochen

Versions:
Java: 1.5_12
Eclipse: 3.3.1.1
AJDT: 1.5.1
AspectJ: 1.5.4
Comment 1 Andrew Clement CLA 2008-02-18 20:31:56 EST
I was half expecting this to be a bug that is fixed by moving to the more recent AspectJ6 builds - but I just tried it on the latest dev build at it still fails to report the error.  I'm slightly confused right now as we don't modify that area of the JDT compiler processing.
Comment 2 Andrew Clement CLA 2008-02-19 13:55:28 EST
fix committed.  The code in AJLookupEnvironment.completeTypeBindings() that overrides LookupEnvironment.completeTypeBindings() did not include the extra call 'checkParameterizedTypes()' that had been included in some revision of the LookupEnvironment class since we last merged with the JDT compiler.  Adding in the call causes the error to come out as expected.  Fix for this will be in an AspectJ1.6.0 dev build shortly, then in an AJDT update after that.