Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Objectteams » Fragile compilation for circularly referenced classes
Fragile compilation for circularly referenced classes [message #515952] Mon, 22 February 2010 10:39 Go to next message
Eugene Hutorny is currently offline Eugene Hutorny
Messages: 109
Registered: January 2010
Senior Member
Hi Stephan,

I noticed that the compilation in UI sporadically fails on classes with circular references (please take a look at the example below). The problem is gone when recompiled with Project>Clean....

The example:
public team class A<B b> {
	public void run() {
		System.out.println("A.run()");
	}
	public class Q playedBy R<@b> {
		void run() <- replace void run();
		// 1. originally the compiler forced to declare 'Object run()'
		// 2. compile process is fragile with circular references, like in this exercise
		callin void run() {
			base.run();
			System.out.println("Q.run()");
		}
	}	
}

public team class B {
	public class R playedBy A {
		void run() <- replace void run();
		callin void run() {
			base.run();
			System.out.println("R.run()");			
		}
	}	
}

public class TheTest {
	final B b = new B();
	final A a = new A<@b>();
	
	public void run() {
		within(b) {
			a.run();			
		}
	}
 }


The exception:

eclipse.buildId=I20100129.OT-1.4.0M2
java.version=1.5.0_16
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=uk_UA
Command-line arguments:  -os win32 -ws win32 -arch x86


Error
Mon Feb 22 12:21:48 EET 2010
Error checking callin/callout binding

Java Model Exception: Core Exception [code 0] Base class for role A.Q not found.
at org.objectteams.otdt.internal.core.RoleType.getBaseClass(RoleType.java:178)
at org.objectteams.otdt.internal.core.CallinMapping.findBaseMethods(CallinMapping.java:228)
at org.objectteams.otdt.internal.core.CallinMapping.getBoundBaseMethods(CallinMapping.java:202)
at org.objectteams.otdt.internal.ui.callinmarkers.CallinMarkerCreator2.searchMemberBindings(CallinMarkerCreator2.java:612)
at org.objectteams.otdt.internal.ui.callinmarkers.CallinMarkerCreator2.updateMethodMarkers(CallinMarkerCreator2.java:373)
at org.objectteams.otdt.internal.ui.callinmarkers.CallinMarkerCreator2.updateCallinMarkers(CallinMarkerCreator2.java:297)
at org.objectteams.otdt.internal.ui.callinmarkers.CallinMarkerCreator2.access$1(CallinMarkerCreator2.java:267)
at org.objectteams.otdt.internal.ui.callinmarkers.CallinMarkerCreator2$3.updateMarkers(CallinMarkerCreator2.java:252)
at org.objectteams.otdt.internal.ui.callinmarkers.CallinMarkerJob.run(CallinMarkerJob.java:58)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.eclipse.core.runtime.CoreException: Base class for role A.Q not found.
at org.objectteams.otdt.internal.core.RoleType.getBaseClass(RoleType.java:178)
at org.objectteams.otdt.internal.core.CallinMapping.findBaseMethods(CallinMapping.java:228)
at org.objectteams.otdt.internal.core.CallinMapping.getBoundBaseMethods(CallinMapping.java:202)
at org.objectteams.otdt.internal.ui.callinmarkers.CallinMarkerCreator2.searchMemberBindings(CallinMarkerCreator2.java:612)
at org.objectteams.otdt.internal.ui.callinmarkers.CallinMarkerCreator2.updateMethodMarkers(CallinMarkerCreator2.java:373)
at org.objectteams.otdt.internal.ui.callinmarkers.CallinMarkerCreator2.updateCallinMarkers(CallinMarkerCreator2.java:297)
at org.objectteams.otdt.internal.ui.callinmarkers.CallinMarkerCreator2.access$1(CallinMarkerCreator2.java:267)
at org.objectteams.otdt.internal.ui.callinmarkers.CallinMarkerCreator2$3.updateMarkers(CallinMarkerCreator2.java:252)
at org.objectteams.otdt.internal.ui.callinmarkers.CallinMarkerJob.run(CallinMarkerJob.java:58)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Re: Fragile compilation for circularly referenced classes [message #515998 is a reply to message #515952] Mon, 22 February 2010 12:39 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 1007
Registered: July 2009
Senior Member
Thanks, I filed it as https://bugs.eclipse.org/303474

Eugene, could you please add to the bug, what exactly the effect is:
the stacktrace only shows that creation of callin markers has failed.
Did you also see error markers in the editor, in the problems view?
Could you launch the program?

I'd like to encourage everyone to enter obvious bugs directly to bugzilla
rather than this forum. If uncertain what to select in bugzilla take a look here:
http://www.eclipse.org/objectteams/support.php

thanks,
Stephan
Re: Fragile compilation for circularly referenced classes [message #568970 is a reply to message #515952] Mon, 22 February 2010 12:39 Go to previous message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 1007
Registered: July 2009
Senior Member
Thanks, I filed it as https://bugs.eclipse.org/303474

Eugene, could you please add to the bug, what exactly the effect is:
the stacktrace only shows that creation of callin markers has failed.
Did you also see error markers in the editor, in the problems view?
Could you launch the program?

I'd like to encourage everyone to enter obvious bugs directly to bugzilla
rather than this forum. If uncertain what to select in bugzilla take a look here:
http://www.eclipse.org/objectteams/support.php

thanks,
Stephan
Previous Topic:Fragile compilation for circularly referenced classes
Next Topic:Some questions on design decisions
Goto Forum:
  


Current Time: Fri Sep 19 20:07:15 GMT 2014

Powered by FUDForum. Page generated in 0.01649 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software