From 4ca094b980799969f9842e47e792f267170f15a2 Mon Sep 17 00:00:00 2001 From: Zbynek Konecny Date: Sat, 15 Feb 2025 22:51:16 +0100 Subject: [PATCH] Mention source file name for JDT parsing exceptions --- .../src/com/google/gwt/dev/javac/JdtCompiler.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java b/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java index c63a0132b7..55a151dd82 100644 --- a/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java +++ b/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java @@ -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; @@ -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