Skip to content

Commit

Permalink
Mention source file name for JDT parsing exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
zbynek committed Feb 15, 2025
1 parent d487651 commit 4ca094b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.dev.CompilerContext;
import com.google.gwt.dev.jdt.TypeRefVisitor;
import com.google.gwt.dev.jjs.InternalCompilerException;
import com.google.gwt.dev.jjs.ast.JDeclaredType;
import com.google.gwt.dev.util.arg.SourceLevel;
import com.google.gwt.dev.util.collect.Lists;
Expand Down Expand Up @@ -197,11 +198,17 @@ public ParserImpl(ProblemReporter problemReporter, boolean optimizeStringLiteral
@Override
public CompilationUnitDeclaration parse(ICompilationUnit sourceUnit,
CompilationResult compilationResult) {
// Never dietParse(), otherwise GwtIncompatible annotations in anonymoous inner classes
// Never dietParse(), otherwise GwtIncompatible annotations in anonymous inner classes
// would be ignored.
boolean saveDiet = this.diet;
this.diet = false;
CompilationUnitDeclaration decl = super.parse(sourceUnit, compilationResult);
CompilationUnitDeclaration decl;
try {
decl = super.parse(sourceUnit, compilationResult);
} catch (RuntimeException ex) {
throw new InternalCompilerException("Problem compiling "
+ new String(sourceUnit.getFileName()), ex);
}
this.diet = saveDiet;
// Remove @GwtIncompatible classes and members.
// It is safe to remove @GwtIncompatible types, fields and methods on incomplete ASTs due
Expand Down

0 comments on commit 4ca094b

Please sign in to comment.