Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.ICompilationUnit.discardWorkingCopy()


          TextEdit edit = imports.rewriteImports(monitor);
          JavaUtil.applyEdit(copy, edit, true, monitor);
        }
        if (copy.isWorkingCopy()) {
          copy.commitWorkingCopy(true, monitor);
          copy.discardWorkingCopy();
        }
        IWorkbenchPartSite site = getEditorSite();
        if (site != null) {
          OrganizeImportsAction action = new OrganizeImportsAction(site);
          action.run(unit);
View Full Code Here


      try {
        icu.becomeWorkingCopy(null);
        icu.getBuffer().setContents(document.get());
        icu.reconcile(ICompilationUnit.NO_AST, false, null, null);
        icu.commitWorkingCopy(true, null);
        icu.discardWorkingCopy();
      } catch (JavaModelException e) {
        CrashReporter.reportException(e);
        logger.debug("Reconcile operation on ICompilationUnit failed.\r\n"
            + e.getLocalizedMessage());
      }
View Full Code Here

      try {
        icu.becomeWorkingCopy(null);
        icu.getBuffer().setContents(document.get());
        icu.reconcile(ICompilationUnit.NO_AST, false, null, null);
        icu.commitWorkingCopy(true, null);
        icu.discardWorkingCopy();
      } catch (JavaModelException e) {
        logger.debug("Reconcile operation on ICompilationUnit failed.\r\n"
            + e.getLocalizedMessage());
      }
    }
View Full Code Here

      try {
        icu.becomeWorkingCopy(null);
        icu.getBuffer().setContents(document.get());
        icu.reconcile(ICompilationUnit.NO_AST, false, null, null);
        icu.commitWorkingCopy(true, null);
        icu.discardWorkingCopy();
      } catch (JavaModelException e) {
        logger.debug("Reconcile operation on ICompilationUnit failed.\r\n"
            + e.getLocalizedMessage());
      }
    }
View Full Code Here

      // update of the compilation unit
      icu.getBuffer().setContents(newSource);
      icu.reconcile(ICompilationUnit.NO_AST, false, null, null);
      icu.commitWorkingCopy(false, null);
      icu.discardWorkingCopy();
    } catch (Exception e) {
      CrashReporter.reportException(e);
      logger.debug("Could not insert result: " + e.toString());
    }
  }
View Full Code Here

            FindbugsPlugin.getBugCollection(project, monitor).remove(bug);

            marker.delete();
        } finally {
            originalUnit.discardWorkingCopy();
        }
    }

    protected abstract boolean resolveBindings();
View Full Code Here

  {
    ICompilationUnit workingCopy = src.getWorkingCopy(null);

    ProblemRequestor requestor = new ProblemRequestor(ids);
    try{
      workingCopy.discardWorkingCopy();
      workingCopy.becomeWorkingCopy(requestor, null);
    }finally{
      workingCopy.discardWorkingCopy();
    }
    List<IProblem> problems = requestor.getProblems();
View Full Code Here

    ProblemRequestor requestor = new ProblemRequestor(ids);
    try{
      workingCopy.discardWorkingCopy();
      workingCopy.becomeWorkingCopy(requestor, null);
    }finally{
      workingCopy.discardWorkingCopy();
    }
    List<IProblem> problems = requestor.getProblems();
    return (IProblem[])problems.toArray(new IProblem[problems.size()]);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.