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

Bug 332893

Summary: Class Precedence not working between Role callin and SubRole callin
Product: [Tools] Objectteams Reporter: Jan Marc Hoffmann <exelnet>
Component: OTDTAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 Flags: stephan.herrmann: iplog+
Version: 0.7.1   
Target Milestone: 0.8 M5   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
fix under test none

Description Jan Marc Hoffmann CLA 2010-12-18 16:14:29 EST
Hey guys,

The following code isn't working:

package otb;

public team class PrecBug {

	precedence after RA.RB, RA;

	protected team class RA playedBy A {
		
		void some() <- after void myMethod2();
		
		private void some() {
		
		}		
		protected class RB playedBy B {
			void some() <- after void myMethod2();
		}

	}
}

It works if instead of class precedence callin precedence is used. The quickfix on the inner some callin binding is generating invalid code aswell.

If possible it would be cool if you could backport this to the 0.7.x branch.

Thanks :=)

Jan Marc
Comment 1 Jan Marc Hoffmann CLA 2010-12-18 17:49:23 EST
I found another way to solve my problem. So backporting isn't necessary. :=)
Comment 2 Stephan Herrmann CLA 2011-01-04 16:05:55 EST
Created attachment 186048 [details]
fix under test

This patch resolves the issue, but it may not be what you expected,
so here's what&why:

The new test test4127_precedenceDeclaration18() triggers a new error message
to signal that the given code can't work: the precedence declaration tries
to coordinate callins from two different teams: the binding in RA is enabled
by activating team PrecBug, whereas the binding in RA.RB is enabled by
activating team PrecBug.RA. Thus, precedence is determined by the order of
activating these two teams, not by a precedence declaration.

Here's the new error message:
'precedence' declaration can only refer to direct role classes, however PrecBug.RA.RB is a nested role of team PrecBug.RA (OTJLD 4.8).
Comment 3 Stephan Herrmann CLA 2011-01-28 18:48:58 EST
Patch was committed as r1211, r1212 - all tests pass.
Comment 4 Stephan Herrmann CLA 2011-01-29 13:51:50 EST
Verified for 0.8M5 using build 201101290806.
Comment 5 Stephan Herrmann CLA 2011-01-29 13:57:27 EST
FYI: I filed bug 335777 as a FUP.
Comment 6 Stephan Herrmann CLA 2011-05-10 09:40:22 EDT
Setting iplog flag to acknowledge the contributed test case in comment 0.