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 53603 Details for
Bug 17102
[EditorMgmt] User gets prompted to save the same resource twice
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]
Update with additional change to DefaultSaveable
saveableslist-patch2.txt (text/plain), 3.10 KB, created by
Jon Burton
on 2006-11-09 23:38:36 EST
(
hide
)
Description:
Update with additional change to DefaultSaveable
Filename:
MIME Type:
Creator:
Jon Burton
Created:
2006-11-09 23:38:36 EST
Size:
3.10 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/SaveablesList.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SaveablesList.java,v >retrieving revision 1.8.4.2 >diff -u -r1.8.4.2 SaveablesList.java >--- Eclipse UI/org/eclipse/ui/internal/SaveablesList.java 16 Aug 2006 03:53:07 -0000 1.8.4.2 >+++ Eclipse UI/org/eclipse/ui/internal/SaveablesList.java 10 Nov 2006 04:10:31 -0000 >@@ -98,9 +98,8 @@ > modelsForSource = new HashSet(); > modelMap.put(source, modelsForSource); > } >- if (modelsForSource.add(model)) { >- result = incrementRefCount(modelRefCounts, model); >- } >+ modelsForSource.add(model); >+ result = incrementRefCount(modelRefCounts, model); > return result; > } > >@@ -150,12 +149,15 @@ > modelsForSource = new HashSet(); > modelMap.put(source, modelsForSource); > } >- if (modelsForSource.remove(model)) { >- result = decrementRefCount(modelRefCounts, model); >- if (modelsForSource.isEmpty()) { >- modelMap.remove(source); >+ result = decrementRefCount(modelRefCounts, model); >+ if (result) { >+ if (modelsForSource.remove(model)) { >+ if (modelsForSource.isEmpty()) { >+ modelMap.remove(source); >+ } > } > } >+ > return result; > } > >Index: Eclipse UI/org/eclipse/ui/internal/DefaultSaveable.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/DefaultSaveable.java,v >retrieving revision 1.2 >diff -u -r1.2 DefaultSaveable.java >--- Eclipse UI/org/eclipse/ui/internal/DefaultSaveable.java 30 Mar 2006 01:36:58 -0000 1.2 >+++ Eclipse UI/org/eclipse/ui/internal/DefaultSaveable.java 10 Nov 2006 04:10:30 -0000 >@@ -14,6 +14,8 @@ > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.jface.resource.ImageDescriptor; > import org.eclipse.swt.graphics.Image; >+import org.eclipse.ui.IEditorInput; >+import org.eclipse.ui.IEditorPart; > import org.eclipse.ui.ISaveablePart; > import org.eclipse.ui.IWorkbenchPart; > import org.eclipse.ui.IWorkbenchPart2; >@@ -101,6 +103,14 @@ > * @see java.lang.Object#hashCode() > */ > public int hashCode() { >+ if( part == null ) >+ return 0; >+ if( part instanceof IEditorPart ) { >+ IEditorInput input = ((IEditorPart)part).getEditorInput(); >+ if( input == null) >+ return 0; >+ return input.hashCode(); >+ } > return part.hashCode(); > } > >@@ -118,9 +128,19 @@ > if (part == null) { > if (other.part != null) > return false; >+ } else if( part instanceof IEditorPart ) { >+ if( other.part != null && other.part instanceof IEditorPart ) { >+ IEditorInput thisInput = ((IEditorPart)part).getEditorInput(); >+ IEditorInput otherInput = ((IEditorPart)other.part).getEditorInput(); >+ if( thisInput == null ) { >+ if( otherInput != null ) >+ return false; >+ } else { >+ return thisInput.equals(otherInput); >+ } >+ } > } else if (!part.equals(other.part)) > return false; > return true; > } >- > }
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 17102
:
53522
| 53603