Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 207044 Details for
Bug 363858
[dom] early throwing of AbortCompilation causes NPE in CompilationUnitResolver
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
possible fix
Bug_363858_impl.patch (text/plain), 3.23 KB, created by
Stephan Herrmann
on 2011-11-15 14:10:48 EST
(
hide
)
Description:
possible fix
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2011-11-15 14:10:48 EST
Size:
3.23 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java >index 8b41712..a934b2f 100644 >--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java >+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java >@@ -141,7 +141,10 @@ public class Util { > > public static void appendProblem(StringBuffer problems, IProblem problem, char[] source, int problemCount) { > problems.append(problemCount + (problem.isError() ? ". ERROR" : ". WARNING")); >- problems.append(" in " + new String(problem.getOriginatingFileName())); >+ char[] originatingFileName = problem.getOriginatingFileName(); >+ if (originatingFileName != null) { >+ problems.append(" in " + new String(originatingFileName)); >+ } > if (source != null) { > problems.append(((DefaultProblem)problem).errorReportSource(source)); > } >diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java >index 0fdbd0a..0bd8162 100644 >--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java >+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java >@@ -99,6 +99,7 @@ class CompilationUnitResolver extends Compiler { > DefaultBindingResolver.BindingTables bindingTables; > > boolean hasCompilationAborted; >+ CategorizedProblem abortProblem; > > private IProgressMonitor monitor; > >@@ -364,6 +365,7 @@ class CompilationUnitResolver extends Compiler { > removeUnresolvedBindings(unit); > } > this.hasCompilationAborted = true; >+ this.abortProblem = abortException.problem; > } > > public static void parse(ICompilationUnit[] compilationUnits, ASTRequestor astRequestor, int apiLevel, Map options, int flags, IProgressMonitor monitor) { >@@ -689,11 +691,16 @@ class CompilationUnitResolver extends Compiler { > // the bindings could not be resolved due to missing types in name environment > // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=86541 > CompilationUnitDeclaration unitDeclaration = parse(sourceUnit, nodeSearcher, options, flags); >- final int problemCount = unit.compilationResult.problemCount; >- if (problemCount != 0) { >- unitDeclaration.compilationResult.problems = new CategorizedProblem[problemCount]; >- System.arraycopy(unit.compilationResult.problems, 0, unitDeclaration.compilationResult.problems, 0, problemCount); >- unitDeclaration.compilationResult.problemCount = problemCount; >+ if (unit != null) { >+ final int problemCount = unit.compilationResult.problemCount; >+ if (problemCount != 0) { >+ unitDeclaration.compilationResult.problems = new CategorizedProblem[problemCount]; >+ System.arraycopy(unit.compilationResult.problems, 0, unitDeclaration.compilationResult.problems, 0, problemCount); >+ unitDeclaration.compilationResult.problemCount = problemCount; >+ } >+ } else if (resolver.abortProblem != null) { >+ unitDeclaration.compilationResult.problemCount = 1; >+ unitDeclaration.compilationResult.problems = new CategorizedProblem[] { resolver.abortProblem }; > } > return unitDeclaration; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 363858
:
207043
|
207044
|
207268