public void dispose() { for (Iterator<ICompilationUnit> iterator= fWorkingCopies.values().iterator(); iterator.hasNext();) { ICompilationUnit cu= iterator.next(); try { cu.discardWorkingCopy(); } catch (JavaModelException e) { JavaPlugin.log(e); } } fWorkingCopies.clear(); }
public void dispose() { for (Iterator iterator= fWorkingCopies.values().iterator(); iterator.hasNext();) { ICompilationUnit cu= (ICompilationUnit)iterator.next(); try { cu.discardWorkingCopy(); } catch (JavaModelException e) { JavaPlugin.log(e); } } }
private void discardWorkingCopy(ICompilationUnit wc) { try { if (wc != null) { wc.discardWorkingCopy(); } } catch (JavaModelException x) { RecommendersPlugin.log(x); } }
public void dispose() { for (Iterator<ICompilationUnit> iterator= fWorkingCopies.values().iterator(); iterator.hasNext();) { ICompilationUnit cu= iterator.next(); try { cu.discardWorkingCopy(); } catch (JavaModelException e) { JavaPlugin.log(e); } } fWorkingCopies.clear(); }
/** * Resets the working copies. */ protected void resetWorkingCopies() { final ICompilationUnit[] units= JavaCore.getWorkingCopies(fOwner); for (int index= 0; index < units.length; index++) { final ICompilationUnit unit= units[index]; try { unit.discardWorkingCopy(); } catch (Exception exception) { // Do nothing } } }
/** * Resets the working copies. */ protected void resetWorkingCopies() { final ICompilationUnit[] units= JavaCore.getWorkingCopies(fOwner); for (int index= 0; index < units.length; index++) { final ICompilationUnit unit= units[index]; try { unit.discardWorkingCopy(); } catch (Exception exception) { // Do nothing } } }
/** * Resets the working copies. */ protected void resetWorkingCopies() { final ICompilationUnit[] units= JavaCore.getWorkingCopies(fOwner); for (int index= 0; index < units.length; index++) { final ICompilationUnit unit= units[index]; try { unit.discardWorkingCopy(); } catch (Exception exception) { // Do nothing } } }
public void disconnect(Object element) { CompilationUnitInfo info= (CompilationUnitInfo)fFakeCUMapForMissingInfo.get(element); if (info != null) { if (info.fCount == 1) { fFakeCUMapForMissingInfo.remove(element); info.fModel= null; // Destroy and unregister fake working copy try { info.fCopy.discardWorkingCopy(); } catch (JavaModelException ex) { handleCoreException(ex, ex.getMessage()); } } else info.fCount--; } super.disconnect(element); }
/** * {@inheritDoc} */ public Change perform(IProgressMonitor pm) throws CoreException { pm.beginTask("", 2); //$NON-NLS-1$ fCUnit.becomeWorkingCopy(null, new SubProgressMonitor(pm,1)); try { return super.perform(new SubProgressMonitor(pm,1)); } finally { fCUnit.discardWorkingCopy(); } } }
private static String getCopiedFileSource(IProgressMonitor monitor, ICompilationUnit unit, String newTypeName) throws CoreException { ICompilationUnit copy= unit.getPrimary().getWorkingCopy(null); try { TextChangeManager manager= createChangeManager(monitor, copy, newTypeName); String result= manager.get(copy).getPreviewContent(new NullProgressMonitor()); return result; } finally { copy.discardWorkingCopy(); } }
private static String getCopiedFileSource(IProgressMonitor monitor, ICompilationUnit unit, String newTypeName) throws CoreException { ICompilationUnit copy= unit.getPrimary().getWorkingCopy(null); try { TextChangeManager manager= createChangeManager(monitor, copy, newTypeName); String result= manager.get(copy).getPreviewContent(new NullProgressMonitor()); return result; } finally { copy.discardWorkingCopy(); } }
private static String getCopiedFileSource(IProgressMonitor monitor, ICompilationUnit unit, String newTypeName) throws CoreException { ICompilationUnit copy= unit.getPrimary().getWorkingCopy(null); try { TextChangeManager manager= createChangeManager(monitor, copy, newTypeName); String result= manager.get(copy).getPreviewContent(new NullProgressMonitor()); return result; } finally { copy.discardWorkingCopy(); } }
private static String getCopiedFileSource(IProgressMonitor monitor, ICompilationUnit unit, String newTypeName) throws CoreException { ICompilationUnit copy= unit.getPrimary().getWorkingCopy(null); try { TextChangeManager manager= createChangeManager(monitor, copy, newTypeName); String result= manager.get(copy).getPreviewContent(new NullProgressMonitor()); return result; } finally { copy.discardWorkingCopy(); } }
protected void disposeFileInfo(Object element, FileInfo info) { if (info instanceof CompilationUnitInfo) { CompilationUnitInfo cuInfo= (CompilationUnitInfo) info; try { cuInfo.fCopy.discardWorkingCopy(); } catch (JavaModelException x) { handleCoreException(x, x.getMessage()); } if (cuInfo.fModel != null) cuInfo.fModel.removeAnnotationModelListener(fGlobalAnnotationModelListener); } super.disposeFileInfo(element, info); }
@Override protected void disposeFileInfo(Object element, FileInfo info) { if (info instanceof CompilationUnitInfo) { CompilationUnitInfo cuInfo= (CompilationUnitInfo) info; try { cuInfo.fCopy.discardWorkingCopy(); } catch (JavaModelException x) { handleCoreException(x, x.getMessage()); } if (cuInfo.fModel != null) cuInfo.fModel.removeAnnotationModelListener(fGlobalAnnotationModelListener); } super.disposeFileInfo(element, info); }
@Override protected void disposeFileInfo(Object element, FileInfo info) { if (info instanceof CompilationUnitInfo) { CompilationUnitInfo cuInfo= (CompilationUnitInfo) info; try { cuInfo.fCopy.discardWorkingCopy(); } catch (JavaModelException x) { handleCoreException(x, x.getMessage()); } if (cuInfo.fModel != null) cuInfo.fModel.removeAnnotationModelListener(fGlobalAnnotationModelListener); } super.disposeFileInfo(element, info); }
@Override public Change perform(IProgressMonitor pm) throws CoreException { SubMonitor subMonitor= SubMonitor.convert(pm, 2); fCUnit.becomeWorkingCopy(subMonitor.split(1)); try { return super.perform(subMonitor.split(1)); } finally { fCUnit.discardWorkingCopy(); } } }
private Change createCompilationUnitForMovedType(IProgressMonitor pm) throws CoreException { ICompilationUnit newCuWC= null; try { newCuWC= fType.getPackageFragment().getCompilationUnit(JavaModelUtil.getRenamedCUName(fType.getCompilationUnit(), fType.getElementName())).getWorkingCopy(null); String source= createSourceForNewCu(newCuWC, pm); return new CreateCompilationUnitChange(fType.getPackageFragment().getCompilationUnit(JavaModelUtil.getRenamedCUName(fType.getCompilationUnit(), fType.getElementName())), source, null); } finally { if (newCuWC != null) newCuWC.discardWorkingCopy(); } }
private Change createCompilationUnitForMovedType(IProgressMonitor pm) throws CoreException { ICompilationUnit newCuWC= null; try { newCuWC= fType.getPackageFragment().getCompilationUnit(JavaModelUtil.getRenamedCUName(fType.getCompilationUnit(), fType.getElementName())).getWorkingCopy(null); String source= createSourceForNewCu(newCuWC, pm); return new CreateCompilationUnitChange(fType.getPackageFragment().getCompilationUnit(JavaModelUtil.getRenamedCUName(fType.getCompilationUnit(), fType.getElementName())), source, null); } finally { if (newCuWC != null) newCuWC.discardWorkingCopy(); } }
private Change createCompilationUnitForMovedType(IProgressMonitor pm) throws CoreException { ICompilationUnit newCuWC= null; try { newCuWC= fType.getPackageFragment().getCompilationUnit(JavaModelUtil.getRenamedCUName(fType.getCompilationUnit(), fType.getElementName())).getWorkingCopy(null); String source= createSourceForNewCu(newCuWC, pm); return new CreateCompilationUnitChange(fType.getPackageFragment().getCompilationUnit(JavaModelUtil.getRenamedCUName(fType.getCompilationUnit(), fType.getElementName())), source, null); } finally { if (newCuWC != null) newCuWC.discardWorkingCopy(); } }