diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTTranslationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTTranslationUnit.java index 19409d9da36..d77e8da2e07 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTTranslationUnit.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTTranslationUnit.java @@ -413,7 +413,7 @@ public abstract class ASTTranslationUnit extends ASTNode implements IASTTranslat copy.setLocationResolver(fLocationResolver); copy.setIsForContentAssist(fForContentAssist); - for(IASTDeclaration declaration : getDeclarations()) + for (IASTDeclaration declaration : getDeclarations()) copy.addDeclaration(declaration == null ? null : declaration.copy()); copy.setOffsetAndLength(this); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/SelectionHelper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/SelectionHelper.java index 7c2b33d858d..7c40eab7144 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/SelectionHelper.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/SelectionHelper.java @@ -34,7 +34,6 @@ import org.eclipse.cdt.internal.ui.refactoring.Container; * Helper class to support operations concerning a selection. * * @author Mirko Stocker, Lukas Felber - * */ public class SelectionHelper { @@ -46,8 +45,8 @@ public class SelectionHelper { return null; } - public static IASTSimpleDeclaration findFirstSelectedDeclaration(final Region textSelection, IASTTranslationUnit translationUnit) { - + public static IASTSimpleDeclaration findFirstSelectedDeclaration(final Region textSelection, + IASTTranslationUnit translationUnit) { final Container container = new Container(); translationUnit.accept(new ASTVisitor() { @@ -90,21 +89,20 @@ public class SelectionHelper { } public static boolean isInSameFileSelection(Region textSelection, IASTNode node, IFile file) { - if( isInSameFile(node, file) ) { + if (isInSameFile(node, file)) { return SelectionHelper.isSelectionOnExpression(textSelection, node); } return false; } public static boolean isSelectedFile(Region textSelection, IASTNode node, IFile file) { - if( isInSameFile(node, file) ) { + if (isInSameFile(node, file)) { return isExpressionWhollyInSelection(textSelection, node); } return false; } protected static Region createExpressionPosition(IASTNode expression) { - int start = Integer.MAX_VALUE; int nodeLength = 0; IASTNodeLocation[] nodeLocations = expression.getNodeLocations(); @@ -113,14 +111,14 @@ public class SelectionHelper { if (location instanceof IASTMacroExpansionLocation) { IASTMacroExpansionLocation macroLoc = (IASTMacroExpansionLocation) location; int nodeOffset = macroLoc.asFileLocation().getNodeOffset(); - if(nodeOffset < start) { + if (nodeOffset < start) { start = nodeOffset; } nodeLength += macroLoc.asFileLocation().getNodeLength(); - }else { + } else { IASTFileLocation loc = expression.getFileLocation(); int nodeOffset = loc.getNodeOffset(); - if(nodeOffset < start) { + if (nodeOffset < start) { start = nodeOffset; } nodeLength = loc.getNodeLength();