1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-05 06:33:23 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2010-10-20 23:37:49 +00:00
parent 0672757bc6
commit 8a6ca5e261
3 changed files with 126 additions and 127 deletions

View file

@ -40,7 +40,7 @@ public class CModelUtil {
public static ITranslationUnit toOriginal(ITranslationUnit unit){
if (unit.isWorkingCopy()) {
return (((IWorkingCopy)unit).getOriginalElement());
return (((IWorkingCopy) unit).getOriginalElement());
}
return unit;
}

View file

@ -42,7 +42,6 @@ import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICProject;
/**
* This is the processor used for the rename. It decides which of the delegates to
* use and forwards further calls to the delegate.

View file

@ -274,7 +274,7 @@ public class EditorUtility {
private static IEditorInput getEditorInput(ICElement element) throws CModelException {
while (element != null) {
if (element instanceof ISourceReference) {
ITranslationUnit tu = ((ISourceReference)element).getTranslationUnit();
ITranslationUnit tu = ((ISourceReference) element).getTranslationUnit();
if (tu != null) {
element = tu;
}
@ -548,18 +548,18 @@ public class EditorUtility {
}
/**
* Gets the working copy of an compilation unit opened in an editor
* Gets the working copy of an translation unit opened in an editor
*
* @param cu the original compilation unit (or another working copy)
* @return the working copy of the compilation unit, or null if not found
* @param tu the original translation unit (or another working copy)
* @return the working copy of the translation unit, or null if not found
*/
public static ITranslationUnit getWorkingCopy(ITranslationUnit cu) {
if (cu == null)
public static ITranslationUnit getWorkingCopy(ITranslationUnit tu) {
if (tu == null)
return null;
if (cu.isWorkingCopy())
return cu;
if (tu.isWorkingCopy())
return tu;
return CDTUITools.getWorkingCopyManager().findSharedWorkingCopy(cu);
return CDTUITools.getWorkingCopyManager().findSharedWorkingCopy(tu);
}
/**