Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPUsingDirective.java3
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBasicType.java32
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeIndexBinding.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CPPCompositesFactory.java24
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/IPDOMCPPClassType.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java14
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java7
7 files changed, 43 insertions, 47 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPUsingDirective.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPUsingDirective.java
index 0cd39f593e..5424102b9a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPUsingDirective.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPUsingDirective.java
@@ -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;
@@ -23,7 +23,6 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ICPPUsingDirective {
-
ICPPUsingDirective[] EMPTY_ARRAY = new ICPPUsingDirective[0];
/**
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBasicType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBasicType.java
index 070df99797..3e993262ca 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBasicType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBasicType.java
@@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Andrew Niefer (IBM Corporation) - initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * Andrew Niefer (IBM Corporation) - initial API and implementation
+ * Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -24,7 +24,7 @@ import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.core.runtime.CoreException;
/**
- * Integral c++ type.
+ * Built-in c++ type.
*/
public class CPPBasicType implements ICPPBasicType, ISerializableType {
public static final CPPBasicType BOOLEAN = new CPPBasicType(Kind.eBoolean, 0, null);
@@ -35,9 +35,9 @@ public class CPPBasicType implements ICPPBasicType, ISerializableType {
public CPPBasicType(Kind kind, int qualifiers, IASTExpression expression) {
if (kind == Kind.eUnspecified) {
- if ( (qualifiers & (IS_COMPLEX | IS_IMAGINARY)) != 0) {
+ if ((qualifiers & (IS_COMPLEX | IS_IMAGINARY)) != 0) {
fKind= Kind.eFloat;
- } else if ( (qualifiers & (IS_LONG | IS_SHORT | IS_SIGNED | IS_UNSIGNED | IS_LONG_LONG)) != 0 ) {
+ } else if ((qualifiers & (IS_LONG | IS_SHORT | IS_SIGNED | IS_UNSIGNED | IS_LONG_LONG)) != 0) {
fKind= Kind.eInt;
} else {
fKind= Kind.eUnspecified;
@@ -54,18 +54,18 @@ public class CPPBasicType implements ICPPBasicType, ISerializableType {
}
public CPPBasicType(ICPPASTSimpleDeclSpecifier sds) {
- this (getKind(sds), getModifiers(sds), null);
+ this(getKind(sds), getModifiers(sds), null);
}
private static int getModifiers(ICPPASTSimpleDeclSpecifier sds) {
return
- ( sds.isLong() ? IBasicType.IS_LONG : 0 ) |
- ( sds.isShort() ? IBasicType.IS_SHORT : 0 ) |
- ( sds.isSigned() ? IBasicType.IS_SIGNED: 0 ) |
- ( sds.isUnsigned()? IBasicType.IS_UNSIGNED : 0 ) |
- ( sds.isLongLong()? IBasicType.IS_LONG_LONG : 0 ) |
- ( sds.isComplex() ? IBasicType.IS_COMPLEX : 0 ) |
- ( sds.isImaginary()?IBasicType.IS_IMAGINARY : 0 );
+ (sds.isLong() ? IBasicType.IS_LONG : 0) |
+ (sds.isShort() ? IBasicType.IS_SHORT : 0) |
+ (sds.isSigned() ? IBasicType.IS_SIGNED: 0) |
+ (sds.isUnsigned() ? IBasicType.IS_UNSIGNED : 0) |
+ (sds.isLongLong() ? IBasicType.IS_LONG_LONG : 0) |
+ (sds.isComplex() ? IBasicType.IS_COMPLEX : 0) |
+ (sds.isImaginary() ? IBasicType.IS_IMAGINARY : 0);
}
private static Kind getKind(ICPPASTSimpleDeclSpecifier sds) {
@@ -73,7 +73,7 @@ public class CPPBasicType implements ICPPBasicType, ISerializableType {
}
static Kind getKind(final int simpleDeclSpecType) {
- switch(simpleDeclSpecType) {
+ switch (simpleDeclSpecType) {
case IASTSimpleDeclSpecifier.t_bool:
return Kind.eBoolean;
case IASTSimpleDeclSpecifier.t_char:
@@ -97,7 +97,6 @@ public class CPPBasicType implements ICPPBasicType, ISerializableType {
}
}
-
public boolean isSameType(IType object) {
if (object == this)
return true;
@@ -208,13 +207,11 @@ public class CPPBasicType implements ICPPBasicType, ISerializableType {
return new CPPBasicType(Kind.values()[kind], modifiers);
}
-
@Deprecated
public int getQualifierBits() {
return getModifiers();
}
-
@Deprecated
public int getType() {
switch (fKind) {
@@ -239,6 +236,7 @@ public class CPPBasicType implements ICPPBasicType, ISerializableType {
}
return t_unspecified;
}
+
/**
* @deprecated types don't have values
*/
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeIndexBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeIndexBinding.java
index 90057348df..9142ab03fc 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeIndexBinding.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeIndexBinding.java
@@ -67,7 +67,7 @@ public abstract class CompositeIndexBinding implements IIndexBinding {
}
public String[] getQualifiedName() {
- return new String[] {getName()};
+ return new String[] { getName() };
}
public IIndexScope getScope() {
@@ -88,7 +88,7 @@ public abstract class CompositeIndexBinding implements IIndexBinding {
}
public boolean isFileLocal() throws CoreException {
- return rbinding != null ? rbinding.isFileLocal() : false;
+ return rbinding != null && rbinding.isFileLocal();
}
public IIndexFile getLocalToFile() throws CoreException {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CPPCompositesFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CPPCompositesFactory.java
index 4577d65b3d..545020408d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CPPCompositesFactory.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CPPCompositesFactory.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;
@@ -103,7 +103,7 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
ICPPNamespace[] namespaces;
if (rscope instanceof CompositeCPPNamespace) {
// avoid duplicating the search
- namespaces = ((CompositeCPPNamespace)rscope).namespaces;
+ namespaces = ((CompositeCPPNamespace) rscope).namespaces;
} else {
namespaces = getNamespaces(rscope.getScopeBinding());
}
@@ -233,7 +233,7 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
}
protected IIndexFragmentBinding findOneBinding(IBinding binding) {
- return super.findOneBinding(binding, false);
+ return findOneBinding(binding, false);
}
/* (non-Javadoc)
@@ -259,7 +259,7 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
} else if (binding instanceof ICPPFunction) {
return new CompositeCPPFunctionInstance(this, (ICPPFunction) binding);
} else {
- throw new CompositingNotImplementedError("composite binding unavailable for "+binding+" "+binding.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new CompositingNotImplementedError("composite binding unavailable for " + binding + " " + binding.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
}
}
} else if (binding instanceof ICPPTemplateDefinition) {
@@ -276,7 +276,7 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
} else if (binding instanceof ICPPFunctionType) {
return new CompositeCPPFunctionTemplateSpecialization(this, (ICPPFunction) binding);
} else {
- throw new CompositingNotImplementedError("composite binding unavailable for "+binding+" "+binding.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new CompositingNotImplementedError("composite binding unavailable for " + binding + " " + binding.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
}
} else {
if (binding instanceof ICPPClassType) {
@@ -294,7 +294,7 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
} else if (binding instanceof ITypedef) {
return new CompositeCPPTypedefSpecialization(this, (ICPPBinding) binding);
} else {
- throw new CompositingNotImplementedError("composite binding unavailable for "+binding+" "+binding.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new CompositingNotImplementedError("composite binding unavailable for " + binding + " " + binding.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
}
}
} else if(binding instanceof ICPPTemplateParameter) {
@@ -305,7 +305,7 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
} else if (binding instanceof ICPPTemplateTemplateParameter) {
result = new CompositeCPPTemplateTemplateParameter(this, (ICPPTemplateTemplateParameter) binding);
} else {
- throw new CompositingNotImplementedError("composite binding unavailable for "+binding+" "+binding.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new CompositingNotImplementedError("composite binding unavailable for " + binding + " " + binding.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
}
} else if (binding instanceof ICPPTemplateDefinition) {
if (binding instanceof ICPPClassTemplate) {
@@ -318,7 +318,7 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
} else if (binding instanceof ICPPFunctionTemplate) {
return new CompositeCPPFunctionTemplate(this, (ICPPFunction) binding);
} else {
- throw new CompositingNotImplementedError("composite binding unavailable for "+binding+" "+binding.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new CompositingNotImplementedError("composite binding unavailable for " + binding + " " + binding.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
}
} else if (binding instanceof ICPPParameter) {
result = new CompositeCPPParameter(this, (ICPPParameter) binding);
@@ -360,7 +360,7 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
} else if (binding instanceof IIndexMacroContainer) {
result= new CompositeMacroContainer(this, binding);
} else {
- throw new CompositingNotImplementedError("composite binding unavailable for "+binding+" "+binding.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new CompositingNotImplementedError("composite binding unavailable for " + binding + " " + binding.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
}
} catch(CoreException ce) {
CCorePlugin.log(ce);
@@ -385,7 +385,7 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
int result = 1;
result = prime * result + (int) (i ^ (i >>> 32));
result = prime * result + j;
- result = prime * result + (int)k;
+ result = prime * result + (int) k;
return result;
}
@Override
@@ -398,7 +398,7 @@ public class CPPCompositesFactory extends AbstractCompositeFactory {
}
}
- public static Object createInstanceCacheKey(ICompositesFactory cf,IIndexFragmentBinding rbinding) {
+ public static Object createInstanceCacheKey(ICompositesFactory cf, IIndexFragmentBinding rbinding) {
return new Key(Thread.currentThread().getId(), cf.hashCode(), rbinding.getBindingID());
}
public static Object createSpecializationKey(ICompositesFactory cf,IIndexFragmentBinding rbinding) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/IPDOMCPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/IPDOMCPPClassType.java
index 640b1d8094..6767e35d12 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/IPDOMCPPClassType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/IPDOMCPPClassType.java
@@ -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.pdom.dom.cpp;
@@ -24,13 +24,13 @@ import org.eclipse.core.runtime.CoreException;
public interface IPDOMCPPClassType extends ICPPClassType, IPDOMBinding, IIndexType {
/**
- * Visit the children of the class type without using the cache. This method is
+ * Visits the children of the class type without using the cache. This method is
* used to populate the cache.
*/
void acceptUncached(IPDOMVisitor visitor) throws CoreException;
/**
- * Return the scope name, for use in {@link IScope#getScopeName()}
+ * Returns the scope name, for use in {@link IScope#getScopeName()}
*/
IIndexName getScopeName();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java
index 96a145e1e3..2ff8c6ea59 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java
@@ -6,11 +6,11 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Doug Schaefer (QNX) - Initial API and implementation
- * Markus Schorn (Wind River Systems)
- * Andrew Ferguson (Symbian)
- * Bryan Wilkinson (QNX)
- * Jens Elmenthaler - http://bugs.eclipse.org/173458 (camel case completion)
+ * Doug Schaefer (QNX) - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * Andrew Ferguson (Symbian)
+ * Bryan Wilkinson (QNX)
+ * Jens Elmenthaler - http://bugs.eclipse.org/173458 (camel case completion)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@@ -147,12 +147,12 @@ class PDOMCPPNamespace extends PDOMCPPBinding
}
public ICPPUsingDirective[] getUsingDirectives() {
- return new ICPPUsingDirective[0];
+ return ICPPUsingDirective.EMPTY_ARRAY;
}
public IBinding[] find(String name) {
try {
- BindingCollector visitor = new BindingCollector(getLinkage(), name.toCharArray(),
+ BindingCollector visitor = new BindingCollector(getLinkage(), name.toCharArray(),
IndexFilter.CPP_DECLARED_OR_IMPLICIT_NO_INSTANCE, false, false, true);
getIndex().accept(visitor);
return visitor.getBindings();
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java
index efef501633..a1ab642c40 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java
@@ -72,7 +72,7 @@ public class LineSearchElement extends PDOMSearchElement {
if (!(obj instanceof Match))
return false;
Match m = (Match) obj;
- return (fOffset == m.fOffset) && (fLength == m.fLength);
+ return fOffset == m.fOffset && fLength == m.fLength;
}
@Override
@@ -142,7 +142,7 @@ public class LineSearchElement extends PDOMSearchElement {
if (!(obj instanceof LineSearchElement))
return false;
LineSearchElement other = (LineSearchElement) obj;
- return (fOffset == other.fOffset) && (super.equals(obj)) && (fMatches.equals(other.fMatches));
+ return fOffset == other.fOffset && super.equals(obj) && fMatches.equals(other.fMatches);
}
@Override
@@ -220,7 +220,6 @@ public class LineSearchElement extends PDOMSearchElement {
private static LineSearchElement[] collectLineElements(AbstractCharArray buf, Match[] matches,
IIndexFileLocation fileLocation) {
-
List<LineSearchElement> result = new ArrayList<LineSearchElement>();
List<Match> matchCollector= new ArrayList<Match>();
@@ -237,7 +236,7 @@ public class LineSearchElement extends PDOMSearchElement {
final int minOffset= matchOffset + match.getLength();
match= null;
matchOffset= Integer.MAX_VALUE;
- for(i=i+1; i<matches.length; i++) {
+ for(i= i + 1; i < matches.length; i++) {
// Advance to next match that is not overlapped
final Match nextMatch= matches[i];
final int nextOffset= nextMatch.getOffset();

Back to the top