Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2008-02-24 23:18:56 +0000
committerSergey Prigogin2008-02-24 23:18:56 +0000
commita2f9f9a4eb3228f55953b53ab40fb90529f298a9 (patch)
treed408c49e6e56743c76a6d96a7c4cfb8137179844 /core/org.eclipse.cdt.core/parser
parentd3af11b1875c64b17225716ea3dc4a89cb66e5cb (diff)
downloadorg.eclipse.cdt-a2f9f9a4eb3228f55953b53ab40fb90529f298a9.tar.gz
org.eclipse.cdt-a2f9f9a4eb3228f55953b53ab40fb90529f298a9.tar.xz
org.eclipse.cdt-a2f9f9a4eb3228f55953b53ab40fb90529f298a9.zip
Use generics.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPSpecialization.java33
1 files changed, 17 insertions, 16 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPSpecialization.java
index 885f16c3cc2..9cac379aa6b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 QNX Software Systems and others.
+ * Copyright (c) 2008 QNX Software Systems 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
@@ -34,7 +34,6 @@ import org.eclipse.core.runtime.CoreException;
/**
* @author Bryan Wilkinson
- *
*/
abstract class PDOMCPPSpecialization extends PDOMCPPBinding implements
ICPPSpecialization, IPDOMOverloader {
@@ -100,7 +99,7 @@ abstract class PDOMCPPSpecialization extends PDOMCPPBinding implements
}
private static class NodeCollector implements IPDOMVisitor {
- private List nodes = new ArrayList();
+ private List<IPDOMNode> nodes = new ArrayList<IPDOMNode>();
public boolean visit(IPDOMNode node) throws CoreException {
nodes.add(node);
return false;
@@ -108,7 +107,7 @@ abstract class PDOMCPPSpecialization extends PDOMCPPBinding implements
public void leave(IPDOMNode node) throws CoreException {
}
public IPDOMNode[] getNodes() {
- return (IPDOMNode[])nodes.toArray(new IPDOMNode[nodes.size()]);
+ return nodes.toArray(new IPDOMNode[nodes.size()]);
}
}
@@ -159,11 +158,11 @@ abstract class PDOMCPPSpecialization extends PDOMCPPBinding implements
}
public boolean matchesArguments(IType[] arguments) {
- IType [] args = getArguments();
- if( args.length == arguments.length ){
+ IType[] args = getArguments();
+ if (args.length == arguments.length) {
int i = 0;
- for(; i < args.length; i++) {
- if( args[i] == null || !( args[i].isSameType( arguments[i] ) ) )
+ for (; i < args.length; i++) {
+ if (args[i] == null || !args[i].isSameType(arguments[i]))
break;
}
return i == args.length;
@@ -171,18 +170,20 @@ abstract class PDOMCPPSpecialization extends PDOMCPPBinding implements
return false;
}
- /*
+ /* (non-Javadoc)
* For debug purposes only
- * (non-Javadoc)
- * @see org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding#toString()
*/
+ @Override
public String toString() {
- StringBuffer result = new StringBuffer();
- result.append(getName()+" <"+ASTTypeUtil.getTypeListString(getArguments())+">"); //$NON-NLS-1$ //$NON-NLS-2$
+ StringBuilder result = new StringBuilder();
+ result.append(getName());
+ result.append(" <"); //$NON-NLS-1$
+ result.append(ASTTypeUtil.getTypeListString(getArguments()));
+ result.append("> "); //$NON-NLS-1$
try {
- result.append(" "+getConstantNameForValue(getLinkageImpl(), getNodeType())); //$NON-NLS-1$
- } catch(CoreException ce) {
- result.append(" "+getNodeType()); //$NON-NLS-1$
+ result.append(getConstantNameForValue(getLinkageImpl(), getNodeType()));
+ } catch (CoreException ce) {
+ result.append(getNodeType());
}
return result.toString();
}

Back to the top