1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2012-07-13 22:02:40 -07:00
parent e477f03d08
commit 45e67ddcf2
24 changed files with 88 additions and 94 deletions

View file

@ -15,10 +15,7 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IASTTypeId extends IASTNode {
/**
* Constant.
*/
public static final IASTTypeId[] EMPTY_TYPEID_ARRAY = new IASTTypeId[0];
public static final IASTTypeId[] EMPTY_TYPEID_ARRAY = {};
/**
* <code>DECL_SPECIFIER</code> represents the relationship between an <code>IASTTypeId</code>
@ -35,7 +32,7 @@ public interface IASTTypeId extends IASTNode {
"IASTTypeId.ABSTRACT_DECLARATOR - IASTDeclarator for IASTTypeId"); //$NON-NLS-1$
/**
* Get the decl specifier.
* Returns the decl specifier.
* @return <code>IASTDeclSpecifier</code>
*/
public IASTDeclSpecifier getDeclSpecifier();
@ -54,7 +51,7 @@ public interface IASTTypeId extends IASTNode {
public IASTDeclarator getAbstractDeclarator();
/**
* Set the abstract declarator.
* Sets the abstract declarator.
* @param abstractDeclarator <code>IASTDeclarator</code>
*/
public void setAbstractDeclarator(IASTDeclarator abstractDeclarator);

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* John Camelon (IBM Rational Software) - Initial API and implementation
* Markus Schorn (Wind River Systems)
* John Camelon (IBM Rational Software) - Initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast;
@ -16,9 +16,8 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IASTTypeIdExpression extends IASTExpression {
/**
* <code>op_sizeof</code> sizeof( typeId ) expression
* <code>op_sizeof</code> sizeof (typeId) expression
*/
public static final int op_sizeof = 0;

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Doug Schaefer (IBM) - Initial API and implementation
* Doug Schaefer (IBM) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast;
@ -17,7 +17,6 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IASTWhileStatement extends IASTStatement {
/**
* <code>CONDITIONEXPRESSION</code> represents the relationship between an <code>IASTWhileStatement</code> and
* it's nested <code>IASTExpression</code>.

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Tomasz Wesolowski - initial API and implementation
* Tomasz Wesolowski - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast;
@ -19,7 +19,6 @@ package org.eclipse.cdt.core.dom.ast;
* @since 5.3
*/
public interface ICPPASTCompletionContext extends IASTCompletionContext {
/**
* Returns bindings that start with the given name or prefix, only considering those that are valid for
* this context, including those in the requested set of namespaces.

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - Initial API and implementation
* IBM - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast;
@ -21,15 +21,16 @@ public interface ICompositeType extends IBinding, IType {
public static final int k_union = IASTCompositeTypeSpecifier.k_union;
/**
* Returns the type of the composite, {@link #k_struct}, {@link #k_union}, or
* {@link org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType#k_class}.
* Returns the type of the composite, {@link #k_struct}, {@link #k_union},
* or {@link org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType#k_class}.
*/
public int getKey();
/**
* Returns whether the type is anonymous or not. A type for which objects or
* pointers are declared is not considered an anonymous type.
* <pre> struct Outer {
* <pre>
* struct Outer {
* struct {int a;}; // anonymous
* struct {int b;} c; // not anonymous
* }

View file

@ -10,11 +10,10 @@
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
/**
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ICPPConstructor extends ICPPMethod {
public static final ICPPConstructor [] EMPTY_CONSTRUCTOR_ARRAY = new ICPPConstructor[0];
public static final ICPPConstructor[] EMPTY_CONSTRUCTOR_ARRAY = {};
}

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Bryan Wilkinson (QNX) - Initial API and implementation
* Markus Schorn (Wind River Systems)
* Bryan Wilkinson (QNX) - Initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
* Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
@ -21,7 +21,6 @@ import org.eclipse.cdt.core.dom.ast.IType;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ICPPEnumeration extends IEnumeration, ICPPBinding {
/**
* Returns whether this enumeration is scoped.
* An enumeration can only be scoped in C++.

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Doug Schaefer (IBM) - Initial API and implementation
* Doug Schaefer (IBM) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
@ -17,6 +17,5 @@ import org.eclipse.cdt.core.dom.ast.IField;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ICPPField extends IField, ICPPMember, ICPPVariable {
public static final ICPPField [] EMPTY_CPPFIELD_ARRAY = new ICPPField[0];
public static final ICPPField[] EMPTY_CPPFIELD_ARRAY = {};
}

View file

@ -1,13 +1,13 @@
/*******************************************************************************
* Copyright (c) 2005, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* Copyright (c) 2005, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andrew Niefer (IBM Corporation) - initial API and implementation
* Markus Schorn (Wind River Systems)
* Contributors:
* Andrew Niefer (IBM Corporation) - initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;

View file

@ -18,7 +18,6 @@ import org.eclipse.cdt.core.dom.ast.IScope;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ICPPFunctionScope extends ICPPScope {
/**
* Get the scope representing the function body. returns null if there is no
* function definition

View file

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2005, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* Copyright (c) 2005, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andrew Niefer (IBM) - Initial API and implementation
* Contributors:
* Andrew Niefer (IBM) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
@ -17,5 +17,4 @@ package org.eclipse.cdt.core.dom.ast.cpp;
* @noextend This interface is not intended to be extended by clients.
*/
public interface ICPPFunctionTemplate extends ICPPFunction, ICPPTemplateDefinition {
}

View file

@ -6,10 +6,10 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - Initial API and implementation
* Markus Schorn (Wind River Systems)
* Bryan Wilkinson (QNX)
* Andrew Ferguson (Symbian)
* IBM - Initial API and implementation
* Markus Schorn (Wind River Systems)
* Bryan Wilkinson (QNX)
* Andrew Ferguson (Symbian)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@ -91,7 +91,8 @@ public class AbstractCPPClassSpecializationScope implements ICPPClassSpecializat
return CPPSemantics.resolveAmbiguities(name, specs);
}
@Deprecated @Override
@Deprecated
@Override
final public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup,
IIndexFileSet fileSet) {
return getBindings(new ScopeLookupData(name, resolve, prefixLookup));

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
* Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - Initial API and implementation
* Markus Schorn - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - Initial API and implementation
* Markus Schorn - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@ -15,8 +15,8 @@ import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
import org.eclipse.cdt.internal.core.dom.parser.ASTAmbiguousCastVsFunctionCallExpression;
public class CPPASTAmbiguousCastVsFunctionCallExpression extends
ASTAmbiguousCastVsFunctionCallExpression implements ICPPASTExpression {
public class CPPASTAmbiguousCastVsFunctionCallExpression
extends ASTAmbiguousCastVsFunctionCallExpression implements ICPPASTExpression {
public CPPASTAmbiguousCastVsFunctionCallExpression(IASTCastExpression castExpr, IASTFunctionCallExpression funcCall) {
super(castExpr, funcCall);

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
* Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;

View file

@ -18,17 +18,15 @@ import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.internal.core.dom.parser.ASTAmbiguousNode;
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguousExpression;
public class CPPASTAmbiguousExpression extends ASTAmbiguousNode implements
IASTAmbiguousExpression, ICPPASTExpression {
private IASTExpression [] exp = new IASTExpression[2];
private int expPos=-1;
public class CPPASTAmbiguousExpression extends ASTAmbiguousNode
implements IASTAmbiguousExpression, ICPPASTExpression {
private IASTExpression[] exp = new IASTExpression[2];
private int expPos= -1;
public CPPASTAmbiguousExpression(IASTExpression... expressions) {
for(IASTExpression e : expressions)
addExpression(e);
}
@Override
public IASTExpression copy() {
@ -44,7 +42,7 @@ public class CPPASTAmbiguousExpression extends ASTAmbiguousNode implements
public void addExpression(IASTExpression e) {
assertNotFrozen();
if (e != null) {
exp = ArrayUtil.appendAt( IASTExpression.class, exp, ++expPos, e );
exp = ArrayUtil.appendAt(IASTExpression.class, exp, ++expPos, e);
e.setParent(this);
e.setPropertyInParent(SUBEXPRESSION);
}
@ -52,7 +50,7 @@ public class CPPASTAmbiguousExpression extends ASTAmbiguousNode implements
@Override
public IASTExpression[] getExpressions() {
exp = ArrayUtil.trimAt( IASTExpression.class, exp, expPos );
exp = ArrayUtil.trimAt(IASTExpression.class, exp, expPos);
return exp;
}

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - Initial API and implementation
* Markus Schorn - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@ -34,9 +34,8 @@ import org.eclipse.core.runtime.Assert;
* <br>
* template<typename... T> void function(T ...); // is T a parameter pack?
*/
public class CPPASTAmbiguousParameterDeclaration extends ASTAmbiguousNode implements
IASTAmbiguousParameterDeclaration, ICPPASTParameterDeclaration {
public class CPPASTAmbiguousParameterDeclaration extends ASTAmbiguousNode
implements IASTAmbiguousParameterDeclaration, ICPPASTParameterDeclaration {
private ICPPASTParameterDeclaration fParameterDecl;
public CPPASTAmbiguousParameterDeclaration(ICPPASTParameterDeclaration decl) {
@ -47,7 +46,6 @@ public class CPPASTAmbiguousParameterDeclaration extends ASTAmbiguousNode implem
public void addParameterDeclaration(IASTParameterDeclaration d) {
assert false;
}
@Override
protected final IASTNode doResolveAmbiguity(ASTVisitor resolver) {
@ -73,7 +71,7 @@ public class CPPASTAmbiguousParameterDeclaration extends ASTAmbiguousNode implem
final ASTNode asNode = (ASTNode) dtor;
if (ptrOps.length > 0) {
final ASTNode first = (ASTNode)ptrOps[0];
final ASTNode last = (ASTNode)ptrOps[ptrOps.length-1];
final ASTNode last = (ASTNode)ptrOps[ptrOps.length - 1];
asNode.setOffsetAndLength(first.getOffset(), last.getOffset() + last.getLength());
} else {
asNode.setOffsetAndLength(0, 0);
@ -82,7 +80,7 @@ public class CPPASTAmbiguousParameterDeclaration extends ASTAmbiguousNode implem
@Override
public IASTParameterDeclaration[] getParameterDeclarations() {
return new IASTParameterDeclaration[] {fParameterDecl};
return new IASTParameterDeclaration[] { fParameterDecl };
}
@Override

View file

@ -32,8 +32,9 @@ public class CPPASTAmbiguousStatement extends ASTAmbiguousNode implements IASTAm
private IASTDeclaration fDeclaration;
public CPPASTAmbiguousStatement(IASTStatement... statements) {
for (IASTStatement s : statements)
for (IASTStatement s : statements) {
addStatement(s);
}
}
@Override

View file

@ -6,9 +6,9 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andrew Ferguson (Symbian) - Initial Implementation
* Markus Schorn (Wind River Systems)
* IBM Corporation
* Andrew Ferguson (Symbian) - Initial Implementation
* Markus Schorn (Wind River Systems)
* IBM Corporation
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@ -33,11 +33,11 @@ import org.eclipse.core.runtime.Assert;
* Ambiguity node for deciding between type-id and id-expression in a template argument.
*/
public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements ICPPASTAmbiguousTemplateArgument {
private List<IASTNode> fNodes;
/**
* @param nodes nodes of type {@link IASTTypeId}, {@link IASTIdExpression} or {@link ICPPASTPackExpansionExpression}.
* @param nodes nodes of type {@link IASTTypeId}, {@link IASTIdExpression}
* or {@link ICPPASTPackExpansionExpression}.
*/
public CPPASTAmbiguousTemplateArgument(IASTNode... nodes) {
fNodes= new ArrayList<IASTNode>(2);
@ -56,7 +56,6 @@ public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements
}
}
}
@Override
protected void beforeAlternative(IASTNode node) {
@ -77,13 +76,11 @@ public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements
}
}
@Override
protected void afterResolution(ASTVisitor resolver, IASTNode best) {
beforeAlternative(best);
}
@Override
public IASTNode copy() {
return copy(CopyStyle.withoutLocations);
@ -91,15 +88,14 @@ public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements
@Override
public IASTNode copy(CopyStyle style) {
int sizeOfNodes = fNodes.size();
IASTNode[] copyNodes = new IASTNode[sizeOfNodes];
int arrayIndex = 0;
for(IASTNode node : fNodes) {
if(node!=null){
for (IASTNode node : fNodes) {
if (node != null){
copyNodes[arrayIndex] = node.copy(style);
}else{
copyNodes[arrayIndex]=null;
} else {
copyNodes[arrayIndex]= null;
}
arrayIndex++;
}

View file

@ -1,11 +1,11 @@
/*******************************************************************************
* Copyright (c) 2004, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* Copyright (c) 2004, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Contributors:
* Andrew Niefer (IBM Corporation) - initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/

View file

@ -16,7 +16,17 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.*;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.ALLCVQ;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.ARRAY;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.CVTYPE;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.MPTR;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.PTR;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.REF;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.TDEF;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.calculateInheritanceDepth;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getNestedType;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getUltimateTypeUptoPointers;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.isConversionOperator;
import java.util.ArrayList;
import java.util.Arrays;
@ -3261,7 +3271,7 @@ public class CPPSemantics {
if (tu != null && funcData.foundItems instanceof Object[]) {
final IIndexFileSet fileSet = tu.getIndexFileSet();
if (fileSet != null) {
int j=0;
int j= 0;
final Object[] items= (Object[]) funcData.foundItems;
for (int i = 0; i < items.length; i++) {
Object item = items[i];
@ -3292,7 +3302,7 @@ public class CPPSemantics {
items[j++]= func;
}
}
if (j>0) {
if (j > 0) {
while (j < items.length)
items[j++]= null;
}

View file

@ -17,7 +17,7 @@ import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
/**
* @author Thomas Corbat
*/
public class GenerateGettersAndSettersWizard extends RefactoringWizard {
public class GenerateGettersAndSettersWizard extends RefactoringWizard {
public GenerateGettersAndSettersWizard(
GenerateGettersAndSettersRefactoring refactoring) {
super(refactoring, DIALOG_BASED_USER_INTERFACE | PREVIEW_EXPAND_FIRST_NODE);