Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSergey Prigogin2012-01-09 05:01:52 +0000
committerSergey Prigogin2012-01-09 05:07:49 +0000
commitea56585a4ca79dcb41e7efa0c986744be3257765 (patch)
treeb478c22862e30dd6cfa2eedc4db4793702a08c20 /core
parenta98cf9a89dd9ee378dfe2a716450774b245816af (diff)
downloadorg.eclipse.cdt-ea56585a4ca79dcb41e7efa0c986744be3257765.tar.gz
org.eclipse.cdt-ea56585a4ca79dcb41e7efa0c986744be3257765.tar.xz
org.eclipse.cdt-ea56585a4ca79dcb41e7efa0c986744be3257765.zip
Tightened up type constraints in ArrayUtil.
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLabelStatement.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTStatement.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IBinding.java3
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IField.java3
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ILabel.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java102
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTTranslationUnit.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CCompositeTypeScope.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunctionScope.java40
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructure.java10
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java16
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java16
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java29
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java23
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplate.java12
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java4
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPopulateASTViewAction.java4
22 files changed, 166 insertions, 132 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLabelStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLabelStatement.java
index e856f4c5de6..d0da8fea66a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLabelStatement.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLabelStatement.java
@@ -17,6 +17,8 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IASTLabelStatement extends IASTStatement, IASTNameOwner {
+ /** @since 5.4 */
+ public static final IASTStatement[] EMPTY_LABEL_STATEMENT_ARRAY = {};
public static final ASTNodeProperty NAME = new ASTNodeProperty("IASTLabelStatement.NAME - name for IASTLabelStatement"); //$NON-NLS-1$
public static final ASTNodeProperty NESTED_STATEMENT = new ASTNodeProperty( "IASTLabelStatement.NESTED_STATEMENT - statement for IASTLabelStatement" ); //$NON-NLS-1$
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTStatement.java
index eab95eb8392..e1ed40c0af9 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTStatement.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTStatement.java
@@ -20,7 +20,7 @@ public interface IASTStatement extends IASTNode {
/**
* Constant.
*/
- public static final IASTStatement[] EMPTY_STATEMENT_ARRAY = new IASTStatement[0];
+ public static final IASTStatement[] EMPTY_STATEMENT_ARRAY = {};
/**
* @since 5.1
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IBinding.java
index 2477df5a19d..6f32a398fbb 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IBinding.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IBinding.java
@@ -26,7 +26,8 @@ import org.eclipse.core.runtime.IAdaptable;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IBinding extends IAdaptable {
- public static final IBinding[] EMPTY_BINDING_ARRAY = new IBinding[0];
+ public static final IBinding[] EMPTY_BINDING_ARRAY = {};
+
/**
* Returns the unqualified name of the binding as a string.
*/
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IField.java
index 38e269ebeb3..57f36f9961b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IField.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IField.java
@@ -16,8 +16,7 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IField extends IVariable {
-
- public static final IField[] EMPTY_FIELD_ARRAY = new IField[0];
+ public static final IField[] EMPTY_FIELD_ARRAY = {};
/**
* Returns the composite type that owns the field.
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ILabel.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ILabel.java
index 6c963b85cec..8982f9b3c1b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ILabel.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ILabel.java
@@ -18,7 +18,10 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ILabel extends IBinding {
- /**
+ /** @since 5.4 */
+ public static final IBinding[] EMPTY_LABEL_ARRAY = {};
+
+ /**
* Returns the label statement for this label.
*/
public IASTLabelStatement getLabelStatement();
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java
index 5bd2d9863ba..6f981587f47 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java
@@ -15,6 +15,7 @@
package org.eclipse.cdt.core.parser.util;
import java.lang.reflect.Array;
+import java.util.Arrays;
import org.eclipse.core.runtime.Assert;
@@ -31,7 +32,7 @@ public abstract class ArrayUtil {
* the given class object.
*/
@SuppressWarnings("unchecked")
- static public <T> T[] append(Class<? extends T> c, T[] array, T obj) {
+ static public <T> T[] append(Class<T> c, T[] array, T obj) {
if (obj == null)
return array;
if (array == null || array.length == 0) {
@@ -53,26 +54,6 @@ public abstract class ArrayUtil {
}
/**
- * Assumes that array contains nulls at the end, only.
- * @returns index of first null, or -1
- */
- private static int findFirstNull(Object[] array) {
- boolean haveNull= false;
- int left= 0;
- int right= array.length - 1;
- while (left <= right) {
- int mid= (left + right) / 2;
- if (array[mid] == null) {
- haveNull= true;
- right= mid - 1;
- } else {
- left= mid + 1;
- }
- }
- return haveNull ? right + 1 : -1;
- }
-
- /**
* Assumes that array contains nulls at the end, only.
* Appends element after the last non-null element.
* If the array is not large enough, a larger one is allocated.
@@ -104,6 +85,26 @@ public abstract class ArrayUtil {
}
/**
+ * Assumes that array contains nulls at the end, only.
+ * @returns index of first null, or -1
+ */
+ private static int findFirstNull(Object[] array) {
+ boolean haveNull= false;
+ int left= 0;
+ int right= array.length - 1;
+ while (left <= right) {
+ int mid= (left + right) / 2;
+ if (array[mid] == null) {
+ haveNull= true;
+ right= mid - 1;
+ } else {
+ left= mid + 1;
+ }
+ }
+ return haveNull ? right + 1 : -1;
+ }
+
+ /**
* @deprecated Use {@link #appendAt(Class, Object[], int, Object)} instead.
* @since 4.0
*/
@@ -154,7 +155,7 @@ public abstract class ArrayUtil {
* @param forceNew
*/
@SuppressWarnings("unchecked")
- static public <T> T[] trim(Class<? extends T> c, T[] array, boolean forceNew) {
+ static public <T> T[] trim(Class<T> c, T[] array, boolean forceNew) {
if (array == null)
return (T[]) Array.newInstance(c, 0);
@@ -173,7 +174,7 @@ public abstract class ArrayUtil {
return temp;
}
- public static <T> T[] trim(Class<? extends T> c, T[] array) {
+ public static <T> T[] trim(Class<T> c, T[] array) {
return trim(c, array, false);
}
@@ -188,7 +189,6 @@ public abstract class ArrayUtil {
* @param forceNew
* @since 5.2
*/
- @SuppressWarnings("unchecked")
static public <T> T[] trim(T[] array, boolean forceNew) {
int i = array.length;
if (i == 0 || array[i - 1] != null) {
@@ -200,9 +200,7 @@ public abstract class ArrayUtil {
Assert.isTrue(i >= 0);
}
- T[] temp = (T[]) Array.newInstance(array.getClass().getComponentType(), i);
- System.arraycopy(array, 0, temp, 0, i);
- return temp;
+ return Arrays.copyOf(array, i);
}
/**
@@ -227,7 +225,7 @@ public abstract class ArrayUtil {
* @return The concatenated array, which may be the same as the first parameter.
*/
@SuppressWarnings("unchecked")
- public static <T> T[] addAll(Class<? extends T> c, T[] dest, T[] source) {
+ public static <T> T[] addAll(Class<T> c, T[] dest, Object[] source) {
if (source == null || source.length == 0)
return dest;
@@ -254,10 +252,9 @@ public abstract class ArrayUtil {
System.arraycopy(source, 0, dest, firstFree, numToAdd);
return dest;
}
- T[] temp = (T[]) Array.newInstance(c, firstFree + numToAdd);
- System.arraycopy(dest, 0, temp, 0, firstFree);
- System.arraycopy(source, 0, temp, firstFree, numToAdd);
- return temp;
+ dest = Arrays.copyOf(dest, firstFree + numToAdd);
+ System.arraycopy(source, 0, dest, firstFree, numToAdd);
+ return dest;
}
/**
@@ -270,7 +267,7 @@ public abstract class ArrayUtil {
* @since 5.2
*/
@SuppressWarnings("unchecked")
- public static <T> T[] addAll(T[] dest, T[] source) {
+ public static <T> T[] addAll(T[] dest, Object[] source) {
if (source == null || source.length == 0)
return dest;
@@ -299,10 +296,9 @@ public abstract class ArrayUtil {
System.arraycopy(source, 0, dest, firstFree, numToAdd);
return dest;
}
- T[] temp = (T[]) Array.newInstance(dest.getClass().getComponentType(), firstFree + numToAdd);
- System.arraycopy(dest, 0, temp, 0, firstFree);
- System.arraycopy(source, 0, temp, firstFree, numToAdd);
- return temp;
+ dest = Arrays.copyOf(dest, firstFree + numToAdd);
+ System.arraycopy(source, 0, dest, firstFree, numToAdd);
+ return dest;
}
/**
@@ -379,7 +375,7 @@ public abstract class ArrayUtil {
* If there are no nulls in the original array then the original array is returned.
*/
@SuppressWarnings("unchecked")
- public static <T> T[] removeNulls(Class<? extends T> c, T[] array) {
+ public static <T> T[] removeNulls(Class<T> c, T[] array) {
if (array == null)
return (T[]) Array.newInstance(c, 0);
@@ -469,7 +465,7 @@ public abstract class ArrayUtil {
* Assumes that array contains nulls at the end, only.
*/
@SuppressWarnings("unchecked")
- public static <T> T[] prepend(Class<? extends T> c, T[] array, T obj) {
+ public static <T> T[] prepend(Class<T> c, T[] array, T obj) {
if (obj == null)
return array;
if (array == null || array.length == 0) {
@@ -569,8 +565,8 @@ public abstract class ArrayUtil {
* runtime type.
* @param target the runtime type of the new array
* @param source the source array
- * @return the current array stored in a new array with the
- * specified runtime type, or null if source is null.
+ * @return the current array stored in a new array with the specified runtime type,
+ * or null if source is null.
*/
@SuppressWarnings("unchecked")
public static <S, T> T[] convert(Class<T> target, S[] source) {
@@ -585,6 +581,30 @@ public abstract class ArrayUtil {
}
/**
+ * Reverses order of elements in an array.
+ * @param array the array
+ * @since 5.4
+ */
+ public static void reverse(Object[] array) {
+ reverse(array, 0, array.length);
+ }
+
+ /**
+ * Reverses order of elements in a subsection of an array.
+ * @param array the array
+ * @param fromIndex the index of the first affected element (inclusive)
+ * @param toIndex the index of the last affected element (exclusive)
+ * @since 5.4
+ */
+ public static void reverse(Object[] array, int fromIndex, int toIndex) {
+ for (int i = fromIndex, j = toIndex; i < --j; i++) {
+ Object tmp = array[i];
+ array[i] = array[j];
+ array[j] = tmp;
+ }
+ }
+
+ /**
* Returns a new array that contains all of the elements of the
* given array except the first one.
*
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTTranslationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTTranslationUnit.java
index 0fb8c3ae9f2..491f570695f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTTranslationUnit.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTTranslationUnit.java
@@ -13,7 +13,6 @@
package org.eclipse.cdt.internal.core.dom.parser.c;
import org.eclipse.cdt.core.dom.ILinkage;
-import org.eclipse.cdt.core.dom.IName;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
@@ -80,13 +79,13 @@ public class CASTTranslationUnit extends ASTTranslationUnit implements IASTAmbig
if (binding instanceof IMacroBinding) {
return getMacroDefinitionsInAST((IMacroBinding) binding);
}
- IName[] names = CVisitor.getDeclarations(this, binding);
+ IASTName[] names = CVisitor.getDeclarations(this, binding);
for (int i = 0; i < names.length; i++) {
if (!names[i].isDefinition())
names[i] = null;
}
// nulls can be anywhere, don't use trim()
- return (IASTName[])ArrayUtil.removeNulls(IASTName.class, names);
+ return ArrayUtil.removeNulls(IASTName.class, names);
}
/*
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CCompositeTypeScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CCompositeTypeScope.java
index 5a80e30e0a7..f5537c5268f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CCompositeTypeScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CCompositeTypeScope.java
@@ -95,10 +95,10 @@ public class CCompositeTypeScope extends CScope implements ICCompositeTypeScope
}
// anonymous structures and unions
if (declarators.length == 0 && ((IASTSimpleDeclaration) node).getDeclSpecifier() instanceof IASTCompositeTypeSpecifier) {
- IASTCompositeTypeSpecifier declSpec = (IASTCompositeTypeSpecifier) ((IASTSimpleDeclaration) node).getDeclSpecifier();
+ ICASTCompositeTypeSpecifier declSpec = (ICASTCompositeTypeSpecifier) ((IASTSimpleDeclaration) node).getDeclSpecifier();
IASTName n = declSpec.getName();
if (n.toCharArray().length == 0) {
- specStack = (ICASTCompositeTypeSpecifier[]) ArrayUtil.append(ICASTCompositeTypeSpecifier.class, specStack, declSpec);
+ specStack = ArrayUtil.append(ICASTCompositeTypeSpecifier.class, specStack, declSpec);
}
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunctionScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunctionScope.java
index 802a92f1c92..959698cfc37 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunctionScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunctionScope.java
@@ -24,57 +24,57 @@ import org.eclipse.cdt.core.dom.ast.c.ICFunctionScope;
import org.eclipse.cdt.core.parser.util.ArrayUtil;
public class CFunctionScope extends CScope implements ICFunctionScope {
- public CFunctionScope( IASTFunctionDefinition function ){
- super( function, EScopeKind.eLocal);
+ public CFunctionScope(IASTFunctionDefinition function) {
+ super(function, EScopeKind.eLocal);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.c.ICFunctionScope#getBinding(char[])
*/
@Override
- public IBinding getBinding( char[] name ) {
- return super.getBinding( NAMESPACE_TYPE_OTHER, name );
+ public IBinding getBinding(char[] name) {
+ return super.getBinding(NAMESPACE_TYPE_OTHER, name);
}
@Override
- public IScope getBodyScope(){
+ public IScope getBodyScope() {
IASTNode node = getPhysicalNode();
IASTStatement statement = ((IASTFunctionDefinition)node).getBody();
- if( statement instanceof IASTCompoundStatement ){
- return ((IASTCompoundStatement)statement).getScope();
+ if (statement instanceof IASTCompoundStatement) {
+ return ((IASTCompoundStatement) statement).getScope();
}
return null;
}
- public ILabel[] getLabels(){
+ public ILabel[] getLabels() {
FindLabelsAction action = new FindLabelsAction();
- getPhysicalNode().accept( action );
+ getPhysicalNode().accept(action);
- ILabel [] result = null;
- if( action.labels != null ){
- for( int i = 0; i < action.labels.length && action.labels[i] != null; i++ ){
+ ILabel[] result = null;
+ if (action.labels != null) {
+ for (int i = 0; i < action.labels.length && action.labels[i] != null; i++) {
IASTLabelStatement labelStatement = action.labels[i];
IBinding binding = labelStatement.getName().resolveBinding();
- if( binding != null )
- result = (ILabel[]) ArrayUtil.append( ILabel.class, result, binding );
+ if (binding != null)
+ result = ArrayUtil.append(ILabel.class, result, (ILabel) binding);
}
}
- return ArrayUtil.trim( ILabel.class, result );
+ return ArrayUtil.trim(ILabel.class, result);
}
static private class FindLabelsAction extends ASTVisitor {
- public IASTLabelStatement [] labels = null;
+ public IASTLabelStatement[] labels = null;
- public FindLabelsAction(){
+ public FindLabelsAction() {
shouldVisitStatements = true;
}
@Override
- public int visit( IASTStatement statement ) {
- if( statement instanceof IASTLabelStatement ){
- labels = (IASTLabelStatement[]) ArrayUtil.append( IASTLabelStatement.class, labels, statement );
+ public int visit(IASTStatement statement) {
+ if (statement instanceof IASTLabelStatement) {
+ labels = ArrayUtil.append(IASTLabelStatement.class, labels, (IASTLabelStatement) statement);
}
return PROCESS_CONTINUE;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java
index 581d9ed3d22..04141c59240 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java
@@ -112,7 +112,7 @@ public class CScope implements ICScope, IASTInternalScope {
private IASTNode physicalNode = null;
private boolean isCached = false;
- private CharArrayObjectMap<?> mapsToNameOrBinding[] = { CharArrayObjectMap.EMPTY_MAP, CharArrayObjectMap.EMPTY_MAP };
+ private final CharArrayObjectMap<?> mapsToNameOrBinding[] = { CharArrayObjectMap.EMPTY_MAP, CharArrayObjectMap.EMPTY_MAP };
private final EScopeKind kind;
public CScope(IASTNode physical, EScopeKind eKind) {
@@ -134,7 +134,7 @@ public class CScope implements ICScope, IASTInternalScope {
}
protected static class CollectNamesAction extends ASTVisitor {
- private char[] name;
+ private final char[] name;
private IASTName[] result = null;
CollectNamesAction(char[] n) {
@@ -376,7 +376,7 @@ public class CScope implements ICScope, IASTInternalScope {
for (Object element : obj) {
if (element instanceof IBinding) {
- result = (IBinding[]) ArrayUtil.append(IBinding.class, result, element);
+ result = ArrayUtil.append(IBinding.class, result, (IBinding) element);
} else {
IASTName n= null;
if (element instanceof IASTName) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructure.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructure.java
index a6f23ab423e..cbf9327dcfe 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructure.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructure.java
@@ -132,8 +132,8 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
@Override
public IScope getScope() throws DOMException {
- IASTDeclSpecifier declSpec = (IASTDeclSpecifier) ((definition != null) ? (IASTNode) definition
- .getParent() : declarations[0].getParent());
+ IASTDeclSpecifier declSpec = (IASTDeclSpecifier) ((definition != null) ?
+ (IASTNode) definition.getParent() : declarations[0].getParent());
IScope scope = CVisitor.getContainingScope(declSpec);
while (scope instanceof ICCompositeTypeScope) {
scope = scope.getParent();
@@ -149,8 +149,8 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, getNameCharArray()) };
}
ICASTCompositeTypeSpecifier compSpec = (ICASTCompositeTypeSpecifier) definition.getParent();
- IField[] fields = collectFields(compSpec, null);
- return ArrayUtil.trim(IField.class, fields);
+ IField[] fields = collectFields(compSpec, IField.EMPTY_FIELD_ARRAY);
+ return ArrayUtil.trim(fields);
}
private IField[] collectFields(ICASTCompositeTypeSpecifier compSpec, IField[] fields) {
@@ -171,7 +171,7 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
IASTName name = ASTQueries.findInnermostDeclarator(declarator).getName();
IBinding binding = name.resolveBinding();
if (binding != null)
- fields = (IField[]) ArrayUtil.append(IField.class, fields, binding);
+ fields = ArrayUtil.append(fields, (IField) binding);
}
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java
index 760aa746449..1147986b8d0 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java
@@ -91,7 +91,7 @@ public class CPPASTFunctionDeclarator extends CPPASTDeclarator implements ICPPAS
if (parameter != null) {
parameter.setParent(this);
parameter.setPropertyInParent(FUNCTION_PARAMETER);
- parameters = (ICPPASTParameterDeclaration[]) ArrayUtil.append(ICPPASTParameterDeclaration.class, parameters, parameter);
+ parameters = ArrayUtil.append(ICPPASTParameterDeclaration.class, parameters, (ICPPASTParameterDeclaration) parameter);
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java
index b325b1a406a..7583bd9c98d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java
@@ -288,22 +288,22 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
IBinding binding = null;
if (o instanceof ObjectSet<?>) {
ObjectSet<?> set = (ObjectSet<?>) o;
- IBinding[] bs = null;
+ ICPPConstructor[] bs = ICPPConstructor.EMPTY_CONSTRUCTOR_ARRAY;
for (int i = 0; i < set.size(); i++) {
Object obj = set.keyAt(i);
if (obj instanceof IASTName) {
IASTName n = (IASTName) obj;
binding = shouldResolve(forceResolve, n, forName) ? n.resolveBinding() : n.getBinding();
if (binding instanceof ICPPConstructor) {
- bs = ArrayUtil.append(ICPPConstructor.class, bs, binding);
+ bs = ArrayUtil.append(bs, (ICPPConstructor) binding);
}
} else if (obj instanceof ICPPConstructor) {
- bs = (IBinding[]) ArrayUtil.append(ICPPConstructor.class, bs, obj);
+ bs = ArrayUtil.append(bs, (ICPPConstructor) obj);
}
}
- return (ICPPConstructor[]) ArrayUtil.trim(ICPPConstructor.class, bs);
+ return ArrayUtil.trim(ICPPConstructor.class, bs);
} else if (o instanceof IASTName) {
- if (shouldResolve(forceResolve, (IASTName) o, forName) || ((IASTName)o).getBinding() != null) {
+ if (shouldResolve(forceResolve, (IASTName) o, forName) || ((IASTName) o).getBinding() != null) {
// always store the name, rather than the binding, such that we can properly flush the scope.
nameMap.put(CONSTRUCTOR_KEY, o);
binding = ((IASTName)o).resolveBinding();
@@ -409,11 +409,11 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
* @see chapter 12 of the ISO specification
*/
class ImplicitsAnalysis {
- private boolean hasUserDeclaredConstructor;
+ private final boolean hasUserDeclaredConstructor;
private boolean hasUserDeclaredCopyConstructor;
private boolean hasUserDeclaredCopyAssignmentOperator;
- private boolean hasUserDeclaredDestructor;
- private ICPPClassType classType;
+ private final boolean hasUserDeclaredDestructor;
+ private final ICPPClassType classType;
ImplicitsAnalysis(ICPPASTCompositeTypeSpecifier compSpec, ICPPClassType clsType) {
classType= clsType;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java
index a9e1c000d37..452640243af 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java
@@ -224,7 +224,7 @@ public abstract class CPPTemplateDefinition extends PlatformObject implements IC
for (ICPPASTTemplateParameter param : params) {
p= CPPTemplates.getTemplateParameterName(param).resolveBinding();
if (p instanceof ICPPTemplateParameter) {
- result = (ICPPTemplateParameter[]) ArrayUtil.append(ICPPTemplateParameter.class, result, p);
+ result = ArrayUtil.append(ICPPTemplateParameter.class, result, (ICPPTemplateParameter) p);
}
}
templateParameters = ArrayUtil.trim(ICPPTemplateParameter.class, result);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java
index 27a1f197756..67f62f5fe8b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java
@@ -79,14 +79,14 @@ public class CPPTemplateTemplateParameter extends CPPTemplateParameter implement
if (templateParameters == null) {
ICPPASTTemplatedTypeTemplateParameter template = (ICPPASTTemplatedTypeTemplateParameter) getPrimaryDeclaration().getParent();
ICPPASTTemplateParameter[] params = template.getTemplateParameters();
- ICPPTemplateParameter[] result = null;
+ ICPPTemplateParameter[] result = ICPPTemplateParameter.EMPTY_TEMPLATE_PARAMETER_ARRAY;
for (ICPPASTTemplateParameter param : params) {
IBinding binding = CPPTemplates.getTemplateParameterName(param).resolvePreBinding();
if (binding instanceof ICPPTemplateParameter) {
- result = (ICPPTemplateParameter[]) ArrayUtil.append(ICPPTemplateParameter.class, result, binding);
+ result = ArrayUtil.append(result, (ICPPTemplateParameter) binding);
}
}
- templateParameters = ArrayUtil.trim(ICPPTemplateParameter.class, result);
+ templateParameters = ArrayUtil.trim(result);
}
return templateParameters;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java
index 84394d52ea8..9e864e324df 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java
@@ -221,7 +221,7 @@ public class ClassTypeHelper {
for (IASTDeclarator dtor : dtors) {
binding = ASTQueries.findInnermostDeclarator(dtor).getName().resolveBinding();
if (binding instanceof ICPPField)
- result = (ICPPField[]) ArrayUtil.append(ICPPField.class, result, binding);
+ result = ArrayUtil.append(ICPPField.class, result, (ICPPField) binding);
}
} else if (decl instanceof ICPPASTUsingDeclaration) {
IASTName n = ((ICPPASTUsingDeclaration)decl).getName();
@@ -230,10 +230,10 @@ public class ClassTypeHelper {
IBinding[] bs = ((ICPPUsingDeclaration)binding).getDelegates();
for (IBinding element : bs) {
if (element instanceof ICPPField)
- result = (ICPPField[]) ArrayUtil.append(ICPPField.class, result, element);
+ result = ArrayUtil.append(ICPPField.class, result, (ICPPField) element);
}
} else if (binding instanceof ICPPField) {
- result = (ICPPField[]) ArrayUtil.append(ICPPField.class, result, binding);
+ result = ArrayUtil.append(ICPPField.class, result, (ICPPField) binding);
}
}
}
@@ -349,7 +349,7 @@ public class ClassTypeHelper {
for (IASTDeclarator dtor : dtors) {
binding = ASTQueries.findInnermostDeclarator(dtor).getName().resolveBinding();
if (binding instanceof ICPPMethod)
- result = (ICPPMethod[]) ArrayUtil.append(ICPPMethod.class, result, binding);
+ result = ArrayUtil.append(ICPPMethod.class, result, (ICPPMethod) binding);
}
}
} else if (decl instanceof IASTFunctionDefinition) {
@@ -359,7 +359,7 @@ public class ClassTypeHelper {
dtor = ASTQueries.findInnermostDeclarator(dtor);
binding = dtor.getName().resolveBinding();
if (binding instanceof ICPPMethod) {
- result = (ICPPMethod[]) ArrayUtil.append(ICPPMethod.class, result, binding);
+ result = ArrayUtil.append(ICPPMethod.class, result, (ICPPMethod) binding);
}
}
} else if (decl instanceof ICPPASTUsingDeclaration) {
@@ -369,10 +369,10 @@ public class ClassTypeHelper {
IBinding[] bs = ((ICPPUsingDeclaration)binding).getDelegates();
for (IBinding element : bs) {
if (element instanceof ICPPMethod)
- result = (ICPPMethod[]) ArrayUtil.append(ICPPMethod.class, result, element);
+ result = ArrayUtil.append(ICPPMethod.class, result, (ICPPMethod) element);
}
} else if (binding instanceof ICPPMethod) {
- result = (ICPPMethod[]) ArrayUtil.append(ICPPMethod.class, result, binding);
+ result = ArrayUtil.append(ICPPMethod.class, result, (ICPPMethod) binding);
}
}
}
@@ -418,7 +418,7 @@ public class ClassTypeHelper {
binding = ((ICPPASTElaboratedTypeSpecifier)declSpec).getName().resolveBinding();
}
if (binding instanceof ICPPClassType)
- result = (ICPPClassType[])ArrayUtil.append(ICPPClassType.class, result, binding);
+ result = ArrayUtil.append(ICPPClassType.class, result, (ICPPClassType) binding);
}
}
return ArrayUtil.trim(ICPPClassType.class, result);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
index 761b47cb16e..a43ea8824ea 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
@@ -19,7 +19,17 @@ import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.typeOrFunctionSet;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.valueCat;
-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;
@@ -1782,10 +1792,11 @@ public class CPPSemantics {
IBinding[] result = null;
for (Object binding : bindings) {
- if (binding instanceof IASTName)
+ if (binding instanceof IASTName) {
result = ArrayUtil.append(IBinding.class, result, ((IASTName) binding).resolveBinding());
- else if (binding instanceof IBinding)
- result = (IBinding[]) ArrayUtil.append(IBinding.class, result, binding);
+ } else if (binding instanceof IBinding) {
+ result = ArrayUtil.append(IBinding.class, result, (IBinding) binding);
+ }
}
return new CPPCompositeBinding(result);
}
@@ -2019,13 +2030,13 @@ public class CPPSemantics {
}
}
- IBinding[] bindings = null;
+ IBinding[] bindings = IBinding.EMPTY_BINDING_ARRAY;
if (cmp > 0) {
- bindings = ArrayUtil.append(IBinding.class, bindings, obj);
- bindings = ArrayUtil.append(IBinding.class, bindings, type);
+ bindings = ArrayUtil.append(bindings, obj);
+ bindings = ArrayUtil.append(bindings, type);
} else {
- bindings = ArrayUtil.append(IBinding.class, bindings, type);
- bindings = (IBinding[]) ArrayUtil.addAll(IBinding.class, bindings, fns.keyArray());
+ bindings = ArrayUtil.append(bindings, type);
+ bindings = ArrayUtil.addAll(bindings, fns.keyArray());
}
bindings = ArrayUtil.trim(IBinding.class, bindings);
ICPPUsingDeclaration composite = new CPPUsingDeclaration(data.astName, bindings);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java
index c46a0b1e620..c98992db2eb 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java
@@ -531,7 +531,7 @@ public class CPPTemplates {
while (parent.getParent() instanceof ICPPASTTemplateDeclaration) {
parent = parent.getParent();
- templates = (ICPPASTTemplateDeclaration[]) ArrayUtil.append(ICPPASTTemplateDeclaration.class, templates, parent);
+ templates = ArrayUtil.append(ICPPASTTemplateDeclaration.class, templates, (ICPPASTTemplateDeclaration) parent);
}
templates = ArrayUtil.trim(ICPPASTTemplateDeclaration.class, templates);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java
index f8229c7fbe0..6fbb424e8c6 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java
@@ -13,7 +13,11 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
-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.CVTYPE;
+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.getNestedType;
+import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getUltimateTypeUptoPointers;
import java.util.ArrayList;
import java.util.Collections;
@@ -209,6 +213,7 @@ public class CPPVisitor extends ASTQueries {
private static final char[] PTRDIFF_T = "ptrdiff_t".toCharArray(); //$NON-NLS-1$
private static final char[] TYPE_INFO= "type_info".toCharArray(); //$NON-NLS-1$
private static final char[] INITIALIZER_LIST = "initializer_list".toCharArray(); //$NON-NLS-1$
+ private static final char[][] EMPTY_CHAR_ARRAY_ARRAY = {};
public static final IASTInitializerClause[] NO_ARGS = {};
// Thread-local set of DeclSpecifiers for which auto types are being created.
@@ -2301,7 +2306,8 @@ public class CPPVisitor extends ASTQueries {
}
public static char[][] getQualifiedNameCharArray(IBinding binding) {
- char[][] ns = null;
+ char[][] ns = EMPTY_CHAR_ARRAY_ARRAY;
+ ns = ArrayUtil.append(ns, binding.getNameCharArray());
for (IBinding owner= binding.getOwner(); owner != null; owner= owner.getOwner()) {
char[] n= owner.getNameCharArray();
if (n == null)
@@ -2311,16 +2317,11 @@ public class CPPVisitor extends ASTQueries {
if (owner instanceof ICPPNamespace && n.length == 0)
continue;
- ns = ArrayUtil.append(n.getClass(), ns, n);
+ ns = ArrayUtil.append(ns, n);
}
- final char[] bname = binding.getNameCharArray();
- ns = ArrayUtil.trim(bname.getClass(), ns);
- char[][] result = new char[ns.length + 1][];
- for (int i = ns.length - 1; i >= 0; i--) {
- result[ns.length - i - 1] = ns[i];
- }
- result[ns.length]= bname;
- return result;
+ ns = ArrayUtil.trim(ns);
+ ArrayUtil.reverse(ns);
+ return ns;
}
private static IScope getParentScope(IScope scope, IASTTranslationUnit unit) throws DOMException {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplate.java
index 455ea46095d..e29c56407da 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplate.java
@@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Andrew Ferguson (Symbian) - Initial implementation
- * Markus Schorn (Wind River Systems)
+ * Andrew Ferguson (Symbian) - Initial implementation
+ * Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
@@ -50,10 +50,9 @@ public class CompositeCPPClassTemplate extends CompositeCPPClassType
System.arraycopy(ss, 0, preresult[i], 0, ss.length);
}
- return (ICPPClassTemplatePartialSpecialization[]) ArrayUtil.addAll(
- ICPPClassTemplatePartialSpecialization.class,
- ICPPClassTemplatePartialSpecialization.EMPTY_PARTIAL_SPECIALIZATION_ARRAY, cf
- .getCompositeBindings(preresult));
+ return ArrayUtil.addAll(
+ ICPPClassTemplatePartialSpecialization.EMPTY_PARTIAL_SPECIALIZATION_ARRAY,
+ cf.getCompositeBindings(preresult));
} catch (CoreException ce) {
CCorePlugin.log(ce);
return ICPPClassTemplatePartialSpecialization.EMPTY_PARTIAL_SPECIALIZATION_ARRAY;
@@ -97,5 +96,4 @@ public class CompositeCPPClassTemplate extends CompositeCPPClassType
ICPPTemplateArgument[] args = CPPTemplates.templateParametersAsArguments(getTemplateParameters());
return new CPPDeferredClassInstance(this, args, getCompositeScope());
}
-
}
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java
index a97f0b189cf..84b76b6bc6d 100644
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java
+++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java
@@ -93,9 +93,9 @@ public class CPPPopulateASTViewAction extends ASTGenericVisitor implements IPopu
tree.setFiltersFlag(DOMASTNodeLeaf.FLAG_PROBLEM);
if (node instanceof IASTProblemHolder)
- astProblems = ArrayUtil.append(IASTProblem.class, astProblems, ((IASTProblemHolder)node).getProblem());
+ astProblems = ArrayUtil.append(IASTProblem.class, astProblems, ((IASTProblemHolder) node).getProblem());
else
- astProblems = (IASTProblem[])ArrayUtil.append(IASTProblem.class, astProblems, node);
+ astProblems = ArrayUtil.append(IASTProblem.class, astProblems, (IASTProblem) node);
}
if (node instanceof IASTPreprocessorStatement)
tree.setFiltersFlag(DOMASTNodeLeaf.FLAG_PREPROCESSOR);
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPopulateASTViewAction.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPopulateASTViewAction.java
index 00fa52f8828..d125bbdc7d3 100644
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPopulateASTViewAction.java
+++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPopulateASTViewAction.java
@@ -117,9 +117,9 @@ public class CPopulateASTViewAction extends ASTVisitor implements IPopulateDOMAS
tree.setFiltersFlag(DOMASTNodeLeaf.FLAG_PROBLEM);
if (node instanceof IASTProblemHolder)
- astProblems = ArrayUtil.append(IASTProblem.class, astProblems, ((IASTProblemHolder)node).getProblem());
+ astProblems = ArrayUtil.append(IASTProblem.class, astProblems, ((IASTProblemHolder) node).getProblem());
else
- astProblems = (IASTProblem[])ArrayUtil.append(IASTProblem.class, astProblems, node);
+ astProblems = ArrayUtil.append(IASTProblem.class, astProblems, (IASTProblem) node);
}
if (node instanceof IASTPreprocessorStatement)
tree.setFiltersFlag(DOMASTNodeLeaf.FLAG_PREPROCESSOR);

Back to the top