diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GetterAndSetterContext.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GetterAndSetterContext.java index 415f028eec3..780c6a3b746 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GetterAndSetterContext.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/GetterAndSetterContext.java @@ -26,7 +26,7 @@ import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration; import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GetterSetterInsertEditProvider.Type; import org.eclipse.cdt.internal.ui.refactoring.utils.NameHelper; -public class GetterAndSetterContext implements ITreeContentProvider{ +public class GetterAndSetterContext implements ITreeContentProvider { public ArrayList existingFields = new ArrayList(); public ArrayList existingFunctionDefinitions = new ArrayList(); public ArrayList existingFunctionDeclarations = new ArrayList(); @@ -41,10 +41,10 @@ public class GetterAndSetterContext implements ITreeContentProvider{ FieldWrapper wrapper = (FieldWrapper) parentElement; if (wrapper.getChildNodes().isEmpty()) { - if (!wrapper.getter.exists()){ + if (!wrapper.getter.exists()) { wrapper.childNodes.add(createGetterInserter(wrapper.field)); } - if (!wrapper.setter.exists() && !wrapper.field.getDeclSpecifier().isConst()){ + if (!wrapper.setter.exists() && !wrapper.field.getDeclSpecifier().isConst()) { wrapper.childNodes.add(createSetterInserter(wrapper.field)); } } @@ -96,12 +96,12 @@ public class GetterAndSetterContext implements ITreeContentProvider{ private ArrayList getWrappedFields() { if (wrappedFields == null) { wrappedFields = new ArrayList(); - for (IASTSimpleDeclaration currentField : existingFields){ + for (IASTSimpleDeclaration currentField : existingFields) { FieldWrapper wrapper = new FieldWrapper(); wrapper.field = currentField; wrapper.getter = getGetterForField(currentField); wrapper.setter = getSetterForField(currentField); - if (wrapper.missingGetterOrSetter()){ + if (wrapper.missingGetterOrSetter()) { wrappedFields.add(wrapper); } } @@ -136,28 +136,27 @@ public class GetterAndSetterContext implements ITreeContentProvider{ } private void setFunctionToWrapper(FunctionWrapper wrapper, String getterName) { - for (IASTFunctionDefinition currentDefinition : existingFunctionDefinitions){ - if (currentDefinition.getDeclarator().getName().toString().endsWith(getterName)){ + for (IASTFunctionDefinition currentDefinition : existingFunctionDefinitions) { + if (currentDefinition.getDeclarator().getName().toString().endsWith(getterName)) { wrapper.functionDefinition = currentDefinition; } } - for (IASTSimpleDeclaration currentDeclaration : existingFunctionDeclarations){ - if (getFieldDeclarationName(currentDeclaration).toString().endsWith(getterName)){ + for (IASTSimpleDeclaration currentDeclaration : existingFunctionDeclarations) { + if (getFieldDeclarationName(currentDeclaration).toString().endsWith(getterName)) { wrapper.functionDeclaration = currentDeclaration; } } } - - protected class FieldWrapper{ + protected class FieldWrapper { protected IASTSimpleDeclaration field; protected FunctionWrapper getter; protected FunctionWrapper setter; protected ArrayList childNodes = new ArrayList(2); @Override - public String toString(){ + public String toString() { IASTDeclarator declarator = field.getDeclarators()[0]; while (declarator.getNestedDeclarator() != null) { declarator = declarator.getNestedDeclarator(); @@ -174,7 +173,7 @@ public class GetterAndSetterContext implements ITreeContentProvider{ } } - protected class FunctionWrapper{ + protected class FunctionWrapper { protected IASTSimpleDeclaration functionDeclaration; protected IASTFunctionDefinition functionDefinition;