diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java index f584a0cc67f..e22f981751e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java @@ -156,12 +156,10 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt } } - public IASTNode[] getDeclarations() { return declarations; } - public IASTNode getDefinition() { return definition; } @@ -194,7 +192,7 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt } } } - + private ICPPASTFunctionDeclarator extractFunctionDtor(IASTNode node) { if (node instanceof IASTName) node = node.getParent(); @@ -211,7 +209,7 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt IASTStandardFunctionDeclarator dtor = getPreferredDtor(); IASTParameterDeclaration[] params = dtor.getParameters(); int size = params.length; - IParameter[] result = new IParameter[ size ]; + IParameter[] result = new IParameter[size]; if (size > 0) { for (int i = 0; i < size; i++) { IASTParameterDeclaration p = params[i]; @@ -229,7 +227,6 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt return result; } - public IScope getFunctionScope() { resolveAllDeclarations(); if (definition != null) { @@ -239,12 +236,10 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt return declarations[0].getFunctionScope(); } - public String getName() { return getASTName().toString(); } - public char[] getNameCharArray() { return getASTName().getSimpleID(); } @@ -255,7 +250,7 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt IASTName name= dtor.getName(); if (name instanceof ICPPASTQualifiedName) { IASTName[] ns = ((ICPPASTQualifiedName)name).getNames(); - name = ns[ ns.length - 1 ]; + name = ns[ns.length - 1]; } return name; } @@ -286,7 +281,6 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt return scope; } - public ICPPFunctionType getType() { if (type == null) type = (ICPPFunctionType) CPPVisitor.createType((definition != null) ? definition : declarations[0]); @@ -358,7 +352,6 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt } } - public boolean isStatic() { return isStatic(true); } @@ -401,17 +394,14 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt // return false; // } - public String[] getQualifiedName() { return CPPVisitor.getQualifiedName(this); } - public char[][] getQualifiedNameCharArray() { return CPPVisitor.getQualifiedNameCharArray(this); } - public boolean isGloballyQualified() throws DOMException { IScope scope = getScope(); while (scope != null) { @@ -543,7 +533,7 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt return IType.EMPTY_TYPE_ARRAY; IType[] typeIds = new IType[astTypeIds.length]; - for (int i=0; i 0) { LookupData data= new LookupData(); - data.setFunctionArgumentTypes(new IType [] { source }); + data.setFunctionArgumentTypes(new IType[] { source }); IBinding binding = CPPSemantics.resolveFunction(data, convertingCtors, false); if (binding instanceof ICPPConstructor && !(binding instanceof IProblemBinding)) { constructorCost = checkStandardConversionSequence(t, target, false); if (constructorCost.getRank() == Rank.NO_MATCH) { constructorCost= null; } else { - constructorCost.setUserDefinedConversion((ICPPConstructor)binding); + constructorCost.setUserDefinedConversion((ICPPConstructor) binding); } } } } - //conversion operators + // Conversion operators boolean ambiguousConversionOperator= false; if (s instanceof ICPPClassType) { - ICPPMethod [] ops = SemanticUtil.getConversionOperators((ICPPClassType) s); + ICPPMethod[] ops = SemanticUtil.getConversionOperators((ICPPClassType) s); if (ops.length > 0 && !(ops[0] instanceof IProblemBinding)) { for (final ICPPMethod op : ops) { Cost cost= checkStandardConversionSequence(op.getType().getReturnType(), target, false); @@ -455,7 +456,6 @@ public class Conversions { boolean isConverted= false; IType target = getNestedType(cost.target, REF | TDEF); IType source= getNestedType(cost.source, TDEF); - // 4.1 lvalue to rvalue IType srcRValue= getNestedType(source, REF | TDEF); @@ -524,7 +524,7 @@ public class Conversions { } } - // this should actually be done in 'checkImplicitConversionSequence', see 13.3.3.1-6 and 8.5.14 + // This should actually be done in 'checkImplicitConversionSequence', see 13.3.3.1-6 and 8.5.14 // 8.5.14 cv-qualifiers can be ignored for non-class types IType unqualifiedTarget= getNestedType(target, CVQ | PTR_CVQ | TDEF | REF); if (!(unqualifiedTarget instanceof ICPPClassType)) { @@ -788,8 +788,8 @@ public class Conversions { if (type instanceof IIndexFragmentBinding) { try { return ((IIndexFragmentBinding) type).hasDefinition(); - } catch(CoreException ce) { - CCorePlugin.log(ce); + } catch (CoreException e) { + CCorePlugin.log(e); } } try { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/FunctionCost.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/FunctionCost.java index 85ef69e1c57..3543424cbc0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/FunctionCost.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/FunctionCost.java @@ -87,9 +87,9 @@ class FunctionCost { // In order for this function to be better than the previous best, it must // have at least one parameter match that is better that the corresponding // match for the other function, and none that are worse. - int idx= getLength()-1; - int idxOther= other.getLength()-1; - for (; idx>=0 && idxOther>=0; idx--,idxOther--) { + int idx= getLength() - 1; + int idxOther= other.getLength() - 1; + for (; idx >= 0 && idxOther >= 0; idx--, idxOther--) { Cost cost= getCost(idx); if (cost.getRank() == Rank.NO_MATCH) { haveWorse = true; @@ -140,9 +140,9 @@ class FunctionCost { return false; boolean haveWorse= false; - int idx= getLength()-1; - int idxOther= other.getLength()-1; - for (; idx>=0 && idxOther>=0; idx--,idxOther--) { + int idx= getLength() - 1; + int idxOther= other.getLength() - 1; + for (; idx >= 0 && idxOther >= 0; idx--, idxOther--) { Cost cost= getCost(idx); if (cost.getRank() == Rank.NO_MATCH) return true;