### Eclipse Workspace Patch 1.0 #P tests Index: src/org/aspectj/systemtest/ajc152/Ajc152Tests.java =================================================================== RCS file: /home/technology/org.aspectj/modules/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java,v retrieving revision 1.12 diff -u -r1.12 Ajc152Tests.java --- src/org/aspectj/systemtest/ajc152/Ajc152Tests.java 26 Apr 2006 16:45:17 -0000 1.12 +++ src/org/aspectj/systemtest/ajc152/Ajc152Tests.java 27 Apr 2006 02:46:24 -0000 @@ -39,6 +39,8 @@ // public void testDoubleAnnotationMatching_pr138223() { runTest("Double at annotation matching (no binding)");} public void testNoClassCastExceptionWithPerThis_pr138286() { runTest("No ClassCastException with perThis");} + + public void testAtWithinCodeBug_pr138798() { runTest("atWithinCodeBug"); } // this next one reported as a bug by Rob Harrop, but I can't reproduce the failure yet... //public void testAtAspectWithReferencePCPerClause_pr138220() { runTest("@Aspect with reference pointcut in perclause");} Index: src/org/aspectj/systemtest/ajc152/ajc152.xml =================================================================== RCS file: /home/technology/org.aspectj/modules/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml,v retrieving revision 1.10 diff -u -r1.10 ajc152.xml --- src/org/aspectj/systemtest/ajc152/ajc152.xml 26 Apr 2006 16:45:17 -0000 1.10 +++ src/org/aspectj/systemtest/ajc152/ajc152.xml 27 Apr 2006 02:46:24 -0000 @@ -183,4 +183,12 @@ + + + + + + + + \ No newline at end of file Index: bugs152/pr138798/ErrorHandling.aj =================================================================== RCS file: bugs152/pr138798/ErrorHandling.aj diff -N bugs152/pr138798/ErrorHandling.aj --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ bugs152/pr138798/ErrorHandling.aj 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,41 @@ +import org.aspectj.lang.JoinPoint.StaticPart; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +//@Retention(RetentionPolicy.RUNTIME) +@interface NormalException { + /** The default of Void means ANY throwable */ + Class[] value() default Void.class; +} + +public aspect ErrorHandling { + + before(Throwable throwable) : handler(*) && args(throwable) && !@withincode(NormalException) { + System.err.println("Caught in "+thisEnclosingJoinPointStaticPart.getSignature().getName()); + } + + public static void main(String argz[]) { + new Test().checkConnection(); + } +} + +class Test { + @NormalException(Exception.class) + protected void checkConnection() { + try { + foo(); + } catch (Exception e) { + ;//skip warning + } + } + + private void foo() { + try { + throw new RuntimeException(); + } catch (RuntimeException e) { + throw e; + } + } + +}