View | Details | Raw Unified | Return to bug 226264 | Differences between
and this patch

Collapse All | Expand All

(-)resources\Resource.java.orig (-9 / +35 lines)
Lines 686-695 Link Here
686
				workspace.prepareOperation(rule, monitor);
686
				workspace.prepareOperation(rule, monitor);
687
				// if there is no resource then there is nothing to delete so just return
687
				// if there is no resource then there is nothing to delete so just return
688
				if (!exists())
688
				if (!exists())
689
					return;
689
					return;
690
				workspace.beginOperation(true);
690
				workspace.beginOperation(true);
691
		        broadcastPreProjectDelete();
691
				final IFileStore originalStore = getStore();
692
				final IFileStore originalStore = getStore();
692
				boolean wasLinked = isLinked();
693
				boolean wasLinked = isLinked();
693
				message = Messages.resources_deleteProblem;
694
				message = Messages.resources_deleteProblem;
694
				MultiStatus status = new MultiStatus(ResourcesPlugin.PI_RESOURCES, IResourceStatus.FAILED_DELETE_LOCAL, message, null);
695
				MultiStatus status = new MultiStatus(ResourcesPlugin.PI_RESOURCES, IResourceStatus.FAILED_DELETE_LOCAL, message, null);
695
				WorkManager workManager = workspace.getWorkManager();
696
				WorkManager workManager = workspace.getWorkManager();
Lines 1344-1353 Link Here
1344
				workspace.prepareOperation(rule, monitor);
1345
				workspace.prepareOperation(rule, monitor);
1345
				// The following assert method throws CoreExceptions as stated in the IResource.move API
1346
				// The following assert method throws CoreExceptions as stated in the IResource.move API
1346
				// and assert for programming errors. See checkMoveRequirements for more information.
1347
				// and assert for programming errors. See checkMoveRequirements for more information.
1347
				assertMoveRequirements(destination, getType(), updateFlags);
1348
				assertMoveRequirements(destination, getType(), updateFlags);
1348
				workspace.beginOperation(true);
1349
				workspace.beginOperation(true);
1350
		        broadCastPreMove(destResource, updateFlags);
1349
				IFileStore originalStore = getStore();
1351
				IFileStore originalStore = getStore();
1350
				message = Messages.resources_moveProblem;
1352
				message = Messages.resources_moveProblem;
1351
				MultiStatus status = new MultiStatus(ResourcesPlugin.PI_RESOURCES, IStatus.ERROR, message, null);
1353
				MultiStatus status = new MultiStatus(ResourcesPlugin.PI_RESOURCES, IStatus.ERROR, message, null);
1352
				WorkManager workManager = workspace.getWorkManager();
1354
				WorkManager workManager = workspace.getWorkManager();
1353
				ResourceTree tree = new ResourceTree(workspace.getFileSystemManager(), workManager.getLock(), status, updateFlags);
1355
				ResourceTree tree = new ResourceTree(workspace.getFileSystemManager(), workManager.getLock(), status, updateFlags);
Lines 1645-1655 Link Here
1645
1647
1646
	/**
1648
	/**
1647
	 * Calls the move/delete hook to perform the deletion.  Since this method calls 
1649
	 * Calls the move/delete hook to perform the deletion.  Since this method calls 
1648
	 * client code, it is run "unprotected", so the workspace lock is not held.  
1650
	 * client code, it is run "unprotected", so the workspace lock is not held.  
1649
	 */
1651
	 */
1650
	private void unprotectedDelete(ResourceTree tree, int updateFlags, IProgressMonitor monitor) throws CoreException {
1652
	private void unprotectedDelete(ResourceTree tree, int updateFlags, IProgressMonitor monitor) {
1651
		IMoveDeleteHook hook = workspace.getMoveDeleteHook();
1653
		IMoveDeleteHook hook = workspace.getMoveDeleteHook();
1652
		switch (getType()) {
1654
		switch (getType()) {
1653
			case IResource.FILE :
1655
			case IResource.FILE :
1654
				if (!hook.deleteFile(tree, (IFile) this, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000 / 2)))
1656
				if (!hook.deleteFile(tree, (IFile) this, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000 / 2)))
1655
					tree.standardDeleteFile((IFile) this, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000));
1657
					tree.standardDeleteFile((IFile) this, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000));
Lines 1657-1707 Link Here
1657
			case IResource.FOLDER :
1659
			case IResource.FOLDER :
1658
				if (!hook.deleteFolder(tree, (IFolder) this, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000 / 2)))
1660
				if (!hook.deleteFolder(tree, (IFolder) this, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000 / 2)))
1659
					tree.standardDeleteFolder((IFolder) this, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000));
1661
					tree.standardDeleteFolder((IFolder) this, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000));
1660
				break;
1662
				break;
1661
			case IResource.PROJECT :
1663
			case IResource.PROJECT :
1662
				workspace.broadcastEvent(LifecycleEvent.newEvent(LifecycleEvent.PRE_PROJECT_DELETE, this));
1663
				if (!hook.deleteProject(tree, (IProject) this, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000 / 2)))
1664
				if (!hook.deleteProject(tree, (IProject) this, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000 / 2)))
1664
					tree.standardDeleteProject((IProject) this, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000));
1665
					tree.standardDeleteProject((IProject) this, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000));
1665
				break;
1666
				break;
1666
			case IResource.ROOT :
1667
			case IResource.ROOT :
1667
				IProject[] projects = ((IWorkspaceRoot) this).getProjects();
1668
				IProject[] projects = ((IWorkspaceRoot) this).getProjects();
1668
				for (int i = 0; i < projects.length; i++) {
1669
				for (int i = 0; i < projects.length; i++) {
1669
					workspace.broadcastEvent(LifecycleEvent.newEvent(LifecycleEvent.PRE_PROJECT_DELETE, projects[i]));
1670
					if (!hook.deleteProject(tree, projects[i], updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000 / projects.length / 2)))
1670
					if (!hook.deleteProject(tree, projects[i], updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000 / projects.length / 2)))
1671
						tree.standardDeleteProject(projects[i], updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000 / projects.length));
1671
						tree.standardDeleteProject(projects[i], updateFlags, Policy.subMonitorFor(monitor, Policy.opWork * 1000 / projects.length));
1672
				}
1672
				}
1673
		}
1673
		}
1674
	}
1674
	}
1675
1675
1676
    private void broadcastPreProjectDelete() throws CoreException {
1677
        switch (getType()) {
1678
        case IResource.PROJECT :
1679
            workspace.broadcastEvent(LifecycleEvent.newEvent(LifecycleEvent.PRE_PROJECT_DELETE, this));
1680
            break;
1681
        case IResource.ROOT :
1682
            IProject[] projects = ((IWorkspaceRoot) this).getProjects();
1683
            for (int i = 0; i < projects.length; i++) {
1684
                workspace.broadcastEvent(LifecycleEvent.newEvent(LifecycleEvent.PRE_PROJECT_DELETE, projects[i]));
1685
            }
1686
        }
1687
    }
1688
1676
	/**
1689
	/**
1677
	 * Calls the move/delete hook to perform the move.  Since this method calls 
1690
	 * Calls the move/delete hook to perform the move.  Since this method calls 
1678
	 * client code, it is run "unprotected", so the workspace lock is not held.  
1691
	 * client code, it is run "unprotected", so the workspace lock is not held.  
1679
	 * Returns true if resources were actually moved, and false otherwise.
1692
	 * Returns true if resources were actually moved, and false otherwise.
1680
	 */
1693
	 */
1681
	private boolean unprotectedMove(ResourceTree tree, final IResource destination, int updateFlags, IProgressMonitor monitor) throws CoreException, ResourceException {
1694
	private boolean unprotectedMove(ResourceTree tree, final IResource destination, int updateFlags, IProgressMonitor monitor) throws CoreException, ResourceException {
1682
		IMoveDeleteHook hook = workspace.getMoveDeleteHook();
1695
		IMoveDeleteHook hook = workspace.getMoveDeleteHook();
1683
		switch (getType()) {
1696
		switch (getType()) {
1684
			case IResource.FILE :
1697
			case IResource.FILE :
1685
				if (isLinked())
1686
					workspace.broadcastEvent(LifecycleEvent.newEvent(LifecycleEvent.PRE_LINK_MOVE, this, destination, updateFlags));
1687
				if (!hook.moveFile(tree, (IFile) this, (IFile) destination, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork / 2)))
1698
				if (!hook.moveFile(tree, (IFile) this, (IFile) destination, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork / 2)))
1688
					tree.standardMoveFile((IFile) this, (IFile) destination, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork));
1699
					tree.standardMoveFile((IFile) this, (IFile) destination, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork));
1689
				break;
1700
				break;
1690
			case IResource.FOLDER :
1701
			case IResource.FOLDER :
1691
				if (isLinked())
1692
					workspace.broadcastEvent(LifecycleEvent.newEvent(LifecycleEvent.PRE_LINK_MOVE, this, destination, updateFlags));
1693
				if (!hook.moveFolder(tree, (IFolder) this, (IFolder) destination, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork / 2)))
1702
				if (!hook.moveFolder(tree, (IFolder) this, (IFolder) destination, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork / 2)))
1694
					tree.standardMoveFolder((IFolder) this, (IFolder) destination, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork));
1703
					tree.standardMoveFolder((IFolder) this, (IFolder) destination, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork));
1695
				break;
1704
				break;
1696
			case IResource.PROJECT :
1705
			case IResource.PROJECT :
1697
				IProject project = (IProject) this;
1706
				IProject project = (IProject) this;
1698
				// if there is no change in name, there is nothing to do so return.
1707
				// if there is no change in name, there is nothing to do so return.
1699
				if (getName().equals(destination.getName()))
1708
				if (getName().equals(destination.getName()))
1700
					return false;
1709
					return false;
1701
				//we are deleting the source project so notify.
1702
				workspace.broadcastEvent(LifecycleEvent.newEvent(LifecycleEvent.PRE_PROJECT_MOVE, this, destination, updateFlags));
1703
				IProjectDescription description = project.getDescription();
1710
				IProjectDescription description = project.getDescription();
1704
				description.setName(destination.getName());
1711
				description.setName(destination.getName());
1705
				if (!hook.moveProject(tree, project, description, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork / 2)))
1712
				if (!hook.moveProject(tree, project, description, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork / 2)))
1706
					tree.standardMoveProject(project, description, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork));
1713
					tree.standardMoveProject(project, description, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork));
1707
				break;
1714
				break;
Lines 1709-1714 Link Here
1709
				String msg = Messages.resources_moveRoot;
1716
				String msg = Messages.resources_moveRoot;
1710
				throw new ResourceException(new ResourceStatus(IResourceStatus.INVALID_VALUE, getFullPath(), msg));
1717
				throw new ResourceException(new ResourceStatus(IResourceStatus.INVALID_VALUE, getFullPath(), msg));
1711
		}
1718
		}
1712
		return true;
1719
		return true;
1713
	}
1720
	}
1721
1722
    private void broadCastPreMove(final IResource destination, int updateFlags) throws CoreException {
1723
        switch (getType()) {
1724
          case IResource.FILE :
1725
              if (isLinked())
1726
                  workspace.broadcastEvent(LifecycleEvent.newEvent(LifecycleEvent.PRE_LINK_MOVE, this, destination, updateFlags));
1727
              break;
1728
          case IResource.FOLDER :
1729
              if (isLinked())
1730
                  workspace.broadcastEvent(LifecycleEvent.newEvent(LifecycleEvent.PRE_LINK_MOVE, this, destination, updateFlags));
1731
              break;
1732
          case IResource.PROJECT :
1733
              if (!getName().equals(destination.getName())) {
1734
                  // if there is a change in name, we are deleting the source project so notify.
1735
                  workspace.broadcastEvent(LifecycleEvent.newEvent(LifecycleEvent.PRE_PROJECT_MOVE, this, destination, updateFlags));
1736
              }
1737
              break;
1738
		}
1739
    }
1714
}
1740
}
(-)resources\Workspace.java.orig (-6 / +20 lines)
Lines 234-245 Link Here
234
	/**
234
	/**
235
	 * Indicates that a build is about to occur. Broadcasts the necessary
235
	 * Indicates that a build is about to occur. Broadcasts the necessary
236
	 * deltas before the build starts. Note that this will cause POST_BUILD
236
	 * deltas before the build starts. Note that this will cause POST_BUILD
237
	 * to be automatically done at the end of the operation in which
237
	 * to be automatically done at the end of the operation in which
238
	 * the build occurs.
238
	 * the build occurs.
239
	 * @throws CoreException 
239
	 */
240
	 */
240
	protected void aboutToBuild(Object source, int trigger) {
241
	protected void aboutToBuild(Object source, int trigger) throws CoreException {
241
		//fire a POST_CHANGE first to ensure everyone is up to date before firing PRE_BUILD
242
		//fire a POST_CHANGE first to ensure everyone is up to date before firing PRE_BUILD
242
		broadcastPostChange();
243
		broadcastPostChange();
243
		broadcastBuildEvent(source, IResourceChangeEvent.PRE_BUILD, trigger);
244
		broadcastBuildEvent(source, IResourceChangeEvent.PRE_BUILD, trigger);
244
	}
245
	}
245
246
Lines 288-298 Link Here
288
		operationTree = tree;
289
		operationTree = tree;
289
		if (createNewTree && tree.isImmutable())
290
		if (createNewTree && tree.isImmutable())
290
			newWorkingTree();
291
			newWorkingTree();
291
	}
292
	}
292
293
293
	public void broadcastBuildEvent(Object source, int type, int buildTrigger) {
294
	public void broadcastBuildEvent(Object source, int type, int buildTrigger) throws CoreException {
294
		ResourceChangeEvent event = new ResourceChangeEvent(source, type, buildTrigger, null);
295
		ResourceChangeEvent event = new ResourceChangeEvent(source, type, buildTrigger, null);
295
		notificationManager.broadcastChanges(tree, event, false);
296
		notificationManager.broadcastChanges(tree, event, false);
296
	}
297
	}
297
298
298
	/**
299
	/**
Lines 304-314 Link Here
304
			ILifecycleListener listener = (ILifecycleListener) it.next();
305
			ILifecycleListener listener = (ILifecycleListener) it.next();
305
			listener.handleEvent(event);
306
			listener.handleEvent(event);
306
		}
307
		}
307
	}
308
	}
308
309
309
	public void broadcastPostChange() {
310
	public void broadcastPostChange() throws CoreException {
310
		ResourceChangeEvent event = new ResourceChangeEvent(this, IResourceChangeEvent.POST_CHANGE, 0, null);
311
		ResourceChangeEvent event = new ResourceChangeEvent(this, IResourceChangeEvent.POST_CHANGE, 0, null);
311
		notificationManager.broadcastChanges(tree, event, true);
312
		notificationManager.broadcastChanges(tree, event, true);
312
	}
313
	}
313
314
314
	/* (non-Javadoc)
315
	/* (non-Javadoc)
Lines 1859-1871 Link Here
1859
			buildOrder = null;
1860
			buildOrder = null;
1860
		description.copyFrom(newDescription);
1861
		description.copyFrom(newDescription);
1861
		ResourcesPlugin.getPlugin().savePluginPreferences();
1862
		ResourcesPlugin.getPlugin().savePluginPreferences();
1862
	}
1863
	}
1863
1864
1864
	public void setTreeLocked(boolean locked) {
1865
	public void setTreeLocked(boolean locked) throws CoreException {
1865
		treeLocked = locked ? Thread.currentThread() : null;
1866
        if (!getWorkManager().isLockAlreadyAcquired()) {
1866
	}
1867
            String message;
1868
            if (locked) {
1869
                message = Messages.resources_lock_tree;
1870
            } else {
1871
                message = Messages.resources_release_tree;
1872
            }
1873
            ResourceStatus resourceStatus = new ResourceStatus(IResourceStatus.INTERNAL_ERROR, null, message);
1874
            // I would prefer to forbid this, but Project.close():138 fails miserably if I throw this Exception,
1875
            // it calls broadcastEvents before the prepareOperation.
1876
            // throw new ResourceException(resourceStatus);
1877
            ResourcesPlugin.getPlugin().getLog().log(resourceStatus);
1878
        }
1879
        treeLocked = locked ? Thread.currentThread() : null;
1880
    }
1867
1881
1868
	/**
1882
	/**
1869
	 * @deprecated
1883
	 * @deprecated
1870
	 */
1884
	 */
1871
	public void setWorkspaceLock(WorkspaceLock lock) {
1885
	public void setWorkspaceLock(WorkspaceLock lock) {
(-)utils\Messages.java.orig (+4 lines)
Lines 185-194 Link Here
185
	public static String resources_invalidName;
185
	public static String resources_invalidName;
186
	public static String resources_invalidPath;
186
	public static String resources_invalidPath;
187
	public static String resources_invalidProjDesc;
187
	public static String resources_invalidProjDesc;
188
	public static String resources_invalidResourceName;
188
	public static String resources_invalidResourceName;
189
	public static String resources_invalidRoot;
189
	public static String resources_invalidRoot;
190
191
    public static String resources_lock_tree;
190
	public static String resources_markerNotFound;
192
	public static String resources_markerNotFound;
191
	public static String resources_missingProjectMeta;
193
	public static String resources_missingProjectMeta;
192
	public static String resources_missingProjectMetaRepaired;
194
	public static String resources_missingProjectMetaRepaired;
193
	public static String resources_moveDestNotSub;
195
	public static String resources_moveDestNotSub;
194
	public static String resources_moveMeta;
196
	public static String resources_moveMeta;
Lines 236-245 Link Here
236
	public static String resources_readWorkspaceMetaValue;
238
	public static String resources_readWorkspaceMetaValue;
237
	public static String resources_readWorkspaceSnap;
239
	public static String resources_readWorkspaceSnap;
238
	public static String resources_readWorkspaceTree;
240
	public static String resources_readWorkspaceTree;
239
	public static String resources_refreshing;
241
	public static String resources_refreshing;
240
	public static String resources_refreshingRoot;
242
	public static String resources_refreshingRoot;
243
244
    public static String resources_release_tree;
241
	public static String resources_resetMarkers;
245
	public static String resources_resetMarkers;
242
	public static String resources_resetSync;
246
	public static String resources_resetSync;
243
	public static String resources_resourcePath;
247
	public static String resources_resourcePath;
244
	public static String resources_saveOp;
248
	public static String resources_saveOp;
245
	public static String resources_saveProblem;
249
	public static String resources_saveProblem;
(-)utils\messages.properties.orig (+2 lines)
Lines 235-244 Link Here
235
resources_refreshing = Refreshing ''{0}''.
235
resources_refreshing = Refreshing ''{0}''.
236
resources_refreshingRoot = Refreshing workspace.
236
resources_refreshingRoot = Refreshing workspace.
237
resources_resetMarkers = Could not reset markers snapshot file.
237
resources_resetMarkers = Could not reset markers snapshot file.
238
resources_resetSync = Could not reset sync info snapshot file.
238
resources_resetSync = Could not reset sync info snapshot file.
239
resources_resourcePath = Invalid path for resource ''{0}''. Must include project and resource name.
239
resources_resourcePath = Invalid path for resource ''{0}''. Must include project and resource name.
240
resources_release_tree=attempt to release the tree while not owning the workspace lock
240
resources_saveOp = Save cannot be called from inside an operation.
241
resources_saveOp = Save cannot be called from inside an operation.
241
resources_saveProblem = Problems occurred during save.
242
resources_saveProblem = Problems occurred during save.
242
resources_saveWarnings = Save operation warnings.
243
resources_saveWarnings = Save operation warnings.
243
resources_saving_0 = Saving workspace.
244
resources_saving_0 = Saving workspace.
244
resources_savingEncoding = Could not save encoding settings.
245
resources_savingEncoding = Could not save encoding settings.
Lines 258-267 Link Here
258
resources_updating = Updating workspace
259
resources_updating = Updating workspace
259
resources_updatingEncoding = Problems encountered while updating encoding settings.
260
resources_updatingEncoding = Problems encountered while updating encoding settings.
260
resources_workspaceClosed = Workspace is closed.
261
resources_workspaceClosed = Workspace is closed.
261
resources_workspaceOpen = The workspace is already open.
262
resources_workspaceOpen = The workspace is already open.
262
resources_writeMeta = Could not write metadata for ''{0}''.
263
resources_writeMeta = Could not write metadata for ''{0}''.
264
resources_lock_tree=attempt to lock the tree while not owning the workspace lock
263
resources_writeWorkspaceMeta = Could not write workspace metadata ''{0}''.
265
resources_writeWorkspaceMeta = Could not write workspace metadata ''{0}''.
264
266
265
synchronizer_partnerNotRegistered = Sync partner: {0} not registered with the synchronizer.
267
synchronizer_partnerNotRegistered = Sync partner: {0} not registered with the synchronizer.
266
268
267
### URL
269
### URL
(-)events\NotificationManager.java.orig (-5 / +7 lines)
Lines 126-137 Link Here
126
		notificationRequested = false;
126
		notificationRequested = false;
127
	}
127
	}
128
128
129
	/**
129
	/**
130
	 * The main broadcast point for notification deltas 
130
	 * The main broadcast point for notification deltas 
131
	 * @throws CoreException 
131
	 */
132
	 */
132
	public void broadcastChanges(ElementTree lastState, ResourceChangeEvent event, boolean lockTree) {
133
	public void broadcastChanges(ElementTree lastState, ResourceChangeEvent event, boolean lockTree) throws CoreException {
133
		final int type = event.getType();
134
		final int type = event.getType();
134
		try {
135
		try {
135
			// Do the notification if there are listeners for events of the given type.
136
			// Do the notification if there are listeners for events of the given type.
136
			if (!listeners.hasListenerFor(type))
137
			if (!listeners.hasListenerFor(type))
137
				return;
138
				return;
Lines 176-187 Link Here
176
			lastDeltaState = lastState;
177
			lastDeltaState = lastState;
177
		}
178
		}
178
	}
179
	}
179
180
180
	/**
181
	/**
181
	 * Helper method for the save participant lifecycle computation. */
182
	 * Helper method for the save participant lifecycle computation. 
182
	public void broadcastChanges(IResourceChangeListener listener, int type, IResourceDelta delta) {
183
	 * @throws CoreException */
184
	public void broadcastChanges(IResourceChangeListener listener, int type, IResourceDelta delta) throws CoreException {
183
		ResourceChangeListenerList.ListenerEntry[] entries;
185
		ResourceChangeListenerList.ListenerEntry[] entries;
184
		entries = new ResourceChangeListenerList.ListenerEntry[] {new ResourceChangeListenerList.ListenerEntry(listener, type)};
186
		entries = new ResourceChangeListenerList.ListenerEntry[] {new ResourceChangeListenerList.ListenerEntry(listener, type)};
185
		notify(entries, new ResourceChangeEvent(workspace, type, 0, delta), false);
187
		notify(entries, new ResourceChangeEvent(workspace, type, 0, delta), false);
186
	}
188
	}
187
189
Lines 237-247 Link Here
237
239
238
	protected ResourceChangeListenerList.ListenerEntry[] getListeners() {
240
	protected ResourceChangeListenerList.ListenerEntry[] getListeners() {
239
		return listeners.getListeners();
241
		return listeners.getListeners();
240
	}
242
	}
241
243
242
	public void handleEvent(LifecycleEvent event) {
244
	public void handleEvent(LifecycleEvent event) throws CoreException {
243
		switch (event.kind) {
245
		switch (event.kind) {
244
			case LifecycleEvent.PRE_PROJECT_CLOSE :
246
			case LifecycleEvent.PRE_PROJECT_CLOSE :
245
				if (!listeners.hasListenerFor(IResourceChangeEvent.PRE_CLOSE))
247
				if (!listeners.hasListenerFor(IResourceChangeEvent.PRE_CLOSE))
246
					return;
248
					return;
247
				IProject project = (IProject) event.resource;
249
				IProject project = (IProject) event.resource;
Lines 260-270 Link Here
260
				notify(getListeners(), new ResourceChangeEvent(workspace, IResourceChangeEvent.PRE_DELETE, project), true);
262
				notify(getListeners(), new ResourceChangeEvent(workspace, IResourceChangeEvent.PRE_DELETE, project), true);
261
				break;
263
				break;
262
		}
264
		}
263
	}
265
	}
264
266
265
	private void notify(ResourceChangeListenerList.ListenerEntry[] resourceListeners, final IResourceChangeEvent event, final boolean lockTree) {
267
	private void notify(ResourceChangeListenerList.ListenerEntry[] resourceListeners, final IResourceChangeEvent event, final boolean lockTree) throws CoreException {
266
		int type = event.getType();
268
		int type = event.getType();
267
		boolean oldLock = workspace.isTreeLocked();
269
		boolean oldLock = workspace.isTreeLocked();
268
		if (lockTree)
270
		if (lockTree)
269
			workspace.setTreeLocked(true);
271
			workspace.setTreeLocked(true);
270
		try {
272
		try {

Return to bug 226264