Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354976

Summary: better reporting of playedBy inside plain class
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTJAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.1 M2   
Hardware: Other   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
test & fix none

Description Stephan Herrmann CLA 2011-08-17 11:59:49 EDT
The following snippet

public class TeamA {
	  public class R playedBy A {}
}

gives two errors:

	- playedBy cannot be resolved to a type

	- Object Teams keyword not enabled in this scope (OTJLD A.0.1).

In the hover over "playedBy" unfortunately the first useless error
hides the second one. Let's try to avoid the useless error.
Comment 1 Stephan Herrmann CLA 2011-08-21 14:53:30 EDT
Created attachment 201876 [details]
test & fix

Fixing this by an additional check in TypeReference.reportInvalidType(..):
If OT-keywords are enabled but a type reference has the same name as
an OT keyword and if an error has already been reported assume this is
a secondary error not worth reporting.

Test is re-used from existing with more precise expectation.
Comment 2 Stephan Herrmann CLA 2011-08-21 14:54:17 EDT
Patch has been released for 2.1 M2.
Comment 3 Stephan Herrmann CLA 2012-09-20 15:38:17 EDT
Verified using build 2.2.1.201209182002