mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Remove use of java.util.Lists from Physical tree interfaces.
This commit is contained in:
parent
301e1057eb
commit
ef16d14160
16 changed files with 44 additions and 68 deletions
|
@ -328,8 +328,8 @@ public class AST2Tests extends AST2BaseTest {
|
|||
IASTName nameA3 = compTypeSpec.getName();
|
||||
IASTDeclarator dtor = decl3.getDeclarators()[0];
|
||||
IASTName namea = dtor.getName();
|
||||
assertEquals( 1, dtor.getPointerOperators().size() );
|
||||
assertTrue( dtor.getPointerOperators().get(0) instanceof ICASTPointer );
|
||||
assertEquals( 1, dtor.getPointerOperators().length );
|
||||
assertTrue( dtor.getPointerOperators()[0] instanceof ICASTPointer );
|
||||
|
||||
//bindings
|
||||
ICompositeType str1 = (ICompositeType) nameA1.resolveBinding();
|
||||
|
@ -371,8 +371,8 @@ public class AST2Tests extends AST2BaseTest {
|
|||
IASTName nameA2 = compTypeSpec.getName();
|
||||
IASTDeclarator dtor = decl2.getDeclarators()[0];
|
||||
IASTName namea = dtor.getName();
|
||||
assertEquals( 1, dtor.getPointerOperators().size() );
|
||||
assertTrue( dtor.getPointerOperators().get(0) instanceof ICASTPointer );
|
||||
assertEquals( 1, dtor.getPointerOperators().length );
|
||||
assertTrue( dtor.getPointerOperators()[0] instanceof ICASTPointer );
|
||||
|
||||
//bindings
|
||||
ICompositeType str1 = (ICompositeType) nameA1.resolveBinding();
|
||||
|
@ -407,8 +407,8 @@ public class AST2Tests extends AST2BaseTest {
|
|||
IASTName name_A2 = elabTypeSpec.getName();
|
||||
IASTDeclarator dtor = decl.getDeclarators()[0];
|
||||
IASTName name_a = dtor.getName();
|
||||
assertEquals( 1, dtor.getPointerOperators().size() );
|
||||
assertTrue( dtor.getPointerOperators().get(0) instanceof ICASTPointer );
|
||||
assertEquals( 1, dtor.getPointerOperators().length );
|
||||
assertTrue( dtor.getPointerOperators()[0] instanceof ICASTPointer );
|
||||
|
||||
//struct A {
|
||||
decl = (IASTSimpleDeclaration) tu.getDeclarations()[2];
|
||||
|
@ -820,8 +820,8 @@ public class AST2Tests extends AST2BaseTest {
|
|||
assertNull( f.getName().toString() );
|
||||
assertNotNull( f.getNestedDeclarator() );
|
||||
assertEquals( f.getNestedDeclarator().getName().toString(), "pfi"); //$NON-NLS-1$
|
||||
assertTrue( f.getPointerOperators().isEmpty() );
|
||||
assertFalse( f.getNestedDeclarator().getPointerOperators().isEmpty() );
|
||||
assertTrue( f.getPointerOperators().length == 0 );
|
||||
assertFalse( f.getNestedDeclarator().getPointerOperators().length == 0 );
|
||||
tu = parse( "int (*pfi)();", ParserLanguage.CPP ); //$NON-NLS-1$
|
||||
assertEquals( tu.getDeclarations().length, 1 );
|
||||
d = (IASTSimpleDeclaration) tu.getDeclarations()[0];
|
||||
|
@ -845,7 +845,7 @@ public class AST2Tests extends AST2BaseTest {
|
|||
assertEquals( tu.getDeclarations().length, 2 );
|
||||
IASTSimpleDeclaration p2m = (IASTSimpleDeclaration) tu.getDeclarations()[1];
|
||||
IASTDeclarator d = p2m.getDeclarators()[0];
|
||||
ICPPASTPointerToMember po = (ICPPASTPointerToMember) d.getPointerOperators().get(0);
|
||||
ICPPASTPointerToMember po = (ICPPASTPointerToMember) d.getPointerOperators()[0];
|
||||
assertEquals( po.getName().toString(), "X::"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
**********************************************************************/
|
||||
package org.eclipse.cdt.core.dom.ast;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -22,7 +21,7 @@ public interface IASTArrayDeclarator extends IASTDeclarator {
|
|||
|
||||
public static final ASTNodeProperty ARRAY_MODIFIER = new ASTNodeProperty( "Array Modifier"); //$NON-NLS-1$
|
||||
|
||||
public List getArrayModifiers();
|
||||
public IASTArrayModifier[] getArrayModifiers();
|
||||
public void addArrayModifier( IASTArrayModifier arrayModifier );
|
||||
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ package org.eclipse.cdt.core.dom.ast;
|
|||
public interface IASTArrayModifier extends IASTNode {
|
||||
|
||||
public static final ASTNodeProperty CONSTANT_EXPRESSION = new ASTNodeProperty( "Constant Expression"); //$NON-NLS-1$
|
||||
public static final IASTArrayModifier[] EMPTY_ARRAY = new IASTArrayModifier[0];
|
||||
public IASTExpression getConstantExpression();
|
||||
public void setConstantExpression( IASTExpression expression );
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
**********************************************************************/
|
||||
package org.eclipse.cdt.core.dom.ast;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Doug Schaefer
|
||||
|
@ -29,7 +28,7 @@ public interface IASTDeclarator extends IASTNode {
|
|||
*
|
||||
* @return List of IASTPointerOperator
|
||||
*/
|
||||
public List getPointerOperators();
|
||||
public IASTPointerOperator[] getPointerOperators();
|
||||
|
||||
public void addPointerOperator( IASTPointerOperator operator );
|
||||
|
||||
|
|
|
@ -15,4 +15,6 @@ package org.eclipse.cdt.core.dom.ast;
|
|||
*/
|
||||
public interface IASTPointerOperator extends IASTNode {
|
||||
|
||||
public static final IASTPointerOperator[] EMPTY_ARRAY = new IASTPointerOperator[0];
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
**********************************************************************/
|
||||
package org.eclipse.cdt.core.dom.ast;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The translation unit represents a compilable unit of source.
|
||||
|
@ -44,7 +43,7 @@ public interface IASTTranslationUnit extends IASTNode {
|
|||
* @param binding
|
||||
* @return List of IASTName nodes for the binding's declaration
|
||||
*/
|
||||
public List getDeclarations(IBinding binding);
|
||||
public IASTDeclaration[] getDeclarations(IBinding binding);
|
||||
|
||||
/**
|
||||
* Returns the list of references in this translation unit to the given
|
||||
|
@ -54,7 +53,7 @@ public interface IASTTranslationUnit extends IASTNode {
|
|||
* @param binding
|
||||
* @return List of IASTName nodes representing uses of the binding
|
||||
*/
|
||||
public List getReferences(IBinding binding);
|
||||
public IASTName[] getReferences(IBinding binding);
|
||||
|
||||
public IASTNodeLocation getLocationInfo( int offset );
|
||||
public IASTNodeLocation [] getLocationInfo( int offset, int length );
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
**********************************************************************/
|
||||
package org.eclipse.cdt.core.dom.ast.cpp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||
|
||||
/**
|
||||
|
@ -27,8 +27,9 @@ public interface ICPPASTTemplateId extends IASTName {
|
|||
public void setTemplateName( IASTName name );
|
||||
|
||||
public static final ASTNodeProperty TEMPLATE_ID_ARGUMENT = new ASTNodeProperty( "TemplateId Arg"); //$NON-NLS-1$
|
||||
public static final IASTNode[] EMPTY_ARG_ARRAY = new IASTNode[0];
|
||||
public void addTemplateArgument( IASTTypeId typeId );
|
||||
public void addTemplateArgument( IASTExpression expression );
|
||||
public List getTemplateArguments();
|
||||
public IASTNode[] getTemplateArguments();
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
**********************************************************************/
|
||||
package org.eclipse.cdt.core.dom.ast.cpp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||
|
@ -23,7 +22,7 @@ public interface ICPPASTTemplatedTypeTemplateParameter extends
|
|||
ICPPASTTemplateParameter {
|
||||
|
||||
public static final ASTNodeProperty PARAMETER = new ASTNodeProperty( "Template Parameter"); //$NON-NLS-1$
|
||||
public List getTemplateParameters();
|
||||
public ICPPASTTemplateParameter[] getTemplateParameters();
|
||||
public void addTemplateParamter( ICPPASTTemplateParameter parm );
|
||||
|
||||
public static final ASTNodeProperty PARAMETER_NAME = new ASTNodeProperty( "Name" ); //$NON-NLS-1$
|
||||
|
|
|
@ -9,10 +9,6 @@
|
|||
* IBM Rational Software - Initial API and implementation */
|
||||
package org.eclipse.cdt.internal.core.parser2.c;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
||||
|
||||
|
@ -42,10 +38,10 @@ public class CASTArrayDeclarator extends CASTDeclarator implements
|
|||
private static final int DEFAULT_ARRAYMODS_LIST_SIZE = 4;
|
||||
|
||||
|
||||
public List getArrayModifiers() {
|
||||
if( arrayMods == null ) return Collections.EMPTY_LIST;
|
||||
public IASTArrayModifier[] getArrayModifiers() {
|
||||
if( arrayMods == null ) return IASTArrayModifier.EMPTY_ARRAY;
|
||||
removeNullArrayModifiers();
|
||||
return Arrays.asList( arrayMods );
|
||||
return arrayMods;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -9,10 +9,6 @@
|
|||
* IBM Rational Software - Initial API and implementation */
|
||||
package org.eclipse.cdt.internal.core.parser2.c;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
|
@ -48,10 +44,10 @@ public class CASTDeclarator extends CASTNode implements IASTDeclarator {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTDeclarator#getPointerOperators()
|
||||
*/
|
||||
public List getPointerOperators() {
|
||||
if( pointerOps == null ) return Collections.EMPTY_LIST;
|
||||
public IASTPointerOperator[] getPointerOperators() {
|
||||
if( pointerOps == null ) return IASTPointerOperator.EMPTY_ARRAY;
|
||||
removeNullPointers();
|
||||
return Arrays.asList( pointerOps );
|
||||
return pointerOps;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
* IBM Rational Software - Initial API and implementation */
|
||||
package org.eclipse.cdt.internal.core.parser2.c;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNodeLocation;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||
|
@ -87,7 +87,7 @@ public class CASTTranslationUnit extends CASTNode implements IASTTranslationUnit
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getDeclarations(org.eclipse.cdt.core.dom.ast.IBinding)
|
||||
*/
|
||||
public List getDeclarations(IBinding binding) {
|
||||
public IASTDeclaration[] getDeclarations(IBinding binding) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ public class CASTTranslationUnit extends CASTNode implements IASTTranslationUnit
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getReferences(org.eclipse.cdt.core.dom.ast.IBinding)
|
||||
*/
|
||||
public List getReferences(IBinding binding) {
|
||||
public IASTName[] getReferences(IBinding binding) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
**********************************************************************/
|
||||
package org.eclipse.cdt.internal.core.parser2.cpp;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
||||
|
||||
|
@ -43,10 +39,10 @@ public class CPPASTArrayDeclarator extends CPPASTDeclarator implements
|
|||
private static final int DEFAULT_ARRAYMODS_LIST_SIZE = 4;
|
||||
|
||||
|
||||
public List getArrayModifiers() {
|
||||
if( arrayMods == null ) return Collections.EMPTY_LIST;
|
||||
public IASTArrayModifier[] getArrayModifiers() {
|
||||
if( arrayMods == null ) return IASTArrayModifier.EMPTY_ARRAY;
|
||||
removeNullArrayModifiers();
|
||||
return Arrays.asList( arrayMods );
|
||||
return arrayMods;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
**********************************************************************/
|
||||
package org.eclipse.cdt.internal.core.parser2.cpp;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
|
@ -48,10 +44,10 @@ public class CPPASTDeclarator extends CPPASTNode implements IASTDeclarator {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTDeclarator#getPointerOperators()
|
||||
*/
|
||||
public List getPointerOperators() {
|
||||
if( pointerOps == null ) return Collections.EMPTY_LIST;
|
||||
public IASTPointerOperator[] getPointerOperators() {
|
||||
if( pointerOps == null ) return IASTPointerOperator.EMPTY_ARRAY;
|
||||
removeNullPointers();
|
||||
return Arrays.asList( pointerOps );
|
||||
return pointerOps;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
**********************************************************************/
|
||||
package org.eclipse.cdt.internal.core.parser2.cpp;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
|
@ -83,10 +79,10 @@ public class CPPASTTemplateId extends CPPASTNode implements ICPPASTTemplateId {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateId#getTemplateArguments()
|
||||
*/
|
||||
public List getTemplateArguments() {
|
||||
if( templateArguments == null ) return Collections.EMPTY_LIST;
|
||||
public IASTNode[] getTemplateArguments() {
|
||||
if( templateArguments == null ) return ICPPASTTemplateId.EMPTY_ARG_ARRAY;
|
||||
removeNullArguments();
|
||||
return Arrays.asList( templateArguments );
|
||||
return templateArguments;
|
||||
}
|
||||
|
||||
private void removeNullArguments() {
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
**********************************************************************/
|
||||
package org.eclipse.cdt.internal.core.parser2.cpp;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateParameter;
|
||||
|
@ -25,10 +21,10 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplatedTypeTemplateParameter;
|
|||
public class CPPASTTemplatedTypeTemplateParameter extends CPPASTNode implements
|
||||
ICPPASTTemplatedTypeTemplateParameter {
|
||||
|
||||
public List getTemplateParameters() {
|
||||
if( parameters == null ) return Collections.EMPTY_LIST;
|
||||
public ICPPASTTemplateParameter[] getTemplateParameters() {
|
||||
if( parameters == null ) return ICPPASTTemplateParameter.EMPTY_TEMPLATEPARAMETER_ARRAY;
|
||||
removeNullParameters();
|
||||
return Arrays.asList( parameters );
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public void addTemplateParamter(ICPPASTTemplateParameter parm) {
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
**********************************************************************/
|
||||
package org.eclipse.cdt.internal.core.parser2.cpp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNodeLocation;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||
|
@ -86,7 +86,7 @@ public class CPPASTTranslationUnit extends CPPASTNode implements
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getDeclarations(org.eclipse.cdt.core.dom.ast.IBinding)
|
||||
*/
|
||||
public List getDeclarations(IBinding binding) {
|
||||
public IASTDeclaration[] getDeclarations(IBinding binding) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class CPPASTTranslationUnit extends CPPASTNode implements
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getReferences(org.eclipse.cdt.core.dom.ast.IBinding)
|
||||
*/
|
||||
public List getReferences(IBinding binding) {
|
||||
public IASTName[] getReferences(IBinding binding) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue