diff options
author | aclement <aclement> | 2006-02-16 16:50:34 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-02-16 16:50:34 +0000 |
commit | e87458179ab929aae2bc6966a6e092813bdd14a3 (patch) | |
tree | 5cfbcdad74346a29b3d65791c5dabc2563cbfe70 /tests/bugs151 | |
parent | d4219e12eaa86ed810392364931a92324dc2a67f (diff) | |
download | aspectj-e87458179ab929aae2bc6966a6e092813bdd14a3.tar.gz aspectj-e87458179ab929aae2bc6966a6e092813bdd14a3.zip |
test and fix for 122370 (Andy & Helen) - code generated for @Decp busted.
Diffstat (limited to 'tests/bugs151')
4 files changed, 49 insertions, 0 deletions
diff --git a/tests/bugs151/pr122370/moody/AnnotationMoodImplementor.java b/tests/bugs151/pr122370/moody/AnnotationMoodImplementor.java new file mode 100644 index 000000000..008119bb6 --- /dev/null +++ b/tests/bugs151/pr122370/moody/AnnotationMoodImplementor.java @@ -0,0 +1,5 @@ +package moody; + +public class AnnotationMoodImplementor { + +} diff --git a/tests/bugs151/pr122370/moody/AnnotationMoodIndicator.java b/tests/bugs151/pr122370/moody/AnnotationMoodIndicator.java new file mode 100644 index 000000000..be8cab5f6 --- /dev/null +++ b/tests/bugs151/pr122370/moody/AnnotationMoodIndicator.java @@ -0,0 +1,22 @@ +package moody; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.DeclareParents; + +@Aspect +public class AnnotationMoodIndicator { + public interface Moody { + Mood getMood(); + void setMood(Mood mood); + } + + public static class MoodyImpl implements Moody { + private Mood mood = Mood.HAPPY; + + public Mood getMood() { return mood; } + public void setMood(Mood mood) { this.mood = mood; } + } + + +@DeclareParents(value="moody.AnnotationMoodImplementor",defaultImpl=MoodyImpl.class) + private Moody implementedInterface; +} diff --git a/tests/bugs151/pr122370/moody/MainClass.java b/tests/bugs151/pr122370/moody/MainClass.java new file mode 100644 index 000000000..82e4a9534 --- /dev/null +++ b/tests/bugs151/pr122370/moody/MainClass.java @@ -0,0 +1,17 @@ +package moody; + +public class MainClass { + + public static void main(String[] args) { + AnnotationMoodImplementor ami0 = new AnnotationMoodImplementor(); + AnnotationMoodImplementor ami1 = new AnnotationMoodImplementor(); + + System.out.println("ami0's mood is " + ((AnnotationMoodIndicator.Moody) ami0).getMood()); + ((AnnotationMoodIndicator.Moody) ami1).setMood(Mood.JOLLY); + System.out.println("ami1's mood is now " + ((AnnotationMoodIndicator.Moody) ami1).getMood()); + System.out.println("ami0's mood is still " + ((AnnotationMoodIndicator.Moody) ami0).getMood()); + } + + + +} diff --git a/tests/bugs151/pr122370/moody/Mood.java b/tests/bugs151/pr122370/moody/Mood.java new file mode 100644 index 000000000..50d0e84f0 --- /dev/null +++ b/tests/bugs151/pr122370/moody/Mood.java @@ -0,0 +1,5 @@ +package moody; + +public enum Mood { + HAPPY, JOLLY +} |