From c533722181596ca6ed43fbc87c28936961c46570 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 30 Apr 2009 19:51:46 +0000 Subject: [PATCH] 274558: use .class names in handles for binaries entries (faulted in aspects) --- .../bug274558base/base/src/p/HasITDs1.java | 7 ++++ .../bug274558base/base/src/q/UsesITDs1.java | 15 +++++++ .../base/src/r/DeclaresITD.aj | 9 +++++ .../base/src/r/HasITDs2.java | 5 +++ .../base/src/r/InterfaceForITD.java | 5 +++ .../systemtest/ajc164/Ajc164Tests.java | 12 ++++-- .../tools/MultiProjectIncrementalTests.java | 40 +++++++++++++++---- 7 files changed, 83 insertions(+), 10 deletions(-) create mode 100644 tests/multiIncremental/bug274558base/base/src/p/HasITDs1.java create mode 100644 tests/multiIncremental/bug274558base/base/src/q/UsesITDs1.java create mode 100644 tests/multiIncremental/bug274558depending/base/src/r/DeclaresITD.aj create mode 100644 tests/multiIncremental/bug274558depending/base/src/r/HasITDs2.java create mode 100644 tests/multiIncremental/bug274558depending/base/src/r/InterfaceForITD.java diff --git a/tests/multiIncremental/bug274558base/base/src/p/HasITDs1.java b/tests/multiIncremental/bug274558base/base/src/p/HasITDs1.java new file mode 100644 index 000000000..0567357cc --- /dev/null +++ b/tests/multiIncremental/bug274558base/base/src/p/HasITDs1.java @@ -0,0 +1,7 @@ +package p; + +import r.InterfaceForITD; + +public class HasITDs1 implements InterfaceForITD { + +} diff --git a/tests/multiIncremental/bug274558base/base/src/q/UsesITDs1.java b/tests/multiIncremental/bug274558base/base/src/q/UsesITDs1.java new file mode 100644 index 000000000..6eb6f0b4a --- /dev/null +++ b/tests/multiIncremental/bug274558base/base/src/q/UsesITDs1.java @@ -0,0 +1,15 @@ +package q; + +import p.HasITDs1; +import r.HasITDs2; + +public class UsesITDs1 { + + void nothing() { + new HasITDs1().x++; + new HasITDs2().x++; + new HasITDs1().nothing(1, 1, 1); + new HasITDs2().nothing(1, 1, 1); + } + +} \ No newline at end of file diff --git a/tests/multiIncremental/bug274558depending/base/src/r/DeclaresITD.aj b/tests/multiIncremental/bug274558depending/base/src/r/DeclaresITD.aj new file mode 100644 index 000000000..b31740ed5 --- /dev/null +++ b/tests/multiIncremental/bug274558depending/base/src/r/DeclaresITD.aj @@ -0,0 +1,9 @@ +package r; + +public aspect DeclaresITD { + public int InterfaceForITD.x = 9; + + public void InterfaceForITD.nothing(int x, int y, int z) { + + } +} \ No newline at end of file diff --git a/tests/multiIncremental/bug274558depending/base/src/r/HasITDs2.java b/tests/multiIncremental/bug274558depending/base/src/r/HasITDs2.java new file mode 100644 index 000000000..1333038c4 --- /dev/null +++ b/tests/multiIncremental/bug274558depending/base/src/r/HasITDs2.java @@ -0,0 +1,5 @@ +package r; + +public class HasITDs2 implements InterfaceForITD { + +} diff --git a/tests/multiIncremental/bug274558depending/base/src/r/InterfaceForITD.java b/tests/multiIncremental/bug274558depending/base/src/r/InterfaceForITD.java new file mode 100644 index 000000000..3a549f7dc --- /dev/null +++ b/tests/multiIncremental/bug274558depending/base/src/r/InterfaceForITD.java @@ -0,0 +1,5 @@ +package r; + +public interface InterfaceForITD { + +} diff --git a/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java b/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java index bc78b7108..518b72182 100644 --- a/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java @@ -71,6 +71,9 @@ public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase { * was available as source. There are two compile steps in the xml for the test - commenting out the first will allow the source * handles to be seen, leaving it in will switch to binary. Effectively the only difference should be that in the binary case * the handles are prefixed 'binaries'. + * + * Change due to bug 274558: now AJDT wants (blah.class as the 'source file' for the ITD so that is another difference when + * switching. */ public void testItdsAspectPathModel_pr265729_1() { runTest("aspectpath model"); @@ -88,7 +91,8 @@ public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase { IRelationship ir = (IRelationship) model.getRelationshipMap().get(ipe).get(0); String itdMethodHandle = (String) ir.getTargets().get(0); // handle when all source: <{Aspect.java}Aspect)Orange.getColor - assertEquals("/binaries<{Aspect.java}Aspect)Orange.getColor", itdMethodHandle); + // assertEquals("/binaries<{Aspect.java}Aspect)Orange.getColor", itdMethodHandle); + assertEquals("/binaries<(Aspect.class}Aspect)Orange.getColor", itdMethodHandle); IProgramElement itdpe = model.getHierarchy().findElementForHandle(itdMethodHandle); assertEquals("java.awt.Color", itdpe.getCorrespondingType(true)); @@ -101,7 +105,8 @@ public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase { ir = (IRelationship) model.getRelationshipMap().get(ipe).get(0); String itdFieldHandle = (String) ir.getTargets().get(0); // source handle <{Aspect.java}Aspect)Strawberry.color - assertEquals("/binaries<{Aspect.java}Aspect)Strawberry.color", itdFieldHandle); + // assertEquals("/binaries<{Aspect.java}Aspect)Strawberry.color", itdFieldHandle); + assertEquals("/binaries<(Aspect.class}Aspect)Strawberry.color", itdFieldHandle); IProgramElement itdfpe = model.getHierarchy().findElementForHandle(itdMethodHandle); assertEquals("java.awt.Color", itdfpe.getCorrespondingType(true)); @@ -113,7 +118,8 @@ public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase { ir = (IRelationship) model.getRelationshipMap().get(ipe).get(0); String itdCtorHandle = (String) ir.getTargets().get(0); // source handle <{Aspect.java}Aspect)Fruit.Fruit_new)QColor;)QString; - assertEquals("/binaries<{Aspect.java}Aspect)Fruit.Fruit_new)QColor;)QString;", itdCtorHandle); + // assertEquals("/binaries<{Aspect.java}Aspect)Fruit.Fruit_new)QColor;)QString;", itdCtorHandle); + assertEquals("/binaries<(Aspect.class}Aspect)Fruit.Fruit_new)QColor;)QString;", itdCtorHandle); IProgramElement itdcpe = model.getHierarchy().findElementForHandle(itdCtorHandle); List ptypes = itdcpe.getParameterTypes(); assertEquals("java.awt.Color", new String((char[]) ptypes.get(0))); diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index 9df461b07..ab18d15fc 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -214,9 +214,9 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa } // ITD from the test program: // public String InterTypeAspectInterface.foo(int i,List list,App a) { - assertEquals("=pr265729_client/binaries