Index: src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java =================================================================== RCS file: /home/technology/org.aspectj/modules/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java,v retrieving revision 1.39 diff -u -r1.39 MultiProjectIncrementalTests.java --- src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java 8 Mar 2006 13:53:04 -0000 1.39 +++ src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java 10 Mar 2006 13:22:53 -0000 @@ -619,6 +619,7 @@ } } + // test for comment #31 - NPE public void testPr129163() { configureBuildStructureModel(true); initialiseProject("PR129613"); @@ -634,6 +635,58 @@ configureBuildStructureModel(false); } + // test for comment #0 - adding a comment to a class file shouldn't + // cause us to go back to source and recompile everything. To force this + // to behave like AJDT we need to include the aspect in 'inc1' so that + // when AjState looks at its timestamp it thinks the aspect has been modified. + // The logic within CrosscuttingMembers should then work out correctly + // that there haven't really been any changes within the aspect and so + // we shouldn't go back to source. + public void testPr129163_2() { + // want to behave like AJDT + configureBuildStructureModel(true); + initialiseProject("pr129163_2"); + build("pr129163_2"); + checkWasFullBuild(); + alter("pr129163_2","inc1"); + build("pr129163_2"); + checkWasntFullBuild(); // shouldn't be a full build because the + // aspect hasn't changed + configureBuildStructureModel(false); + } + + // test for comment #6 - simulates AJDT core builder test testBug99133a - + // changing the contents of a method within a class shouldn't force a + // full build of a dependant project. To force this to behave like AJDT + // 'inc1' of the dependant project should just be a copy of 'base' so that + // AjState thinks somethings changed within the dependant project and + // we do a build. Similarly, 'inc1' of the project depended on should + // include the aspect even though nothing's changed within it. This causes + // AjState to think that the aspect has changed. Together its then up to + // logic within CrosscuttingMembers and various equals methods to decide + // correctly that we don't have to go back to source. + public void testPr129163_3() { + configureBuildStructureModel(true); + initialiseProject("PR129163_4"); + build("PR129163_4"); + checkWasFullBuild(); // should be a full build because initializing project + initialiseProject("PR129163_3"); + configureNewProjectDependency("PR129163_3","PR129163_4"); + build("PR129163_3"); + checkWasFullBuild(); // should be a full build because initializing project + alter("PR129163_4","inc1"); + build("PR129163_4"); + checkWasntFullBuild(); // should be an incremental build because although + // "inc1" includes the aspect A1.aj, it actually hasn't + // changed so we shouldn't go back to source + alter("PR129163_3","inc1"); + build("PR129163_3"); + checkWasntFullBuild(); // should be an incremental build because nothing has + // changed within the class and no aspects have changed + // within the running of the test + configureBuildStructureModel(false); + } + // other possible tests: // - memory usage (freemem calls?) // - relationship map Index: multiIncremental/PR129163_2/base/tjp/Demo.java =================================================================== RCS file: multiIncremental/PR129163_2/base/tjp/Demo.java diff -N multiIncremental/PR129163_2/base/tjp/Demo.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multiIncremental/PR129163_2/base/tjp/Demo.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,37 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +*/ +package tjp; + +public class Demo { + static Demo d; + + public static void main(String[] args){ + new Demo().go(); + } + + void go(){ + d = new Demo(); + d.foo(1,d); + System.out.println(d.bar(new Integer(3))); + } + + void foo(int i, Object o){ + System.out.println("Demo.foo(" + i + ", " + o + ")\n"); + } + + String bar (Integer j){ + System.out.println("Demo.bar(" + j + ")\n"); + return "Demo.bar(" + j + ")"; + } +} Index: multiIncremental/PR129163_2/base/tjp/GetInfo.aj =================================================================== RCS file: multiIncremental/PR129163_2/base/tjp/GetInfo.aj diff -N multiIncremental/PR129163_2/base/tjp/GetInfo.aj --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multiIncremental/PR129163_2/base/tjp/GetInfo.aj 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,49 @@ +/* +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. +*/ + +package tjp; + +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.reflect.CodeSignature; + +aspect GetInfo { + + static final void println(String s){ System.out.println(s); } + + pointcut goCut(): cflow(this(Demo) && execution(void go())); + + pointcut demoExecs(): within(Demo) && execution(* *(..)); + + Object around(): demoExecs() && !execution(* go()) && goCut() { + println("Intercepted message: " + + thisJoinPointStaticPart.getSignature().getName()); + println("in class: " + + thisJoinPointStaticPart.getSignature().getDeclaringType().getName()); + printParameters(thisJoinPoint); + println("Running original method: \n" ); + Object result = proceed(); + println(" result: " + result ); + return result; + } + + static private void printParameters(JoinPoint jp) { + println("Arguments: " ); + Object[] args = jp.getArgs(); + String[] names = ((CodeSignature)jp.getSignature()).getParameterNames(); + Class[] types = ((CodeSignature)jp.getSignature()).getParameterTypes(); + for (int i = 0; i < args.length; i++) { + println(" " + i + ". " + names[i] + + " : " + types[i].getName() + + " = " + args[i]); + } + } +} Index: multiIncremental/PR129163_2/inc1/tjp/Demo.java =================================================================== RCS file: multiIncremental/PR129163_2/inc1/tjp/Demo.java diff -N multiIncremental/PR129163_2/inc1/tjp/Demo.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multiIncremental/PR129163_2/inc1/tjp/Demo.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,37 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +*/ +package tjp; + +public class Demo { + static Demo d; + /* blah blah blah */ + public static void main(String[] args){ + new Demo().go(); + } + + void go(){ + d = new Demo(); + d.foo(1,d); + System.out.println(d.bar(new Integer(3))); + } + + void foo(int i, Object o){ + System.out.println("Demo.foo(" + i + ", " + o + ")\n"); + } + + String bar (Integer j){ + System.out.println("Demo.bar(" + j + ")\n"); + return "Demo.bar(" + j + ")"; + } +} Index: multiIncremental/PR129163_2/inc1/tjp/GetInfo.aj =================================================================== RCS file: multiIncremental/PR129163_2/inc1/tjp/GetInfo.aj diff -N multiIncremental/PR129163_2/inc1/tjp/GetInfo.aj --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multiIncremental/PR129163_2/inc1/tjp/GetInfo.aj 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,49 @@ +/* +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. +*/ + +package tjp; + +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.reflect.CodeSignature; + +aspect GetInfo { + + static final void println(String s){ System.out.println(s); } + + pointcut goCut(): cflow(this(Demo) && execution(void go())); + + pointcut demoExecs(): within(Demo) && execution(* *(..)); + + Object around(): demoExecs() && !execution(* go()) && goCut() { + println("Intercepted message: " + + thisJoinPointStaticPart.getSignature().getName()); + println("in class: " + + thisJoinPointStaticPart.getSignature().getDeclaringType().getName()); + printParameters(thisJoinPoint); + println("Running original method: \n" ); + Object result = proceed(); + println(" result: " + result ); + return result; + } + + static private void printParameters(JoinPoint jp) { + println("Arguments: " ); + Object[] args = jp.getArgs(); + String[] names = ((CodeSignature)jp.getSignature()).getParameterNames(); + Class[] types = ((CodeSignature)jp.getSignature()).getParameterTypes(); + for (int i = 0; i < args.length; i++) { + println(" " + i + ". " + names[i] + + " : " + types[i].getName() + + " = " + args[i]); + } + } +} Index: multiIncremental/PR129163_3/base/pack/C.java =================================================================== RCS file: multiIncremental/PR129163_3/base/pack/C.java diff -N multiIncremental/PR129163_3/base/pack/C.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multiIncremental/PR129163_3/base/pack/C.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,7 @@ +package pack; +import p.C1; +public class C { + public void m() { + new C1().m1(); + } +} Index: multiIncremental/PR129163_3/inc1/pack/C.java =================================================================== RCS file: multiIncremental/PR129163_3/inc1/pack/C.java diff -N multiIncremental/PR129163_3/inc1/pack/C.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multiIncremental/PR129163_3/inc1/pack/C.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,7 @@ +package pack; +import p.C1; +public class C { + public void m() { + new C1().m1(); + } +} Index: multiIncremental/PR129163_4/base/p/A1.aj =================================================================== RCS file: multiIncremental/PR129163_4/base/p/A1.aj diff -N multiIncremental/PR129163_4/base/p/A1.aj --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multiIncremental/PR129163_4/base/p/A1.aj 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,6 @@ +package p; + +public aspect A1 { + + +} Index: multiIncremental/PR129163_4/base/p/C1.java =================================================================== RCS file: multiIncremental/PR129163_4/base/p/C1.java diff -N multiIncremental/PR129163_4/base/p/C1.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multiIncremental/PR129163_4/base/p/C1.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,11 @@ +package p; + +public class C1 { + public void m1() { + + } + + public void m2() { + + } +} Index: multiIncremental/PR129163_4/inc1/p/A1.aj =================================================================== RCS file: multiIncremental/PR129163_4/inc1/p/A1.aj diff -N multiIncremental/PR129163_4/inc1/p/A1.aj --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multiIncremental/PR129163_4/inc1/p/A1.aj 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,6 @@ +package p; + +public aspect A1 { + + +} Index: multiIncremental/PR129163_4/inc1/p/C1.java =================================================================== RCS file: multiIncremental/PR129163_4/inc1/p/C1.java diff -N multiIncremental/PR129163_4/inc1/p/C1.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ multiIncremental/PR129163_4/inc1/p/C1.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,11 @@ +package p; + +public class C1 { + public void m1() { + System.out.println("Hello"); + } + + public void m2() { + + } +}