From ad3552fccefa4a33930eaba135d2ec667683b028 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Sun, 22 Aug 2010 20:47:42 +0000 Subject: [PATCH] Cosmetics. --- .../model/org/eclipse/cdt/core/model/IWorkingCopy.java | 5 ++--- .../eclipse/cdt/internal/core/model/WorkingCopy.java | 10 +++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IWorkingCopy.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IWorkingCopy.java index 39a476b7e59..15cb922ec83 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IWorkingCopy.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IWorkingCopy.java @@ -10,8 +10,6 @@ *******************************************************************************/ package org.eclipse.cdt.core.model; - - import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; @@ -49,7 +47,7 @@ import org.eclipse.core.runtime.IProgressMonitor; * @noextend This interface is not intended to be extended by clients. * @noimplement This interface is not intended to be implemented by clients. */ -public interface IWorkingCopy extends ITranslationUnit{ +public interface IWorkingCopy extends ITranslationUnit { /** * Commits the contents of this working copy to its original element * and underlying resource, bringing the C model up-to-date with the current @@ -67,6 +65,7 @@ public interface IWorkingCopy extends ITranslationUnit{ * */ void commit(boolean force, IProgressMonitor monitor) throws CModelException; + /** * Destroys this working copy, closing its buffer and discarding * its structure. Subsequent attempts to access non-handle information diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java index 62ce073f322..08346c670b4 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java @@ -195,7 +195,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy { element = element.getParent(); } ICElement current = tu; - for (int i = children.size()-1; i >= 0; i--) { + for (int i = children.size(); --i >= 0;) { ICElement child = children.get(i); if (current instanceof IParent) { try { @@ -218,7 +218,6 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy { return current; } - /** * @see org.eclipse.cdt.core.model.IWorkingCopy#getOriginalElement() */ @@ -237,6 +236,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy { public IWorkingCopy getSharedWorkingCopy(IProgressMonitor monitor, IProblemRequestor requestor) { return this; } + /** * @see org.eclipse.cdt.core.model.ITranslationUnit#getWorkingCopy() */ @@ -306,7 +306,6 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy { */ @Override protected IBuffer openBuffer(IProgressMonitor pm) throws CModelException { - if (this.useCount == 0) throw newNotPresentException(); // create buffer - working copies may use custom buffer factory @@ -346,7 +345,6 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy { return buffer; } - /** * @see org.eclipse.cdt.core.model.IWorkingCopy#reconcile() */ @@ -407,12 +405,10 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy { */ public IASTTranslationUnit reconcile(boolean computeAST, boolean forceProblemDetection, IProgressMonitor monitor) throws CModelException { - - if (this.useCount == 0) throw newNotPresentException(); //was destroyed + if (this.useCount == 0) throw newNotPresentException(); // was destroyed ReconcileWorkingCopyOperation op = new ReconcileWorkingCopyOperation(this, computeAST, forceProblemDetection); op.runOperation(monitor); return op.fAST; } - }