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 166557 Details for
Bug 311048
AbortCompilation propagated from CompilationUnitProblemFinder.process()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_311048.txt (text/plain), 6.21 KB, created by
Olivier Thomann
on 2010-04-29 15:25:56 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-04-29 15:25:56 EDT
Size:
6.21 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.java,v >retrieving revision 1.66 >diff -u -r1.66 CompilationUnitProblemFinder.java >--- model/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.java 21 Feb 2010 03:35:51 -0000 1.66 >+++ model/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.java 29 Apr 2010 19:22:36 -0000 >@@ -140,20 +140,24 @@ > }; > } > >+ /* >+ * Can return null if the process was aborted or canceled >+ */ > public static CompilationUnitDeclaration process( >- CompilationUnit unitElement, >- SourceElementParser parser, >- WorkingCopyOwner workingCopyOwner, >- HashMap problems, >- boolean creatingAST, >- int reconcileFlags, >- IProgressMonitor monitor) >+ CompilationUnit unitElement, >+ SourceElementParser parser, >+ WorkingCopyOwner workingCopyOwner, >+ HashMap problems, >+ boolean creatingAST, >+ int reconcileFlags, >+ IProgressMonitor monitor) > throws JavaModelException { > > JavaProject project = (JavaProject) unitElement.getJavaProject(); > CancelableNameEnvironment environment = null; > CancelableProblemFactory problemFactory = null; > CompilationUnitProblemFinder problemFinder = null; >+ CompilationUnitDeclaration unit = null; > try { > environment = new CancelableNameEnvironment(project, workingCopyOwner, monitor); > problemFactory = new CancelableProblemFactory(monitor); >@@ -170,10 +174,9 @@ > if (ignoreMethodBodies) { > analyzeAndGenerateCode = false; > } >- CompilationUnitDeclaration unit = null; >- if (parser != null) { >- problemFinder.parser = parser; >- try { >+ try { >+ if (parser != null) { >+ problemFinder.parser = parser; > unit = parser.parseCompilationUnit(unitElement, true/*full parse*/, monitor); > problemFinder.resolve( > unit, >@@ -181,37 +184,38 @@ > true, // verify methods > analyzeAndGenerateCode, // analyze code > analyzeAndGenerateCode); // generate code >- } catch (AbortCompilation e) { >- problemFinder.handleInternalException(e, unit); >+ } else { >+ unit = >+ problemFinder.resolve( >+ unitElement, >+ true, // verify methods >+ analyzeAndGenerateCode, // analyze code >+ analyzeAndGenerateCode); // generate code > } >- } else { >- unit = >- problemFinder.resolve( >- unitElement, >- true, // verify methods >- analyzeAndGenerateCode, // analyze code >- analyzeAndGenerateCode); // generate code >+ } catch (AbortCompilation e) { >+ problemFinder.handleInternalException(e, unit); > } >- CompilationResult unitResult = unit.compilationResult; >- CategorizedProblem[] unitProblems = unitResult.getProblems(); >- int length = unitProblems == null ? 0 : unitProblems.length; >- if (length > 0) { >- CategorizedProblem[] categorizedProblems = new CategorizedProblem[length]; >- System.arraycopy(unitProblems, 0, categorizedProblems, 0, length); >- problems.put(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, categorizedProblems); >- } >- unitProblems = unitResult.getTasks(); >- length = unitProblems == null ? 0 : unitProblems.length; >- if (length > 0) { >- CategorizedProblem[] categorizedProblems = new CategorizedProblem[length]; >- System.arraycopy(unitProblems, 0, categorizedProblems, 0, length); >- problems.put(IJavaModelMarker.TASK_MARKER, categorizedProblems); >- } >- if (NameLookup.VERBOSE) { >- System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + environment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ >- System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " + environment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ >+ if (unit != null) { >+ CompilationResult unitResult = unit.compilationResult; >+ CategorizedProblem[] unitProblems = unitResult.getProblems(); >+ int length = unitProblems == null ? 0 : unitProblems.length; >+ if (length > 0) { >+ CategorizedProblem[] categorizedProblems = new CategorizedProblem[length]; >+ System.arraycopy(unitProblems, 0, categorizedProblems, 0, length); >+ problems.put(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, categorizedProblems); >+ } >+ unitProblems = unitResult.getTasks(); >+ length = unitProblems == null ? 0 : unitProblems.length; >+ if (length > 0) { >+ CategorizedProblem[] categorizedProblems = new CategorizedProblem[length]; >+ System.arraycopy(unitProblems, 0, categorizedProblems, 0, length); >+ problems.put(IJavaModelMarker.TASK_MARKER, categorizedProblems); >+ } >+ if (NameLookup.VERBOSE) { >+ System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + environment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ >+ System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " + environment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ >+ } > } >- return unit; > } catch (OperationCanceledException e) { > // catch this exception so as to not enter the catch(RuntimeException e) below > throw e; >@@ -236,16 +240,17 @@ > if (problemFinder != null && !creatingAST) > problemFinder.lookupEnvironment.reset(); > } >+ return unit; > } > > public static CompilationUnitDeclaration process( >- CompilationUnit unitElement, >- WorkingCopyOwner workingCopyOwner, >- HashMap problems, >- boolean creatingAST, >- int reconcileFlags, >- IProgressMonitor monitor) >- throws JavaModelException { >+ CompilationUnit unitElement, >+ WorkingCopyOwner workingCopyOwner, >+ HashMap problems, >+ boolean creatingAST, >+ int reconcileFlags, >+ IProgressMonitor monitor) >+ throws JavaModelException { > > return process(unitElement, null/*use default Parser*/, workingCopyOwner, problems, creatingAST, reconcileFlags, monitor); > }
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 311048
:
166555
| 166557