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

(-)src/org/aspectj/systemtest/incremental/IncrementalTests.java (+13 lines)
Lines 280-284 Link Here
280
	  RunResult before = run("pack.Main");
280
	  RunResult before = run("pack.Main");
281
  }
281
  }
282
  
282
  
283
  public void testIncrementalUpdateOfBodyInAroundAdvice_pr154054() throws Exception {
284
	  runTest("incremental update of body in around advice");
285
	  nextIncrement(true);
286
	  RunResult before = run("MyClass");
287
	  assertTrue("value should be 13 but was " + before.getStdOut(),
288
			  before.getStdOut().startsWith("13"));
289
	  // update value added to proceed
290
	  copyFileAndDoIncrementalBuild("changes/MyAspect.20.aj","src/MyAspect.aj");
291
	  RunResult after = run("MyClass");
292
	  assertTrue("value should be 14 but was " + after.getStdOut(),
293
			  after.getStdOut().startsWith("14"));
294
  }
295
  
283
}
296
}
284
297
(-)src/org/aspectj/systemtest/incremental/incremental-junit-tests.xml (+9 lines)
Lines 388-391 Link Here
388
        <!--inc-compile tag="20"/-->
388
        <!--inc-compile tag="20"/-->
389
        <!--run class="pack.Main"/-->
389
        <!--run class="pack.Main"/-->
390
    </ajc-test>
390
    </ajc-test>
391
392
   <ajc-test dir="bugs153/pr154054" pr="154054"
393
   	 title="incremental update of body in around advice">
394
        <compile staging="true" 
395
        	options="-incremental,-verbose"
396
        	sourceroots="src"/>
397
        <!--inc-compile tag="20"/-->
398
        <!--run class="MyClass"/-->
399
    </ajc-test>
391
	
400
	
(-)bugs153/pr154054/src/MyClass.java (+19 lines)
Added Link Here
1
public class MyClass {
2
3
	int x;
4
5
	public int getX() {
6
		return x;
7
	}
8
9
	public void setX(int x) {
10
		this.x = x;
11
	}
12
13
	public static void main(String[] args) {
14
		MyClass m = new MyClass();
15
		m.setX(10);
16
		System.out.println(m.getX());
17
	}
18
19
}
(-)bugs153/pr154054/src/MyAspect.aj (+10 lines)
Added Link Here
1
public aspect MyAspect {
2
3
	pointcut mypointcut(): execution(* getX()) && !within(MyAspect);
4
5
	int around(): mypointcut() {
6
		int w = proceed() + 3;
7
		return w;	
8
	}
9
10
}
(-)bugs153/pr154054/changes/MyAspect.20.aj (+10 lines)
Added Link Here
1
public aspect MyAspect {
2
3
	pointcut mypointcut(): execution(* getX()) && !within(MyAspect);
4
5
	int around(): mypointcut() {
6
		int w = proceed() + 4;
7
		return w;	
8
	}
9
10
}

Return to bug 154054