diff options
author | Jonah Graham | 2018-11-20 16:20:42 +0000 |
---|---|---|
committer | Jonah Graham | 2018-11-22 21:47:02 +0000 |
commit | 170e654b4796bad1453ae85a427b97317d67a69a (patch) | |
tree | 6ca9b8a8fedd5fd25f97eb79c408312e256ff981 /core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ExpressionFinder.java | |
parent | 35996a5c5ca5c254959ba48241eaada6dbf8628d (diff) | |
download | org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.gz org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.xz org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.zip |
Bug 540373: Cleanup: Format & Remove trailing whitespace
This was done by selecting all projects in Eclipse then
Source -> Clean Up... -> choosing:
- Format source code
- Remove trailing white spaces on all lines
and completing the wizard
Change-Id: I63685372c6bcc67719bcf145123bcb72e5b00394
Diffstat (limited to 'core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ExpressionFinder.java')
-rw-r--r-- | core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ExpressionFinder.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ExpressionFinder.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ExpressionFinder.java index fa884ec603f..f9981aee3c7 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ExpressionFinder.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ExpressionFinder.java @@ -1,16 +1,16 @@ /******************************************************************************* - * Copyright (c) 2008, 2010 Institute for Software, HSR Hochschule fuer Technik + * Copyright (c) 2008, 2010 Institute for Software, HSR Hochschule fuer Technik * Rapperswil, University of applied sciences and others * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Institute for Software - initial API and implementation + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Institute for Software - initial API and implementation ******************************************************************************/ package org.eclipse.cdt.internal.ui.refactoring.utils; @@ -27,8 +27,8 @@ import org.eclipse.cdt.internal.ui.refactoring.Container; /** * @author Guido Zgraggen IFS */ -public class ExpressionFinder { - +public class ExpressionFinder { + public static IASTName findExpressionInTranslationUnit(IASTTranslationUnit transUnit, final IIndexName indexName) { final Container<IASTName> expName = new Container<IASTName>(); transUnit.accept(new ASTVisitor() { @@ -40,9 +40,10 @@ public class ExpressionFinder { public int visit(IASTName name) { if (name.isReference() && name.getNodeLocations().length > 0) { IASTNodeLocation nodeLocation = name.getNodeLocations()[0]; - if (indexName.getNodeOffset() == nodeLocation.getNodeOffset() + if (indexName.getNodeOffset() == nodeLocation.getNodeOffset() && indexName.getNodeLength() == nodeLocation.getNodeLength() - && new Path(indexName.getFileLocation().getFileName()).equals(new Path(nodeLocation.asFileLocation().getFileName()))) { + && new Path(indexName.getFileLocation().getFileName()) + .equals(new Path(nodeLocation.asFileLocation().getFileName()))) { expName.setObject(name); return ASTVisitor.PROCESS_ABORT; } |