Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 17102 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/SaveablesList.java (-7 / +9 lines)
Lines 98-106 Link Here
98
			modelsForSource = new HashSet();
98
			modelsForSource = new HashSet();
99
			modelMap.put(source, modelsForSource);
99
			modelMap.put(source, modelsForSource);
100
		}
100
		}
101
		if (modelsForSource.add(model)) {
101
		modelsForSource.add(model);
102
			result = incrementRefCount(modelRefCounts, model);
102
		result = incrementRefCount(modelRefCounts, model);
103
		}
104
		return result;
103
		return result;
105
	}
104
	}
106
105
Lines 150-161 Link Here
150
			modelsForSource = new HashSet();
149
			modelsForSource = new HashSet();
151
			modelMap.put(source, modelsForSource);
150
			modelMap.put(source, modelsForSource);
152
		}
151
		}
153
		if (modelsForSource.remove(model)) {
152
		result = decrementRefCount(modelRefCounts, model);
154
			result = decrementRefCount(modelRefCounts, model);
153
		if (result) {
155
			if (modelsForSource.isEmpty()) {
154
			if (modelsForSource.remove(model)) {
156
				modelMap.remove(source);
155
				if (modelsForSource.isEmpty()) {
156
					modelMap.remove(source);
157
				}
157
			}
158
			}
158
		}
159
		}
160
159
		return result;
161
		return result;
160
	}
162
	}
161
163
(-)Eclipse UI/org/eclipse/ui/internal/DefaultSaveable.java (-1 / +21 lines)
Lines 14-19 Link Here
14
import org.eclipse.core.runtime.IProgressMonitor;
14
import org.eclipse.core.runtime.IProgressMonitor;
15
import org.eclipse.jface.resource.ImageDescriptor;
15
import org.eclipse.jface.resource.ImageDescriptor;
16
import org.eclipse.swt.graphics.Image;
16
import org.eclipse.swt.graphics.Image;
17
import org.eclipse.ui.IEditorInput;
18
import org.eclipse.ui.IEditorPart;
17
import org.eclipse.ui.ISaveablePart;
19
import org.eclipse.ui.ISaveablePart;
18
import org.eclipse.ui.IWorkbenchPart;
20
import org.eclipse.ui.IWorkbenchPart;
19
import org.eclipse.ui.IWorkbenchPart2;
21
import org.eclipse.ui.IWorkbenchPart2;
Lines 101-106 Link Here
101
	 * @see java.lang.Object#hashCode()
103
	 * @see java.lang.Object#hashCode()
102
	 */
104
	 */
103
	public int hashCode() {
105
	public int hashCode() {
106
		if( part == null )
107
			return 0;
108
		if( part instanceof IEditorPart ) {
109
			IEditorInput input = ((IEditorPart)part).getEditorInput();
110
			if( input == null)
111
				return 0;
112
			return input.hashCode();
113
		}
104
		return part.hashCode();
114
		return part.hashCode();
105
	}
115
	}
106
116
Lines 118-126 Link Here
118
		if (part == null) {
128
		if (part == null) {
119
			if (other.part != null)
129
			if (other.part != null)
120
				return false;
130
				return false;
131
		} else if( part instanceof IEditorPart  ) {
132
			if( other.part != null && other.part instanceof IEditorPart ) {
133
				IEditorInput thisInput = ((IEditorPart)part).getEditorInput();
134
				IEditorInput otherInput = ((IEditorPart)other.part).getEditorInput();
135
				if( thisInput == null ) {
136
					if( otherInput != null )
137
						return false;
138
				} else {
139
					return thisInput.equals(otherInput);
140
				}
141
			}
121
		} else if (!part.equals(other.part))
142
		} else if (!part.equals(other.part))
122
			return false;
143
			return false;
123
		return true;
144
		return true;
124
	}
145
	}
125
126
}
146
}

Return to bug 17102