View | Details | Raw Unified | Return to bug 254887
Collapse All | Expand All

(-)modulecore-src/org/eclipse/wst/common/componentcore/internal/resources/VirtualResource.java (-7 / +10 lines)
Lines 298-316 Link Here
298
		try {
298
		try {
299
			moduleCore = StructureEdit.getStructureEditForWrite(getProject());
299
			moduleCore = StructureEdit.getStructureEditForWrite(getProject());
300
			WorkbenchComponent component = moduleCore.getComponent();
300
			WorkbenchComponent component = moduleCore.getComponent();
301
			ResourceTreeRoot root = ResourceTreeRoot.getDeployResourceTreeRoot(component);
301
			if (component != null) {
302
			ComponentResource[] resources = root.findModuleResources(getRuntimePath(), ResourceTreeNode.CREATE_NONE);
302
				ResourceTreeRoot root = ResourceTreeRoot.getDeployResourceTreeRoot(component);
303
			if (resources.length > 0) {
303
				ComponentResource[] resources = root.findModuleResources(getRuntimePath(), ResourceTreeNode.CREATE_NONE);
304
				for (int resourceIndx = 0; resourceIndx < resources.length; resourceIndx++) {
304
				if (resources.length > 0) {
305
					if (aProjectRelativeLocation.makeAbsolute().equals(resources[resourceIndx].getSourcePath())) {
305
					for (int resourceIndx = 0; resourceIndx < resources.length; resourceIndx++) {
306
						component.getResources().remove(resources[resourceIndx]);
306
						if (aProjectRelativeLocation.makeAbsolute().equals(resources[resourceIndx].getSourcePath())) {
307
							component.getResources().remove(resources[resourceIndx]);
308
						}
307
					}
309
					}
308
				}
310
				}
309
			}
311
			}
310
		}
312
		}
311
		finally {
313
		finally {
312
			if (moduleCore != null) {
314
			if (moduleCore != null) {
313
				moduleCore.saveIfNecessary(monitor);
315
				if (component != null)
316
					moduleCore.saveIfNecessary(monitor);
314
				moduleCore.dispose();
317
				moduleCore.dispose();
315
			}
318
			}
316
		}
319
		}

Return to bug 254887