Index: org/codehaus/janino/UnitCompiler.java =================================================================== RCS file: /home/projects/janino/scm/janino/src/org/codehaus/janino/UnitCompiler.java,v retrieving revision 1.32 diff -u -r1.32 UnitCompiler.java --- org/codehaus/janino/UnitCompiler.java 24 Apr 2006 20:23:58 -0000 1.32 +++ org/codehaus/janino/UnitCompiler.java 10 May 2006 02:20:38 -0000 @@ -1468,6 +1468,10 @@ if (this.getReturnType(fd) != IClass.VOID) this.compileError("Method must return a value", fd.getLocation()); this.writeOpcode(fd, Opcode.RETURN); } + + if (compileErrors) { + return; + } } finally { this.replaceCodeContext(savedCodeContext); } @@ -6995,6 +6999,7 @@ * @param optionalLocation The location to report */ private void compileError(String message, Location optionalLocation) throws CompileException { + compileErrors = true; if (this.optionalCompileErrorHandler != null) { this.optionalCompileErrorHandler.handleError(message, optionalLocation); } else { @@ -7290,6 +7295,7 @@ // Used for elaborate compile error handling. private ErrorHandler optionalCompileErrorHandler = null; + private boolean compileErrors = false; // Used for elaborate warning handling. private WarningHandler optionalWarningHandler = null;