]> source.dussan.org Git - aspectj.git/commitdiff
more tests for 119570
authoraclement <aclement>
Mon, 12 Dec 2005 11:52:18 +0000 (11:52 +0000)
committeraclement <aclement>
Mon, 12 Dec 2005 11:52:18 +0000 (11:52 +0000)
tests/multiIncremental/PR119570/base/bugs/ParameterizedDP.java [new file with mode: 0644]
tests/multiIncremental/PR119570/base/bugsOtherPackage/INode.java [new file with mode: 0644]
tests/multiIncremental/PR119570/base/bugsOtherPackage/NodeImpl.java [new file with mode: 0644]
tests/multiIncremental/PR119570_2/base/bugs/ParameterizedDP.java [new file with mode: 0644]
tests/multiIncremental/PR119570_2/base/bugsOtherPackage/INode.java [new file with mode: 0644]
tests/multiIncremental/PR119570_2/base/bugsOtherPackage/NodeImpl.java [new file with mode: 0644]

diff --git a/tests/multiIncremental/PR119570/base/bugs/ParameterizedDP.java b/tests/multiIncremental/PR119570/base/bugs/ParameterizedDP.java
new file mode 100644 (file)
index 0000000..e35fbd2
--- /dev/null
@@ -0,0 +1,27 @@
+package bugs;
+
+import bugsOtherPackage.INode;
+import bugsOtherPackage.NodeImpl;
+
+public class ParameterizedDP {
+
+    public static void main(String[] args) {
+        // 1) compile-time error here without 
+        //    {unneeded} subaspect declare-parent
+        // Tag as INode<Tag, Tag> from PC extends NodeImpl<Tag, Tag>
+        ((TaggedTexts.Tag) null).getParent();       
+    }
+
+}
+class TaggedTexts {
+
+    public static class Text {  }
+
+    public static class Tag {  }
+    static aspect PC extends NodeImpl<Tag, Tag> {
+        // unneeded declare-parents duplicates one in NodeImpl
+        // when here, get spurious error message
+        // when commented out, d-p fails and get compiler error at 1) above
+        declare parents : Tag implements INode<Tag,Tag>;
+    }
+}
\ No newline at end of file
diff --git a/tests/multiIncremental/PR119570/base/bugsOtherPackage/INode.java b/tests/multiIncremental/PR119570/base/bugsOtherPackage/INode.java
new file mode 100644 (file)
index 0000000..2c94ebf
--- /dev/null
@@ -0,0 +1,6 @@
+package bugsOtherPackage;
+
+public interface INode<Parent, Child> {
+    boolean setParent(INode<Parent, Child> p);
+    INode<Parent, Child> getParent();
+}
\ No newline at end of file
diff --git a/tests/multiIncremental/PR119570/base/bugsOtherPackage/NodeImpl.java b/tests/multiIncremental/PR119570/base/bugsOtherPackage/NodeImpl.java
new file mode 100644 (file)
index 0000000..95911d3
--- /dev/null
@@ -0,0 +1,21 @@
+package bugsOtherPackage;
+
+import java.util.ArrayList;
+
+public abstract aspect NodeImpl<Parent, Child> {
+
+    declare parents : Child implements INode<Parent, Child>;
+    declare parents : Parent implements INode<Parent, Child>;
+
+    private final ArrayList<INode> INode.fChildren = new ArrayList<INode>();
+
+    // are you not supposed to use type parameters here?
+    private INode<Parent, Child> INode.fParent;
+    public final INode<Parent, Child> INode.getParent() {
+        return fParent;
+    }
+    public final boolean INode.setParent(INode<Parent, Child> newParent) {
+        fParent = newParent;
+        return true; 
+    }
+}
\ No newline at end of file
diff --git a/tests/multiIncremental/PR119570_2/base/bugs/ParameterizedDP.java b/tests/multiIncremental/PR119570_2/base/bugs/ParameterizedDP.java
new file mode 100644 (file)
index 0000000..4988859
--- /dev/null
@@ -0,0 +1,27 @@
+package bugs;
+
+import bugsOtherPackage.INode;
+import bugsOtherPackage.NodeImpl;
+
+public class ParameterizedDP {
+
+    public static void main(String[] args) {
+        // 1) compile-time error here without 
+        //    {unneeded} subaspect declare-parent
+        // Tag as INode<Tag, Tag> from PC extends NodeImpl<Tag, Tag>
+        ((TaggedTexts.Tag) null).getParent();       
+    }
+
+}
+class TaggedTexts {
+
+    public static class Text {  }
+
+    public static class Tag {  }
+    static aspect PC extends NodeImpl<Tag, Tag> {
+        // unneeded declare-parents duplicates one in NodeImpl
+        // when here, get spurious error message
+        // when commented out, d-p fails and get compiler error at 1) above
+       // declare parents : Tag implements INode<Tag,Tag>;
+    }
+}
diff --git a/tests/multiIncremental/PR119570_2/base/bugsOtherPackage/INode.java b/tests/multiIncremental/PR119570_2/base/bugsOtherPackage/INode.java
new file mode 100644 (file)
index 0000000..2c94ebf
--- /dev/null
@@ -0,0 +1,6 @@
+package bugsOtherPackage;
+
+public interface INode<Parent, Child> {
+    boolean setParent(INode<Parent, Child> p);
+    INode<Parent, Child> getParent();
+}
\ No newline at end of file
diff --git a/tests/multiIncremental/PR119570_2/base/bugsOtherPackage/NodeImpl.java b/tests/multiIncremental/PR119570_2/base/bugsOtherPackage/NodeImpl.java
new file mode 100644 (file)
index 0000000..95911d3
--- /dev/null
@@ -0,0 +1,21 @@
+package bugsOtherPackage;
+
+import java.util.ArrayList;
+
+public abstract aspect NodeImpl<Parent, Child> {
+
+    declare parents : Child implements INode<Parent, Child>;
+    declare parents : Parent implements INode<Parent, Child>;
+
+    private final ArrayList<INode> INode.fChildren = new ArrayList<INode>();
+
+    // are you not supposed to use type parameters here?
+    private INode<Parent, Child> INode.fParent;
+    public final INode<Parent, Child> INode.getParent() {
+        return fParent;
+    }
+    public final boolean INode.setParent(INode<Parent, Child> newParent) {
+        fParent = newParent;
+        return true; 
+    }
+}
\ No newline at end of file