From 08234af1749cc56c8c6b4b8f5cebff333609d21a Mon Sep 17 00:00:00 2001 From: aclement Date: Sun, 1 Jun 2008 20:47:17 +0000 Subject: 234934: bug fix - npe --- .../optimizedAnnotationBinding/CaseThirteen.java | 35 ++++++++++++++++++++++ .../ajc161/OptimizedAnnotationFieldBinding.java | 3 ++ .../systemtest/ajc161/annotationFieldBinding.xml | 10 +++++++ 3 files changed, 48 insertions(+) create mode 100644 tests/features161/optimizedAnnotationBinding/CaseThirteen.java diff --git a/tests/features161/optimizedAnnotationBinding/CaseThirteen.java b/tests/features161/optimizedAnnotationBinding/CaseThirteen.java new file mode 100644 index 000000000..e540a12c9 --- /dev/null +++ b/tests/features161/optimizedAnnotationBinding/CaseThirteen.java @@ -0,0 +1,35 @@ +import java.lang.annotation.*; + +public class CaseThirteen { + + public static void main(String []argv) { + + CaseThirteen o = new CaseThirteen(); + o.a(); + o.b(); + o.c(); + o.d(); + o.e(); + } + + public void a() {} + @Anno(value=Level.NONE,c=Color.RED) public void b() {} + @Anno(value=Level.ONE) public void c() {} + @Anno(value=Level.TWO,c=Color.GREEN) public void d() {} + @Anno(value=Level.THREE,c=Color.BLUE) public void e() {} + +} + +enum Level { NONE, ONE, TWO, THREE; } +enum Color { RED, GREEN, BLUE; } + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno { Level value(); Color c() default Color.GREEN; } + +aspect X { + + before(String l): execution(@Anno !@Anno(Level.NONE) * *(..)) && @annotation(Anno(l)) && @annotation(Anno(c)) { + System.out.println(l+""+c); + } +} + diff --git a/tests/src/org/aspectj/systemtest/ajc161/OptimizedAnnotationFieldBinding.java b/tests/src/org/aspectj/systemtest/ajc161/OptimizedAnnotationFieldBinding.java index 72cba14e2..6f8ec319f 100644 --- a/tests/src/org/aspectj/systemtest/ajc161/OptimizedAnnotationFieldBinding.java +++ b/tests/src/org/aspectj/systemtest/ajc161/OptimizedAnnotationFieldBinding.java @@ -57,6 +57,9 @@ public class OptimizedAnnotationFieldBinding extends XMLBasedAjcTestCase { public void testCaseTwelve_BindingAnnoAndAnnoValue() { runTest("case twelve - binding anno and anno value"); } + public void testCaseThirteen_bugNPE() { + runTest("case thirteen - bug npe"); + } ///////////////////////////////////////// public static Test suite() { diff --git a/tests/src/org/aspectj/systemtest/ajc161/annotationFieldBinding.xml b/tests/src/org/aspectj/systemtest/ajc161/annotationFieldBinding.xml index 1d6e1d354..f84e08f08 100644 --- a/tests/src/org/aspectj/systemtest/ajc161/annotationFieldBinding.xml +++ b/tests/src/org/aspectj/systemtest/ajc161/annotationFieldBinding.xml @@ -115,4 +115,14 @@ + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3