aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2008-07-17 20:07:59 +0000
committeraclement <aclement>2008-07-17 20:07:59 +0000
commiteeb2e60d0777af6cbcbc92efe467acaa1c12f123 (patch)
tree5dbb40a5f1cceb17afa95681b32b20e1fe6d9148
parent349acc6542f0c2e586ce0e6ac9cfb906844d08d6 (diff)
downloadaspectj-eeb2e60d0777af6cbcbc92efe467acaa1c12f123.tar.gz
aspectj-eeb2e60d0777af6cbcbc92efe467acaa1c12f123.zip
240360 - test and fix for -proceedOnError and weaving in the face of broken source
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java2
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java9
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/ProceedOnErrorTestCase.java10
3 files changed, 9 insertions, 12 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java
index 46f4b25bb..e35ae9bc9 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java
@@ -373,7 +373,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter {
intermediateResultsRequestor.acceptResult(intRes);
}
- if (isXTerminateAfterCompilation || (reportedErrors && !proceedOnError)) {
+ if (unit.compilationResult.hasErrors() || (isXTerminateAfterCompilation || (reportedErrors && !proceedOnError))) {
acceptResult(unit.compilationResult);
} else {
queueForWeaving(intRes);
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
index 368b84ae3..6723462a5 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
@@ -103,9 +103,6 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc
// If runtime version check fails, warn or fail? (unset?)
static final boolean FAIL_IF_RUNTIME_NOT_FOUND = false;
- // support for producing .class files containing errors and maintaining 'state' even when the
- // project is broken (meaning all builds after the first are incremental)
- public static boolean continueWhenErrors = true;
private static final FileFilter binarySourceFilter =
new FileFilter() {
@@ -268,7 +265,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc
binarySourcesForTheNextCompile = state.getBinaryFilesToCompile(true);
performCompilation(buildConfig.getFiles());
state.clearBinarySourceFiles(); // we don't want these hanging around...
- if (!continueWhenErrors && handler.hasErrors()) {
+ if (!proceedOnError() && handler.hasErrors()) {
CompilationAndWeavingContext.leavingPhase(ct);
if (AsmManager.isReporting())
AsmManager.getDefault().reportModelInfo("After a batch build");
@@ -296,7 +293,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc
// System.err.println("XXXX inc: " + files);
performCompilation(files);
- if ((!continueWhenErrors && handler.hasErrors()) || (progressListener!=null && progressListener.isCancelledRequested())) {
+ if ((!proceedOnError() && handler.hasErrors()) || (progressListener!=null && progressListener.isCancelledRequested())) {
CompilationAndWeavingContext.leavingPhase(ct);
return false;
}
@@ -1030,7 +1027,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc
public void acceptResult(CompilationResult unitResult) {
// end of compile, must now write the results to the output destination
// this is either a jar file or a file in a directory
- if (!((unitResult.hasErrors() && !continueWhenErrors) && !proceedOnError())) {
+ if (!unitResult.hasErrors() || proceedOnError()) {
Collection classFiles = unitResult.compiledTypes.values();
boolean shouldAddAspectName = (buildConfig.getOutxmlName() != null);
for (Iterator iter = classFiles.iterator(); iter.hasNext();) {
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/ProceedOnErrorTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/ProceedOnErrorTestCase.java
index 4caa987bd..5e353cc3c 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/ProceedOnErrorTestCase.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/ProceedOnErrorTestCase.java
@@ -31,8 +31,8 @@ public class ProceedOnErrorTestCase extends CommandTestCase {
* C2.java.
*/
public void testNoProceedOnError() throws IOException {
- try {
- AjBuildManager.continueWhenErrors=false;
+// try {
+// AjBuildManager.continueWhenErrors=false;
checkCompile("src1/C1.java", NO_ERRORS);
File f =new File(getSandboxName(),"C.class");
long oldmodtime = f.lastModified();
@@ -44,9 +44,9 @@ public class ProceedOnErrorTestCase extends CommandTestCase {
assertTrue("The .class file should not have been modified as '-proceedOnError' was not supplied (old="+
new Date(oldmodtime).toString()+")(new="+new Date(newmodtime).toString()+")",
oldmodtime==newmodtime);
- } finally {
- AjBuildManager.continueWhenErrors=true;
- }
+// } finally {
+// AjBuildManager.continueWhenErrors=true;
+// }
}
public void testProceedOnError() throws IOException {