Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2010-04-01 22:47:20 -0400
committerStephan Herrmann2010-04-01 22:47:20 -0400
commit4c9f36912429106d7bf783d5f401d5ce781010ac (patch)
tree12b3373b0fbfbf33f4d7e53499563cf3d591978a /testplugins/org.eclipse.objectteams.otdt.ui.tests
parent85f9d643f72edf0677ee037de326b0f3b8d40b1e (diff)
downloadorg.eclipse.objectteams-4c9f36912429106d7bf783d5f401d5ce781010ac.tar.gz
org.eclipse.objectteams-4c9f36912429106d7bf783d5f401d5ce781010ac.tar.xz
org.eclipse.objectteams-4c9f36912429106d7bf783d5f401d5ce781010ac.zip
Test for https://bugs.eclipse.org/303474 [compiler] Fragile compilation for circularly referenced classes
Diffstat (limited to 'testplugins/org.eclipse.objectteams.otdt.ui.tests')
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/callinmarker/CallinMarkerTests.java17
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/workspace/CallinMarker/src/cycle2/A.java15
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/workspace/CallinMarker/src/cycle2/B.java10
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests/workspace/CallinMarker/src/cycle2/TheTest.java15
4 files changed, 57 insertions, 0 deletions
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/callinmarker/CallinMarkerTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/callinmarker/CallinMarkerTests.java
index 90c9b7206..8fa197253 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/callinmarker/CallinMarkerTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/callinmarker/CallinMarkerTests.java
@@ -323,6 +323,23 @@ public class CallinMarkerTests extends FileBasedUITest
assertMarkers(expectedMarkers, markers);
}
+ /** Cycle a la https://bugs.eclipse.org/303474 and callin-to-callin */
+ public void testMarkers_4() throws JavaModelException, PartInitException
+ {
+ _baseType = getJavaType(getTestProjectDir(), SRC_FOLDER, "cycle2", "B");
+ _baseResource = _baseType.getResource();
+
+ assertNotNull(_baseResource);
+
+ synchronousCreateMarkers(_baseResource);
+
+ Set<String> expectedMarkers = new HashSet<String>();
+ expectedMarkers.add("=CallinMarker/src<cycle{B.java[B$R[A$Q~run");
+
+ IMarker[] markers = getCallinMarkers(_baseResource);
+ assertMarkers(expectedMarkers, markers);
+ }
+
// see http://trac.objectteams.org/ot/ticket/188
public void testMarkers_NonJavaPrj1() throws CoreException, IOException, InterruptedException
{
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/workspace/CallinMarker/src/cycle2/A.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/workspace/CallinMarker/src/cycle2/A.java
new file mode 100644
index 000000000..8066b2621
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/workspace/CallinMarker/src/cycle2/A.java
@@ -0,0 +1,15 @@
+package compileorder;
+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("callin: Q.run()");
+ }
+ }
+} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/workspace/CallinMarker/src/cycle2/B.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/workspace/CallinMarker/src/cycle2/B.java
new file mode 100644
index 000000000..fda644129
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/workspace/CallinMarker/src/cycle2/B.java
@@ -0,0 +1,10 @@
+package compileorder;
+public team class B {
+ public class R playedBy A {
+ void run() <- replace void run();
+ callin void run() {
+ base.run();
+ System.out.println("R.run()");
+ }
+ }
+} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/workspace/CallinMarker/src/cycle2/TheTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/workspace/CallinMarker/src/cycle2/TheTest.java
new file mode 100644
index 000000000..2ded14072
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/workspace/CallinMarker/src/cycle2/TheTest.java
@@ -0,0 +1,15 @@
+package compileorder;
+public class TheTest {
+ final B b = new B();
+ final A a = new A<@b>();
+
+ public void run() {
+ within(b) {
+ a.run();
+ }
+ }
+ public static void main(String[] args) {
+ TheTest theTest = new TheTest();
+ theTest.run();
+ }
+ } \ No newline at end of file

Back to the top