diff options
author | wisberg <wisberg> | 2004-04-05 09:24:57 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2004-04-05 09:24:57 +0000 |
commit | 8bf5e26fddd79c3625b929104e398990bc2d4886 (patch) | |
tree | 265cdd54dab3a4cf331d20568a8f03c28acdeb9f /tests | |
parent | b2befd4b1fcc89ae80553f3aabcb55ca89e50902 (diff) | |
download | aspectj-8bf5e26fddd79c3625b929104e398990bc2d4886.tar.gz aspectj-8bf5e26fddd79c3625b929104e398990bc2d4886.zip |
@testcase PR#57432 NPE's when writing some declare error
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ajcTestsFailing.xml | 27 | ||||
-rw-r--r-- | tests/bugs/systemouts/A.java | 7 | ||||
-rw-r--r-- | tests/bugs/systemouts/injar.jar | bin | 0 -> 653 bytes | |||
-rw-r--r-- | tests/bugs/systemouts/src/build.xml | 22 | ||||
-rw-r--r-- | tests/bugs/systemouts/src/pack/X.java | 43 |
5 files changed, 99 insertions, 0 deletions
diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml index c2fb46b05..ca3981932 100644 --- a/tests/ajcTestsFailing.xml +++ b/tests/ajcTestsFailing.xml @@ -133,4 +133,31 @@ <run class="InterfaceInitializerOrder"/> </ajc-test> + <ajc-test dir="bugs/systemouts" + pr="57432" + title="declare error binary-weaving NPE"> + <compile files="injar.jar,A.java"> + <message kind="error" line="12" file="X.java"/> + <message kind="error" line="13" file="X.java"/> + <message kind="error" line="20" file="X.java"/> + <message kind="error" line="22" file="X.java"/> + <message kind="error" line="23" file="X.java"/> + <message kind="error" line="27" file="X.java"/> + <message kind="error" line="28" file="X.java"/> + <message kind="error" line="29" file="X.java"/> + <message kind="error" line="30" file="X.java"/> + <message kind="error" line="31" file="X.java"/> + <message kind="error" line="32" file="X.java"/> + <message kind="error" line="33" file="X.java"/> + <message kind="error" line="34" file="X.java"/> + <message kind="error" line="35" file="X.java"/> + <message kind="error" line="36" file="X.java"/> + <message kind="error" line="37" file="X.java"/> + <message kind="error" line="38" file="X.java"/> + <message kind="error" line="39" file="X.java"/> + <message kind="error" line="40" file="X.java"/> + <message kind="error" line="41" file="X.java"/> + </compile> + </ajc-test> + </suite> diff --git a/tests/bugs/systemouts/A.java b/tests/bugs/systemouts/A.java new file mode 100644 index 000000000..6e475b725 --- /dev/null +++ b/tests/bugs/systemouts/A.java @@ -0,0 +1,7 @@ + +/** @testcase PR#57432 NPE's when writing some declare error */ +aspect A { + declare error : get(java.io.PrintStream System.out) + || call(void Throwable.printStackTrace(..)) + : "NPE"; +} diff --git a/tests/bugs/systemouts/injar.jar b/tests/bugs/systemouts/injar.jar Binary files differnew file mode 100644 index 000000000..bc76a0af2 --- /dev/null +++ b/tests/bugs/systemouts/injar.jar diff --git a/tests/bugs/systemouts/src/build.xml b/tests/bugs/systemouts/src/build.xml new file mode 100644 index 000000000..065fcf4e2 --- /dev/null +++ b/tests/bugs/systemouts/src/build.xml @@ -0,0 +1,22 @@ +<project name="extdirs-setup" basedir="." default="injar.jar"> + + <target name="injar.jar"> + <property + name="classes.dir" + location="${basedir}/../classes"/> + + <mkdir dir="${classes.dir}"/> + <delete dir="${classes.dir}"/> + <mkdir dir="${classes.dir}"/> + <javac + destdir="${classes.dir}" + includes="pack/X.java" + srcdir="${basedir}"/> + <zip + destfile="${basedir}/../injar.jar"> + <fileset dir="${classes.dir}"/> + </zip> + <delete dir="${classes.dir}"/> + </target> + +</project>
\ No newline at end of file diff --git a/tests/bugs/systemouts/src/pack/X.java b/tests/bugs/systemouts/src/pack/X.java new file mode 100644 index 000000000..29803554c --- /dev/null +++ b/tests/bugs/systemouts/src/pack/X.java @@ -0,0 +1,43 @@ + +package pack; + +public final class X { + + public static void ut(boolean b, String m) { + if (!b) { + try { + if (b) + return; + } catch (RuntimeException e) { + System.out.println(""); + e.printStackTrace(System.out); + } + } + } + + + public static void printArgs(String programName, String[] args) { + System.out.print(programName); + for (int i=0; i<args.length; i++){ + System.out.print(" "); + System.out.print(args[i]); + } + } + static void t() { + System.out.print("s"); + System.out.flush(); + System.out.print('.'); + System.out.flush(); + System.out.print('.'); + System.out.flush(); + System.out.print('.'); + System.out.flush(); + System.out.print('.'); + System.out.flush(); + System.out.print('.'); + System.out.flush(); + System.out.print('.'); + System.out.flush(); + System.out.println(""); + } +} |