public static IStatus makeCommittable(IResource[] resources, Object context) { List readOnlyFiles= new ArrayList(); for (int i= 0; i < resources.length; i++) { IResource resource= resources[i]; if (resource.getType() == IResource.FILE && resource.isReadOnly()) readOnlyFiles.add(resource); } if (readOnlyFiles.size() == 0) return new Status(IStatus.OK, JavaPlugin.getPluginId(), IStatus.OK, "", null);  Map oldTimeStamps= createModificationStampMap(readOnlyFiles); IStatus status= ResourcesPlugin.getWorkspace().validateEdit( (IFile[]) readOnlyFiles.toArray(new IFile[readOnlyFiles.size()]), context); if (!status.isOK()) return status;  IStatus modified= null; Map newTimeStamps= createModificationStampMap(readOnlyFiles); for (Iterator iter= oldTimeStamps.keySet().iterator(); iter.hasNext();) { IFile file= (IFile) iter.next(); if (!oldTimeStamps.get(file).equals(newTimeStamps.get(file))) modified= addModified(modified, file); } if (modified != null) return modified; return new Status(IStatus.OK, JavaPlugin.getPluginId(), IStatus.OK, "", null);
public static IStatus makeCommittable(IResource resource, Object context) { return makeCommittable(new IResource[] { resource }, context);
	public static IStatus makeCommittable(IResource[] resources, Object context) {		List readOnlyFiles= new ArrayList();		for (int i= 0; i < resources.length; i++) {			IResource resource= resources[i];			if (resource.getType() == IResource.FILE && resource.isReadOnly())					readOnlyFiles.add(resource);		}		if (readOnlyFiles.size() == 0)			return new Status(IStatus.OK, JavaPlugin.getPluginId(), IStatus.OK, "", null); //$NON-NLS-1$					Map oldTimeStamps= createModificationStampMap(readOnlyFiles);		IStatus status= ResourcesPlugin.getWorkspace().validateEdit(			(IFile[]) readOnlyFiles.toArray(new IFile[readOnlyFiles.size()]), context);		if (!status.isOK())			return status;					IStatus modified= null;		Map newTimeStamps= createModificationStampMap(readOnlyFiles);		for (Iterator iter= oldTimeStamps.keySet().iterator(); iter.hasNext();) {			IFile file= (IFile) iter.next();			if (!oldTimeStamps.get(file).equals(newTimeStamps.get(file)))				modified= addModified(modified, file);		}		if (modified != null)				return modified;		return new Status(IStatus.OK, JavaPlugin.getPluginId(), IStatus.OK, "", null); //$NON-NLS-1$	}