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 57912 Details for
Bug 172028
[clean up] Sort members clean up leaks working copies
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed fix
fix_172028.txt (text/plain), 4.55 KB, created by
Benno Baumgartner
on 2007-01-31 09:53:01 EST
(
hide
)
Description:
proposed fix
Filename:
MIME Type:
Creator:
Benno Baumgartner
Created:
2007-01-31 09:53:01 EST
Size:
4.55 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/core/util/CompilationUnitSorter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/CompilationUnitSorter.java,v >retrieving revision 1.36 >diff -u -r1.36 CompilationUnitSorter.java >--- model/org/eclipse/jdt/core/util/CompilationUnitSorter.java 23 Jan 2007 14:58:32 -0000 1.36 >+++ model/org/eclipse/jdt/core/util/CompilationUnitSorter.java 31 Jan 2007 14:52:46 -0000 >@@ -352,10 +352,7 @@ > * <p> > * The <code>compare</code> method of the given comparator is passed pairs > * of body declarations (subclasses of <code>BodyDeclaration</code>) >- * representing body declarations at the same level. The nodes are from an >- * AST of the specified level ({@link org.eclipse.jdt.core.dom.ASTParser#newParser(int)}. >- * Clients will generally use AST.JLS3 since that will cover all >- * constructs found in Java 1.0, 1.1, 1.2, 1.3, 1.4, and 1.5 source code. >+ * representing body declarations at the same level. > * The comparator is called on body declarations of nested classes, > * including anonymous and local classes, but always at the same level. > * Clients need to provide a comparator implementation (there is no standard >@@ -413,10 +410,7 @@ > * <td width="50%"><code>modifiers, name, arguments<br> > * RELATIVE_ORDER property</code></td> > * </tr> >- * </table> Clients should not rely on the AST nodes being properly parented >- * or on having source range information. (Future releases may provide >- * options for requesting additional information like source positions, full >- * ASTs, non-recursive sorting, etc.) >+ * </table> > * </p> > * > * @param unit >@@ -438,14 +432,7 @@ > * if the compilation unit could not be sorted. Reasons > * include: > * <ul> >- * <li> The given compilation unit does not exist >- * (ELEMENT_DOES_NOT_EXIST)</li> >- * <li> The given compilation unit is not a working copy >- * (INVALID_ELEMENT_TYPES)</li> >- * <li> A <code>CoreException</code> occurred while >- * accessing the underlying resource</li> >- * <li>The given compilation unit doesn't come from an ICompilationUnit and this ICompilationUnit is >- * not a working copy (NO_ELEMENTS_TO_PROCESS)</li> >+ * <li> The given unit was not created from a ICompilationUnit (INVALID_ELEMENT_TYPES)</li> > * </ul> > * @exception IllegalArgumentException > * if the given compilation unit is null or if the given >Index: model/org/eclipse/jdt/internal/core/SortElementsOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SortElementsOperation.java,v >retrieving revision 1.37 >diff -u -r1.37 SortElementsOperation.java >--- model/org/eclipse/jdt/internal/core/SortElementsOperation.java 23 Jan 2007 14:58:32 -0000 1.37 >+++ model/org/eclipse/jdt/internal/core/SortElementsOperation.java 31 Jan 2007 14:52:47 -0000 >@@ -120,10 +120,12 @@ > * @return the edit or null if no sorting is required > */ > public TextEdit calculateEdit(org.eclipse.jdt.core.dom.CompilationUnit unit, TextEditGroup group) throws JavaModelException { >- IJavaModelStatus status= this.verify(); >- if (!status.isOK()) { >- throw new JavaModelException(status); >- } >+ if (this.elementsToProcess.length != 1) >+ throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.NO_ELEMENTS_TO_PROCESS)); >+ >+ if (!(this.elementsToProcess[0] instanceof ICompilationUnit)) >+ throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_ELEMENT_TYPES, this.elementsToProcess[0])); >+ > try { > beginTask(Messages.operation_sortelements, getMainAmountOfWork()); > >@@ -333,7 +335,7 @@ > if (this.elementsToProcess[0] == null) { > return new JavaModelStatus(IJavaModelStatusConstants.NO_ELEMENTS_TO_PROCESS); > } >- if (!(this.elementsToProcess[0] instanceof ICompilationUnit) || !((ICompilationUnit) this.elementsToProcess[0]).isWorkingCopy()) { >+ if (!(this.elementsToProcess[0] instanceof ICompilationUnit) || !((ICompilationUnit) this.elementsToProcess[0]).isWorkingCopy()) { > return new JavaModelStatus(IJavaModelStatusConstants.INVALID_ELEMENT_TYPES, this.elementsToProcess[0]); > } > return JavaModelStatus.VERIFIED_OK;
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 172028
: 57912