]> source.dussan.org Git - aspectj.git/commitdiff
290227: fix and test
authoraclement <aclement>
Wed, 23 Sep 2009 16:03:49 +0000 (16:03 +0000)
committeraclement <aclement>
Wed, 23 Sep 2009 16:03:49 +0000 (16:03 +0000)
tests/bugs166/pr290227/AbstractTimingAnnotatedAspect.java [new file with mode: 0644]
tests/bugs166/pr290227/TimingAnnotatedAspect.java [new file with mode: 0644]
tests/bugs166/pr290227/javacCode.jar [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc166/Ajc166Tests.java
tests/src/org/aspectj/systemtest/ajc166/ajc166.xml

diff --git a/tests/bugs166/pr290227/AbstractTimingAnnotatedAspect.java b/tests/bugs166/pr290227/AbstractTimingAnnotatedAspect.java
new file mode 100644 (file)
index 0000000..512f48b
--- /dev/null
@@ -0,0 +1,39 @@
+package aspects;
+
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+
+@ Aspect
+public abstract class AbstractTimingAnnotatedAspect {
+
+       @Pointcut("within(*..AbstractJPivotPortlet+) " +
+                       "&& (execution(* do*(..))" +
+                       "|| execution(* processAction*(..))" +
+                       "|| execution(* serveResource*(..)) )")
+       protected final void portletEntryMethods() {}
+
+       @Pointcut("execution(* eu.ibacz.pbns..*.*(..)) || execution(* com.tonbeller..*.*(..))")
+       protected final void tracedMethods() {}
+
+       @Pointcut("within(aspects.*) || within(aspects..*)")
+       protected final void thisAspectClasses() {}
+
+       @Pointcut("cflow(execution(* TimingAnnotatedAspect.processInvocationFinished(..)))")
+       protected final void thisAspectExecution() {}
+
+       @Pointcut
+       protected abstract void scope();
+
+       @Before("scope() && portletEntryMethods() && !thisAspectClasses() && !thisAspectExecution()")
+       public void logStackTrace(final JoinPoint thisJoinPoint) throws Throwable {
+               System.out.println("logStackTrace: Logging the current stack trace prior to " +
+                               "the execution of " +
+                               thisJoinPoint.getSignature().toShortString()
+                               + new Exception("Current stack trace print out."));
+       } /* logStackTrace */
+
+}
diff --git a/tests/bugs166/pr290227/TimingAnnotatedAspect.java b/tests/bugs166/pr290227/TimingAnnotatedAspect.java
new file mode 100644 (file)
index 0000000..4dc2b3b
--- /dev/null
@@ -0,0 +1,13 @@
+package aspects;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+
+@ Aspect
+public class TimingAnnotatedAspect extends AbstractTimingAnnotatedAspect {
+
+       @Pointcut("")
+       protected void scope() {}
+
+
+}
diff --git a/tests/bugs166/pr290227/javacCode.jar b/tests/bugs166/pr290227/javacCode.jar
new file mode 100644 (file)
index 0000000..86b96bf
Binary files /dev/null and b/tests/bugs166/pr290227/javacCode.jar differ
index d9027479889162d1cfcd9670a1e6f5c9ab4be781..714e81facba7f8067de4a7bb70e5a19e2e1d3568 100644 (file)
@@ -18,6 +18,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc166Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
+       public void testNpeForJavacBuilt_290227() {
+               runTest("npe for javac built");
+       }
+
        public void testBinaryDecpSuperRewrite_290087() {
                runTest("binary decp super rewrite");
        }
index a1885afcc2f234f0230bf876df6925c248131d83..991cfdb68f72d20630a3062c9b462e720e5ea036 100644 (file)
@@ -2,6 +2,10 @@
 
 <suite>
 
+  <ajc-test dir="bugs166/pr290227" title="npe for javac built">
+    <compile files="" inpath="javacCode.jar" options="-1.5 -Xlint:ignore"/>
+  </ajc-test>
+  
   <ajc-test dir="bugs166/pr288049" title="itd decanno">
      <compile files="org/othtests/MyClass.java org/othtests/MySubClass.java org/othtests/AddSomeAnnotation.java" options="-1.5 -showWeaveInfo">
      <message kind="weave" text="'public java.lang.String org.othtests.MySubClass.doOne()' (MySubClass.java:5) is annotated with"/>