Example usage for org.eclipse.jdt.internal.core.util Messages element_reconciling

List of usage examples for org.eclipse.jdt.internal.core.util Messages element_reconciling

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core.util Messages element_reconciling.

Prototype

String element_reconciling

To view the source code for org.eclipse.jdt.internal.core.util Messages element_reconciling.

Click Source Link

Usage

From source file:org.eclipse.ajdt.core.reconcile.AJReconcileWorkingCopyOperation.java

License:Open Source License

/**
 * @exception JavaModelException if setting the source
 *    of the original compilation unit fails
 *///from  w  w  w.java  2s  .  co  m
protected void executeOperation() throws JavaModelException {
    checkCanceled();

    try {
        beginTask(Messages.element_reconciling, 2);

        CompilationUnit workingCopy = getWorkingCopy();
        boolean wasConsistent = workingCopy.isConsistent();

        // check is problem requestor is active
        IProblemRequestor problemRequestor = workingCopy.getPerWorkingCopyInfo();
        if (problemRequestor != null)
            problemRequestor = ((JavaModelManager.PerWorkingCopyInfo) problemRequestor).getProblemRequestor();
        boolean defaultRequestorIsActive = problemRequestor != null && problemRequestor.isActive();
        IProblemRequestor ownerProblemRequestor = this.workingCopyOwner.getProblemRequestor(workingCopy);
        boolean ownerRequestorIsActive = ownerProblemRequestor != null
                && ownerProblemRequestor != problemRequestor && ownerProblemRequestor.isActive();
        this.requestorIsActive = defaultRequestorIsActive || ownerRequestorIsActive;

        // create the delta builder (this remembers the current content of the cu)
        this.deltaBuilder = new JavaElementDeltaBuilder(workingCopy);

        // make working copy consistent if needed and compute AST if needed
        makeConsistent(workingCopy);

        // notify reconcile participants only if working copy was not consistent or if forcing problem detection
        // (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=177319)
        if (!wasConsistent || ((this.reconcileFlags & ICompilationUnit.FORCE_PROBLEM_DETECTION) != 0)) {
            notifyParticipants(workingCopy);

            // recreate ast if one participant reset it
            if (this.ast == null)
                makeConsistent(workingCopy);
        }

        // report problems
        if (this.problems != null && (((this.reconcileFlags & ICompilationUnit.FORCE_PROBLEM_DETECTION) != 0)
                || !wasConsistent)) {
            if (defaultRequestorIsActive) {
                reportProblems(workingCopy, problemRequestor);
            }
            if (ownerRequestorIsActive) {
                reportProblems(workingCopy, ownerProblemRequestor);
            }
        }

        // register the deltas
        // AspectJ Change Begin
        JavaElementDelta delta = getDelta(deltaBuilder);
        if (delta != null) {
            addReconcileDelta(workingCopy, delta);
        }
        // AspectJ Change End
    } finally {
        done();
    }
}