From c31c8198b4a33f5319bffac5fa5121caec341aff Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 12 Dec 2005 11:52:18 +0000 Subject: [PATCH] more tests for 119570 --- .../PR119570/base/bugs/ParameterizedDP.java | 27 +++++++++++++++++++ .../PR119570/base/bugsOtherPackage/INode.java | 6 +++++ .../base/bugsOtherPackage/NodeImpl.java | 21 +++++++++++++++ .../PR119570_2/base/bugs/ParameterizedDP.java | 27 +++++++++++++++++++ .../base/bugsOtherPackage/INode.java | 6 +++++ .../base/bugsOtherPackage/NodeImpl.java | 21 +++++++++++++++ 6 files changed, 108 insertions(+) create mode 100644 tests/multiIncremental/PR119570/base/bugs/ParameterizedDP.java create mode 100644 tests/multiIncremental/PR119570/base/bugsOtherPackage/INode.java create mode 100644 tests/multiIncremental/PR119570/base/bugsOtherPackage/NodeImpl.java create mode 100644 tests/multiIncremental/PR119570_2/base/bugs/ParameterizedDP.java create mode 100644 tests/multiIncremental/PR119570_2/base/bugsOtherPackage/INode.java create mode 100644 tests/multiIncremental/PR119570_2/base/bugsOtherPackage/NodeImpl.java diff --git a/tests/multiIncremental/PR119570/base/bugs/ParameterizedDP.java b/tests/multiIncremental/PR119570/base/bugs/ParameterizedDP.java new file mode 100644 index 000000000..e35fbd207 --- /dev/null +++ b/tests/multiIncremental/PR119570/base/bugs/ParameterizedDP.java @@ -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 from PC extends NodeImpl + ((TaggedTexts.Tag) null).getParent(); + } + +} +class TaggedTexts { + + public static class Text { } + + public static class Tag { } + static aspect PC extends NodeImpl { + // 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; + } +} \ 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 index 000000000..2c94ebf60 --- /dev/null +++ b/tests/multiIncremental/PR119570/base/bugsOtherPackage/INode.java @@ -0,0 +1,6 @@ +package bugsOtherPackage; + +public interface INode { + boolean setParent(INode p); + INode 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 index 000000000..95911d31f --- /dev/null +++ b/tests/multiIncremental/PR119570/base/bugsOtherPackage/NodeImpl.java @@ -0,0 +1,21 @@ +package bugsOtherPackage; + +import java.util.ArrayList; + +public abstract aspect NodeImpl { + + declare parents : Child implements INode; + declare parents : Parent implements INode; + + private final ArrayList INode.fChildren = new ArrayList(); + + // are you not supposed to use type parameters here? + private INode INode.fParent; + public final INode INode.getParent() { + return fParent; + } + public final boolean INode.setParent(INode 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 index 000000000..498885991 --- /dev/null +++ b/tests/multiIncremental/PR119570_2/base/bugs/ParameterizedDP.java @@ -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 from PC extends NodeImpl + ((TaggedTexts.Tag) null).getParent(); + } + +} +class TaggedTexts { + + public static class Text { } + + public static class Tag { } + static aspect PC extends NodeImpl { + // 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; + } +} diff --git a/tests/multiIncremental/PR119570_2/base/bugsOtherPackage/INode.java b/tests/multiIncremental/PR119570_2/base/bugsOtherPackage/INode.java new file mode 100644 index 000000000..2c94ebf60 --- /dev/null +++ b/tests/multiIncremental/PR119570_2/base/bugsOtherPackage/INode.java @@ -0,0 +1,6 @@ +package bugsOtherPackage; + +public interface INode { + boolean setParent(INode p); + INode 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 index 000000000..95911d31f --- /dev/null +++ b/tests/multiIncremental/PR119570_2/base/bugsOtherPackage/NodeImpl.java @@ -0,0 +1,21 @@ +package bugsOtherPackage; + +import java.util.ArrayList; + +public abstract aspect NodeImpl { + + declare parents : Child implements INode; + declare parents : Parent implements INode; + + private final ArrayList INode.fChildren = new ArrayList(); + + // are you not supposed to use type parameters here? + private INode INode.fParent; + public final INode INode.getParent() { + return fParent; + } + public final boolean INode.setParent(INode newParent) { + fParent = newParent; + return true; + } +} \ No newline at end of file -- 2.39.5