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 5811 Details for
Bug 41691
Move static members fails if "//" is before member [refactoring]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix.
41691_2_org.eclipse.jdt.ui_patch.txt (text/plain), 3.41 KB, created by
Markus Keller
on 2003-08-21 05:34:22 EDT
(
hide
)
Description:
Fix.
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2003-08-21 05:34:22 EDT
Size:
3.41 KB
patch
obsolete
>Index: core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveStaticMembersRefactoring.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveStaticMembersRefactoring.java,v >retrieving revision 1.13 >diff -u -r1.13 MoveStaticMembersRefactoring.java >--- core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveStaticMembersRefactoring.java 19 Aug 2003 16:52:42 -0000 1.13 >+++ core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveStaticMembersRefactoring.java 21 Aug 2003 09:27:06 -0000 >@@ -63,6 +63,7 @@ > import org.eclipse.jdt.internal.corext.textmanipulation.MultiTextEdit; > import org.eclipse.jdt.internal.corext.textmanipulation.TextBuffer; > import org.eclipse.jdt.internal.corext.textmanipulation.TextBufferEditor; >+import org.eclipse.jdt.internal.corext.textmanipulation.TextRange; > import org.eclipse.jdt.internal.corext.util.JavaModelUtil; > import org.eclipse.jdt.internal.corext.util.JdtFlags; > import org.eclipse.jdt.internal.corext.util.Strings; >@@ -654,6 +655,7 @@ > typeRefs.addAll(TypeReferenceFinder.perform(declaration)); > MovedMemberAnalyzer analyzer= new MovedMemberAnalyzer(fSource, fSourceBinding, fMemberBindings, target); > declaration.accept(analyzer); >+ fSource.rewriter.markAsTracked(declaration, new GroupDescription("moved member declaration")); > targetNeedsSourceImport &= analyzer.targetNeedsSourceImport(); > status.merge(analyzer.getStatus()); > } >@@ -664,30 +666,29 @@ > ITypeBinding binding= (ITypeBinding)iter.next(); > fTarget.imports.addImport(binding); > } >- >- String[] result= new String[fMembers.length]; >+ // extract updated members >+ String[] updatedMemberSources= new String[fMembers.length]; > TextBuffer buffer= TextBuffer.create(fSource.unit.getSource()); > TextBufferEditor editor= new TextBufferEditor(buffer); > MultiTextEdit edit= new MultiTextEdit(); > fSource.rewriter.rewriteNode(buffer, edit); > editor.add(edit); > editor.performEdits(new NullProgressMonitor()); >- ICompilationUnit wc= (ICompilationUnit)JavaModelUtil.toOriginal(fSource.unit).getWorkingCopy(); >- try { >- wc.getBuffer().setContents(buffer.getContent()); >- wc.reconcile(); >- for (int i= 0; i < fMembers.length; i++) { >- IMember member= JavaModelUtil.findMemberInCompilationUnit(wc, fMembers[i]); >- result[i]= Strings.trimIndentation(member.getSource(), fPreferences.tabWidth, false); >- } >- >- } finally { >- wc.destroy(); >+ for (int i= 0; i < members.length; i++) { >+ updatedMemberSources[i]= getUpdatedMember(buffer, members[i]); > } >+ > fSource.removeModifications(); >- return result; >+ return updatedMemberSources; > } > >+ private String getUpdatedMember(TextBuffer buffer, BodyDeclaration declaration) { >+ GroupDescription groupDescription= fSource.rewriter.getTrackedNodeData(declaration); >+ TextRange textRange= groupDescription.getTextRange(); >+ String newSource= buffer.getContent(textRange.getOffset(), textRange.getLength()); >+ return Strings.trimIndentation(newSource, fPreferences.tabWidth, false); >+ } >+ > private RefactoringStatus moveMembers(BodyDeclaration[] members, String[] sources) throws CoreException { > RefactoringStatus result= new RefactoringStatus(); > TypeDeclaration destination= getDestinationDeclaration();
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 41691
:
5798
| 5811 |
5812