From 344f3979de363682faa36b811ffde07107cd2119 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Mon, 30 Apr 2012 16:22:49 -0700 Subject: [PATCH] Changed return type of CEditor.getInputCElement to be IWorkingCopy. The method already returned a working copy before this change but it was implicit. --- .../eclipse/cdt/internal/ui/editor/CEditor.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java index 4057e70b58c..934f4518fc3 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java @@ -1609,12 +1609,12 @@ public class CEditor extends TextEditor implements ICEditor, ISelectionChangedLi } /** - * Returns the C element wrapped by this editors input. + * Returns the working copy wrapped by this editors input. * - * @return the C element wrapped by this editors input. + * @return the working copy wrapped by this editors input. * @since 3.0 */ - public ICElement getInputCElement () { + public IWorkingCopy getInputCElement () { return CUIPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(getEditorInput()); } @@ -1950,13 +1950,13 @@ public class CEditor extends TextEditor implements ICEditor, ISelectionChangedLi * @return the most narrow element which includes the given offset */ protected ICElement getElementAt(int offset, boolean reconcile) { - ITranslationUnit unit= (ITranslationUnit) getInputCElement(); + IWorkingCopy unit= getInputCElement(); if (unit != null) { try { - if (reconcile && unit instanceof IWorkingCopy) { + if (reconcile) { synchronized (unit) { - ((IWorkingCopy) unit).reconcile(); + unit.reconcile(); } return unit.getElementAtOffset(offset); } else if (unit.isStructureKnown() && unit.isConsistent() && !fIsReconciling) { @@ -1964,7 +1964,7 @@ public class CEditor extends TextEditor implements ICEditor, ISelectionChangedLi } } catch (CModelException x) { CUIPlugin.log(x.getStatus()); - // nothing found, be tolerant and go on + // Nothing found, be tolerant and go on. } }