View | Details | Raw Unified | Return to bug 138798
Collapse All | Expand All

(-)src/org/aspectj/systemtest/ajc152/Ajc152Tests.java (+2 lines)
Lines 39-44 Link Here
39
//  public void testDoubleAnnotationMatching_pr138223() { runTest("Double at annotation matching (no binding)");}
39
//  public void testDoubleAnnotationMatching_pr138223() { runTest("Double at annotation matching (no binding)");}
40
  
40
  
41
  public void testNoClassCastExceptionWithPerThis_pr138286() { runTest("No ClassCastException with perThis");}
41
  public void testNoClassCastExceptionWithPerThis_pr138286() { runTest("No ClassCastException with perThis");}
42
43
  public void testAtWithinCodeBug_pr138798() { runTest("atWithinCodeBug"); }
42
  
44
  
43
// this next one reported as a bug by Rob Harrop, but I can't reproduce the failure yet...
45
// this next one reported as a bug by Rob Harrop, but I can't reproduce the failure yet...
44
//public void testAtAspectWithReferencePCPerClause_pr138220() { runTest("@Aspect with reference pointcut in perclause");}  
46
//public void testAtAspectWithReferencePCPerClause_pr138220() { runTest("@Aspect with reference pointcut in perclause");}  
(-)src/org/aspectj/systemtest/ajc152/ajc152.xml (+8 lines)
Lines 183-186 Link Here
183
      </run>
183
      </run>
184
    </ajc-test>
184
    </ajc-test>
185
185
186
    <ajc-test dir="bugs152/pr138798" title="atWithinCodeBug">
187
      <compile files="ErrorHandling.aj" options="-1.5"/>
188
      <run class="ErrorHandling">
189
         <stderr>
190
           <line text="Caught in foo"/>
191
         </stderr>
192
      </run>      
193
    </ajc-test>
186
</suite>
194
</suite>
(-)bugs152/pr138798/ErrorHandling.aj (+41 lines)
Added Link Here
1
import org.aspectj.lang.JoinPoint.StaticPart;
2
3
import java.lang.annotation.Retention;
4
import java.lang.annotation.RetentionPolicy;
5
6
//@Retention(RetentionPolicy.RUNTIME)
7
@interface NormalException {
8
    /** The default of Void means ANY throwable */
9
    Class[] value() default Void.class; 
10
}
11
12
public aspect ErrorHandling {
13
14
    before(Throwable throwable) : handler(*) && args(throwable) && !@withincode(NormalException) {
15
    	System.err.println("Caught in "+thisEnclosingJoinPointStaticPart.getSignature().getName());
16
    }    
17
18
    public static void main(String argz[]) {
19
    	new Test().checkConnection();
20
    }
21
}
22
23
class Test {
24
    @NormalException(Exception.class)
25
    protected void checkConnection() {
26
        try {
27
            foo();
28
        } catch (Exception e) {
29
        	;//skip warning
30
        }
31
    }
32
    
33
    private void foo() {
34
    	try {
35
    		throw new RuntimeException();
36
    	} catch (RuntimeException e) {
37
    		throw e;
38
    	}
39
    }
40
41
}

Return to bug 138798