Summary: | ajc changes classfile timestamps even if compilation fails (regression) | ||
---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Per S Hustad <per.hustad> |
Component: | Compiler | Assignee: | Adrian Colyer <adrian.colyer> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 1.2 | ||
Target Milestone: | 1.2.1 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Per S Hustad
2004-10-04 10:12:39 EDT
I do not see this problem using ajc (rather than the Ant task). The behaviour would now seem to be consistent with javac i.e. we compile what we can. The timestamps remain unchanged for the classes that fail to be compiled. It is not peculiar to "-sourceroots" e.g. "ajc observer/*.java" has the same effect. When the syntax error in Demo.java is corrected everything is rebuilt. It seems the problem may lie in the adapter. I still cannot see that ajc is consistent with javac. E.g. create a standard java class, e.g. class Test {} and store it in "Test.java". Then compile with javac: $ javac Test.java $ ls --full-time Test.class -rwxrwxrwx 1 t539956 mkpasswd 182 Fri Oct 08 13:25:29 2004 Test.class* Then insert some syntax errors in Test.java and recompile with javac $ javac Test.java Test.java:2: <identifier> expected DONT_COMPILE; ^ Test.java:2: cannot resolve symbol symbol : class DONT_COMPILE location: class Test DONT_COMPILE; ^ 2 errors $ ls --full-time Test.class -rwxrwxrwx 1 t539956 mkpasswd 182 Fri Oct 08 13:25:29 2004 Test.class* I.e. javac has not changed the Test.class timestamp Now compile with ajc: $ ajc Test.java C:\aspectj1.2\doc\examples\Test.java:2 [error] Syntax error on token "DONT_COMPILE", VariableDeclarator expected after this token DONT_COMPILE; ^^^^^^^^^ 1 error $ ls --full-time Test.class -rwxrwxrwx 1 t539956 mkpasswd 410 Fri Oct 08 13:28:40 2004 Test.class* Summary: ajc has changed the Test.class timestamp while javac has not. I believe this is due to the lack of support for '-proceedOnError' which is claimed to be a supported flag. It seems to be defaulting to *ON* which means we write out files even if things go wrong. I am just adding support for it now so it will default to OFF unless you specify -proceedOnError. Two bugs: 1) -proceedOnError is defaulting to ON regardless of what you pass in. 2) -proceedOnError is ignored when deciding whether to do weaving. We should go into weaving even if there were compile errors *if* proceedOnError was set (see bug 74245). I have modified the options processing to take account of -proceedOnError - the value is stored in the buildconfig object. I have also changed the decision about whether to weave to check the proceedOnError setting. Fix checked in, waiting for build. Fix available. BUILD COMPLETE - build.383 Date of build: 10/18/2004 23:39:49 Time to build: 113 minutes 41 seconds Last changed: 10/18/2004 13:04:09 Latest good AspectJ jar available at: download.eclipse.org/technology/ajdt/dev/aspectj-DEVELOPMENT.jar Fix released as part of AspectJ 1.2.1 |