Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311885 - [compiler] toggling CCE in incremental compilation of nested phantom role
Summary: [compiler] toggling CCE in incremental compilation of nested phantom role
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 0.7   Edit
Hardware: Other All
: P3 major (vote)
Target Milestone: 0.7 M3   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-06 09:59 EDT by Stephan Herrmann CLA
Modified: 2010-05-29 17:38 EDT (History)
0 users

See Also:


Attachments
test & fix (4.75 KB, patch)
2010-05-18 16:06 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2010-05-06 09:59:19 EDT
Given the following teams:

public team class T1 {

	public team class T11 {

		protected class R1 {
			void m() {}
		}
		protected class R3 extends R1 {
		}
	}
	public team class T12 extends T11 {
	}
}

and

public team class T2 extends T1 {
	public team class T12 {
		protected class R3 {
			void m() {} 
		}
	}
}

recompiling T2 toggles between success and the following CCE:

java.lang.ClassCastException: org.eclipse.objectteams.otdt.internal.core.compiler.lookup.RoleTypeBinding cannot be cast to org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding
	at org.eclipse.objectteams.otdt.internal.core.compiler.model.TeamModel.strengthenRoleType(TeamModel.java:688)
	at org.eclipse.objectteams.otdt.internal.core.compiler.model.TeamModel.strengthenRoleType(TeamModel.java:652)
	at org.eclipse.objectteams.otdt.internal.core.compiler.lookup.TeamAnchor.getRoleTypeBinding(TeamAnchor.java:742)
	at org.eclipse.objectteams.otdt.internal.core.compiler.lookup.TeamAnchor.getRoleTypeBinding(TeamAnchor.java:710)
	at org.eclipse.objectteams.otdt.internal.core.compiler.lookup.RoleTypeBinding.forAnchor(RoleTypeBinding.java:234)
	at org.eclipse.objectteams.otdt.internal.core.compiler.lookup.DependentTypeBinding.maybeInstantiate(DependentTypeBinding.java:230)
	at org.eclipse.objectteams.otdt.internal.core.compiler.util.RoleTypeCreator.wrapTypesInMethodBindingSignature(RoleTypeCreator.java:794)
	at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveTypesFor(BinaryTypeBinding.java:1469)
...
Comment 1 Stephan Herrmann CLA 2010-05-18 16:06:40 EDT
Created attachment 169010 [details]
test & fix

This patch contains test and fix:
 - non-binary role type may still be RTB not STB, avoid the CCE by unwrapping
 - do report MissingCopiedRole even for purely copied
 - add severity AbortType to missingCopiedRole() to avoid continueing with
   unstrengthened/weakened role type (which caused bridge methods for creators)
Comment 2 Stephan Herrmann CLA 2010-05-18 16:08:51 EDT
Patch has been committed as r341.
Comment 3 Stephan Herrmann CLA 2010-05-29 17:38:56 EDT
verified for M3 using 201005282024