aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/IfPCDExprAssignUnparseFailure.java
blob: 48e2da1fd64161b703081bd05a8b9f0114b5cf93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import org.aspectj.testing.Tester;

/**
 * @author wes
 */
public class IfPCDExprAssignUnparseFailure {
    public static void main(String[] args) {
        Tester.check(true, "compiler test");
    }
}

/**
 * NPE unwinding assignment in if pcd expression:
 * <pre>
 * unexpected exception: 
 *    org.aspectj.compiler.base.InternalCompilerError
 * java.lang.NullPointerException
 *  at org.aspectj.compiler.base.ast.AssignExpr.unparse(AssignExpr.java:78)
 * <pre>
 * in revision 1.26 of AssignExpr.java.
 */
aspect AspectFor {
	static int i;
	pointcut namedIf () 
		: if(0 == (i = 2)) ; // NPE unwinding assignment in if

}