aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2005-11-23 12:36:28 +0000
committeraclement <aclement>2005-11-23 12:36:28 +0000
commit504e4300204475cef1254de5d1308863c43b26e7 (patch)
tree5fe583e1f09db52266c33417419572f95df4789b /tests
parente05df7e5ac7fb91031d8f98d4b93e361918e4b56 (diff)
downloadaspectj-504e4300204475cef1254de5d1308863c43b26e7.tar.gz
aspectj-504e4300204475cef1254de5d1308863c43b26e7.zip
87525 - new error message (and testcase). Thats all I'm doing on this for 1.5.0
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs150/pr87525/A.java5
-rw-r--r--tests/bugs150/pr87525/B.java9
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java1
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml6
4 files changed, 21 insertions, 0 deletions
diff --git a/tests/bugs150/pr87525/A.java b/tests/bugs150/pr87525/A.java
new file mode 100644
index 000000000..edb3b6924
--- /dev/null
+++ b/tests/bugs150/pr87525/A.java
@@ -0,0 +1,5 @@
+class A {
+
+ private final static int c = 1;
+
+}
diff --git a/tests/bugs150/pr87525/B.java b/tests/bugs150/pr87525/B.java
new file mode 100644
index 000000000..5fbf93a4c
--- /dev/null
+++ b/tests/bugs150/pr87525/B.java
@@ -0,0 +1,9 @@
+privileged aspect B {
+
+ before(A anA):execution(* a()) && this(anA){
+ switch(1){
+ case anA.c: // "case expressions must be constant expressions"
+ }
+ }
+
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index 683ee9e99..f6d67c689 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -49,6 +49,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testGenericITDsAndAbstractMethodError_pr102357() { runTest("generic itds and abstract method error");}
*/
+ public void testPrivilegeProblem_pr87525() { runTest("privilege problem with switch");}
public void testGenericAspects_pr115237() { runTest("aspectOf and generic aspects");}
public void testClassFormatError_pr114436() { runTest("ClassFormatError binary weaving perthis");}
public void testParserException_pr115788() { runTest("parser exception");}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index 39b35bb77..c517c8fc0 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -62,6 +62,12 @@
<compile files="Pr113368.aj"/>
<run class="Pr113368"/>
</ajc-test>
+
+ <ajc-test dir="bugs150/pr87525" pr="87525" title="privilege problem with switch">
+ <compile files="A.java,B.java">
+ <message kind="error" line="5" text="Fields accessible due to an aspect being privileged can not be used in switch statements"/>
+ </compile>
+ </ajc-test>
<ajc-test dir="java5/reflection" title="pointcut parsing with ajc compiled pointcut references">
<compile files="PointcutLibrary.aj,ReflectOnAjcCompiledPointcuts.java" options="-1.5"></compile>