Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention source file name for JDT parsing exceptions #10093

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 parsing "
+ 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