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

Compiler warnings.

This commit is contained in:
Markus Schorn 2009-12-11 11:11:29 +00:00
parent 12fdecc1fe
commit ac13b9f714
97 changed files with 181 additions and 180 deletions

View file

@ -89,7 +89,7 @@ public class Archive extends Openable implements IArchive {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (IBinaryArchive.class.equals(adapter)) { if (IBinaryArchive.class.equals(adapter)) {

View file

@ -198,7 +198,7 @@ public class Binary extends Openable implements IBinary {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (IBinaryObject.class.equals(adapter)) { if (IBinaryObject.class.equals(adapter)) {

View file

@ -72,7 +72,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
// handle all kinds of resources // handle all kinds of resources

View file

@ -27,7 +27,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
public abstract class Openable extends Parent implements IOpenable, IBufferChangedListener { public abstract class Openable extends Parent implements IOpenable {
protected IResource resource; protected IResource resource;

View file

@ -79,7 +79,7 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
return null; return null;
} }

View file

@ -13,6 +13,7 @@ package org.eclipse.cdt.core.dom;
import org.eclipse.cdt.core.parser.CodeReader; import org.eclipse.cdt.core.parser.CodeReader;
import org.eclipse.cdt.core.parser.ICodeReaderCache; import org.eclipse.cdt.core.parser.ICodeReaderCache;
import org.eclipse.cdt.core.parser.IncludeFileContentProvider;
/** /**
* This is the interface that an AST Service uses to delegate the construction * This is the interface that an AST Service uses to delegate the construction
@ -21,7 +22,9 @@ import org.eclipse.cdt.core.parser.ICodeReaderCache;
* @author jcamelon * @author jcamelon
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
* @deprecated replaced by {@link IncludeFileContentProvider}
*/ */
@Deprecated
public interface ICodeReaderFactory { public interface ICodeReaderFactory {
/** /**

View file

@ -24,7 +24,7 @@ import org.eclipse.core.runtime.IAdaptable;
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface IASTTranslationUnit extends IASTNode, IASTDeclarationListOwner, IAdaptable { public interface IASTTranslationUnit extends IASTDeclarationListOwner, IAdaptable {
/** /**
* <code>OWNED_DECLARATION</code> represents the relationship between an <code>IASTTranslationUnit</code> and * <code>OWNED_DECLARATION</code> represents the relationship between an <code>IASTTranslationUnit</code> and

View file

@ -11,7 +11,6 @@
package org.eclipse.cdt.core.dom.ast.c; package org.eclipse.cdt.core.dom.ast.c;
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier; import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclarationListOwner;
/** /**
* Structs and Unions in C can be qualified w/restrict keyword. * Structs and Unions in C can be qualified w/restrict keyword.
@ -19,8 +18,7 @@ import org.eclipse.cdt.core.dom.ast.IASTDeclarationListOwner;
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface ICASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifier, ICASTDeclSpecifier, public interface ICASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifier, ICASTDeclSpecifier {
IASTDeclarationListOwner {
/** /**
* @since 5.1 * @since 5.1

View file

@ -13,7 +13,6 @@ package org.eclipse.cdt.core.dom.ast.cpp;
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty; import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier; import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclarationListOwner;
import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNameOwner; import org.eclipse.cdt.core.dom.ast.IASTNameOwner;
import org.eclipse.cdt.core.dom.ast.IASTNode; import org.eclipse.cdt.core.dom.ast.IASTNode;
@ -22,8 +21,7 @@ import org.eclipse.cdt.core.dom.ast.IASTNode;
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifier, ICPPASTDeclSpecifier, public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifier, ICPPASTDeclSpecifier {
IASTDeclarationListOwner {
/** /**
* <code>k_class</code> C++ introduces the class concept for composite * <code>k_class</code> C++ introduces the class concept for composite

View file

@ -50,7 +50,7 @@ public class GCCLanguage extends AbstractCLikeLanguage {
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter == IPDOMLinkageFactory.class) { if (adapter == IPDOMLinkageFactory.class) {
return new PDOMCLinkageFactory(); return new PDOMCLinkageFactory();

View file

@ -15,7 +15,6 @@ import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator; import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator; import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNameOwner;
/** /**
* This is the declarator for a K&R C Function. * This is the declarator for a K&R C Function.
@ -23,7 +22,7 @@ import org.eclipse.cdt.core.dom.ast.IASTNameOwner;
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface ICASTKnRFunctionDeclarator extends IASTFunctionDeclarator, IASTNameOwner { public interface ICASTKnRFunctionDeclarator extends IASTFunctionDeclarator {
/** /**
* <code>PARAMETER_NAME</code> refers to the names qualified in a K&R C * <code>PARAMETER_NAME</code> refers to the names qualified in a K&R C

View file

@ -49,7 +49,7 @@ public class GPPLanguage extends AbstractCLikeLanguage {
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter == IPDOMLinkageFactory.class) { if (adapter == IPDOMLinkageFactory.class) {
return new PDOMCPPLinkageFactory(); return new PDOMCPPLinkageFactory();

View file

@ -15,7 +15,6 @@ package org.eclipse.cdt.core.dom.parser;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
import org.eclipse.cdt.core.dom.ast.ASTVisitor; import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTCompletionNode; import org.eclipse.cdt.core.dom.ast.IASTCompletionNode;
import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTName;
@ -104,15 +103,16 @@ public abstract class AbstractCLikeLanguage extends AbstractLanguage implements
@Deprecated @Deprecated
public IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader, public IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader,
IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log) IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, IIndex index,
throws CoreException {
return getASTTranslationUnit(reader, scanInfo, fileCreator, index, 0, log);
}
@Override @Deprecated
public IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader,
IScannerInfo scanInfo, ICodeReaderFactory codeReaderFactory, IIndex index, int options,
IParserLogService log) throws CoreException { IParserLogService log) throws CoreException {
return getASTTranslationUnit(reader, scanInfo, fileCreator, index, 0, log);
}
@Override
@Deprecated
public IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader,
IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory codeReaderFactory,
IIndex index, int options, IParserLogService log) throws CoreException {
return getASTTranslationUnit(FileContent.adapt(reader), scanInfo, IncludeFileContentProvider return getASTTranslationUnit(FileContent.adapt(reader), scanInfo, IncludeFileContentProvider
.adapt(codeReaderFactory), index, options, log); .adapt(codeReaderFactory), index, options, log);
} }
@ -152,8 +152,8 @@ public abstract class AbstractCLikeLanguage extends AbstractLanguage implements
@Deprecated @Deprecated
public IASTCompletionNode getCompletionNode(org.eclipse.cdt.core.parser.CodeReader reader, public IASTCompletionNode getCompletionNode(org.eclipse.cdt.core.parser.CodeReader reader,
IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log, IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, IIndex index,
int offset) throws CoreException { IParserLogService log, int offset) throws CoreException {
return getCompletionNode(FileContent.adapt(reader), scanInfo, IncludeFileContentProvider return getCompletionNode(FileContent.adapt(reader), scanInfo, IncludeFileContentProvider
.adapt(fileCreator), index, log, offset); .adapt(fileCreator), index, log, offset);
} }
@ -204,11 +204,12 @@ public abstract class AbstractCLikeLanguage extends AbstractLanguage implements
/** /**
* @deprecated replaced by {@link #createScanner(FileContent, IScannerInfo, IncludeFileContentProvider, IParserLogService)} * @deprecated Replaced by
* {@link #createScanner(FileContent, IScannerInfo, IncludeFileContentProvider, IParserLogService)}
*/ */
@Deprecated @Deprecated
protected IScanner createScanner(org.eclipse.cdt.core.parser.CodeReader reader, IScannerInfo scanInfo, protected IScanner createScanner(org.eclipse.cdt.core.parser.CodeReader reader, IScannerInfo scanInfo,
ICodeReaderFactory fileCreator, IParserLogService log) { org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, IParserLogService log) {
return createScanner(FileContent.adapt(reader), scanInfo, IncludeFileContentProvider return createScanner(FileContent.adapt(reader), scanInfo, IncludeFileContentProvider
.adapt(fileCreator), log); .adapt(fileCreator), log);
} }
@ -256,8 +257,8 @@ public abstract class AbstractCLikeLanguage extends AbstractLanguage implements
return cLanguageKeywords; return cLanguageKeywords;
} }
@SuppressWarnings("unchecked")
@Override @Override
@SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if(ICLanguageKeywords.class.equals(adapter)) if(ICLanguageKeywords.class.equals(adapter))
return getCLanguageKeywords(); return getCLanguageKeywords();

View file

@ -22,7 +22,9 @@ import org.eclipse.core.runtime.CoreException;
* *
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
* @deprecated
*/ */
@Deprecated
public interface ICodeReaderCache { public interface ICodeReaderCache {
/** /**

View file

@ -10,7 +10,6 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.parser; package org.eclipse.cdt.core.parser;
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
import org.eclipse.cdt.internal.core.parser.EmptyFilesProvider; import org.eclipse.cdt.internal.core.parser.EmptyFilesProvider;
import org.eclipse.cdt.internal.core.parser.FileContentProviderAdapter; import org.eclipse.cdt.internal.core.parser.FileContentProviderAdapter;
import org.eclipse.cdt.internal.core.parser.SavedFilesProvider; import org.eclipse.cdt.internal.core.parser.SavedFilesProvider;
@ -44,7 +43,7 @@ public abstract class IncludeFileContentProvider {
* @deprecated Provided to achieve backwards compatibility. * @deprecated Provided to achieve backwards compatibility.
*/ */
@Deprecated @Deprecated
public static IncludeFileContentProvider adapt(ICodeReaderFactory factory) { public static IncludeFileContentProvider adapt(org.eclipse.cdt.core.dom.ICodeReaderFactory factory) {
return FileContentProviderAdapter.adapt(factory); return FileContentProviderAdapter.adapt(factory);
} }
} }

View file

@ -107,7 +107,7 @@ public abstract class ArrayUtil {
if (obj == null) if (obj == null)
return array; return array;
if (array == null || array.length == 0) { if (array == null || array.length == 0) {
Class c = array != null ? array.getClass().getComponentType() : Object.class; Class<? extends Object> c = array != null ? array.getClass().getComponentType() : Object.class;
array = (T[]) Array.newInstance(c, DEFAULT_LENGTH); array = (T[]) Array.newInstance(c, DEFAULT_LENGTH);
array[0] = obj; array[0] = obj;
return array; return array;
@ -264,7 +264,7 @@ public abstract class ArrayUtil {
} }
if (dest == null || dest.length == 0) { if (dest == null || dest.length == 0) {
Class c = dest != null ? dest.getClass().getComponentType() : source.getClass().getComponentType(); Class<? extends Object> c = dest != null ? dest.getClass().getComponentType() : source.getClass().getComponentType();
dest = (T[]) Array.newInstance(c, numToAdd); dest = (T[]) Array.newInstance(c, numToAdd);
System.arraycopy(source, 0, dest, 0, numToAdd); System.arraycopy(source, 0, dest, 0, numToAdd);
return dest; return dest;

View file

@ -20,7 +20,7 @@ public class ObjectSet<T> extends ObjectTable<T> {
/** /**
* Represents the empty ObjectSet * Represents the empty ObjectSet
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public static final ObjectSet EMPTY_SET = new ObjectSet( 0 ){ public static final ObjectSet EMPTY_SET = new ObjectSet( 0 ){
@Override public Object clone() { return this; } @Override public Object clone() { return this; }
@Override public List toList() { return Collections.EMPTY_LIST; } @Override public List toList() { return Collections.EMPTY_LIST; }
@ -107,8 +107,8 @@ public class ObjectSet<T> extends ObjectTable<T> {
if( objs == null ) if( objs == null )
return; return;
for (int i = 0; i < objs.length; i++) { for (T obj : objs) {
if( objs[i] != null ) add( objs[i] ); if( obj != null ) add( obj );
} }
} }

View file

@ -316,7 +316,7 @@ public abstract class ASTTranslationUnit extends ASTNode implements IASTTranslat
return new IASTComment[0]; return new IASTComment[0];
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public final Object getAdapter(Class adapter) { public final Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(fLocationResolver.getClass())) { if (adapter.isAssignableFrom(fLocationResolver.getClass())) {
return fLocationResolver; return fLocationResolver;

View file

@ -24,7 +24,9 @@ import org.eclipse.core.runtime.CoreException;
* every time a CodeReader is retrieved. * every time a CodeReader is retrieved.
* *
* This cache is not optimized to be run from within Eclipse (i.e. it ignores IResources). * This cache is not optimized to be run from within Eclipse (i.e. it ignores IResources).
* @deprecated
*/ */
@Deprecated
public class EmptyCodeReaderCache implements ICodeReaderCache { public class EmptyCodeReaderCache implements ICodeReaderCache {
/** /**

View file

@ -13,6 +13,8 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser; package org.eclipse.cdt.internal.core.dom.parser;
import com.ibm.icu.text.MessageFormat;
import org.eclipse.cdt.core.dom.ILinkage; import org.eclipse.cdt.core.dom.ILinkage;
import org.eclipse.cdt.core.dom.IName; import org.eclipse.cdt.core.dom.IName;
import org.eclipse.cdt.core.dom.ast.DOMException; import org.eclipse.cdt.core.dom.ast.DOMException;
@ -32,12 +34,10 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.cdt.internal.core.parser.ParserMessages; import org.eclipse.cdt.internal.core.parser.ParserMessages;
import org.eclipse.core.runtime.PlatformObject; import org.eclipse.core.runtime.PlatformObject;
import com.ibm.icu.text.MessageFormat;
/** /**
* Implementation of problem bindings * Implementation of problem bindings
*/ */
public class ProblemBinding extends PlatformObject implements IProblemBinding, IType, IScope, IASTInternalScope { public class ProblemBinding extends PlatformObject implements IProblemBinding, IASTInternalScope {
protected final int id; protected final int id;
protected char[] arg; protected char[] arg;
protected IASTNode node; protected IASTNode node;

View file

@ -23,7 +23,6 @@ import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTCompletionContext; import org.eclipse.cdt.core.dom.ast.IASTCompletionContext;
import org.eclipse.cdt.core.dom.ast.IASTExpression; import org.eclipse.cdt.core.dom.ast.IASTExpression;
import org.eclipse.cdt.core.dom.ast.IASTImplicitName; import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode; import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IBinding;
@ -42,11 +41,8 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics; import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil; import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
/** public class CPPASTFieldReference extends ASTNode implements ICPPASTFieldReference, IASTAmbiguityParent,
* @author jcamelon IASTCompletionContext {
*/
public class CPPASTFieldReference extends ASTNode implements
ICPPASTFieldReference, IASTAmbiguityParent, IASTCompletionContext, IASTImplicitNameOwner {
private boolean isTemplate; private boolean isTemplate;
private IASTExpression owner; private IASTExpression owner;

View file

@ -53,9 +53,8 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
/** /**
* Represents a class template. * Represents a class template.
*/ */
public class CPPClassTemplate extends CPPTemplateDefinition implements public class CPPClassTemplate extends CPPTemplateDefinition implements ICPPClassTemplate,
ICPPClassTemplate, ICPPClassType, ICPPInternalClassTemplate, ICPPInternalClassTemplate, ICPPInternalClassTypeMixinHost {
ICPPInternalClassTypeMixinHost {
private ICPPClassTemplate fIndexBinding= null; private ICPPClassTemplate fIndexBinding= null;
private boolean checkedIndex= false; private boolean checkedIndex= false;

View file

@ -50,7 +50,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
/** /**
* Base class for c++-scopes of the ast. * Base class for c++-scopes of the ast.
*/ */
abstract public class CPPScope implements ICPPScope, ICPPASTInternalScope { abstract public class CPPScope implements ICPPASTInternalScope {
protected static final char[] CONSTRUCTOR_KEY = "!!!CTOR!!!".toCharArray(); //$NON-NLS-1$ protected static final char[] CONSTRUCTOR_KEY = "!!!CTOR!!!".toCharArray(); //$NON-NLS-1$
private static final IProgressMonitor NPM = new NullProgressMonitor(); private static final IProgressMonitor NPM = new NullProgressMonitor();
private IASTNode physicalNode; private IASTNode physicalNode;
@ -78,7 +78,7 @@ abstract public class CPPScope implements ICPPScope, ICPPASTInternalScope {
return physicalNode; return physicalNode;
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public void addName(IASTName name) throws DOMException { public void addName(IASTName name) throws DOMException {
// don't add inactive names to the scope // don't add inactive names to the scope
if (!name.isActive()) if (!name.isActive())
@ -239,8 +239,8 @@ abstract public class CPPScope implements ICPPScope, ICPPASTInternalScope {
if (prefixLookup) { if (prefixLookup) {
Object[] keys = bindings != null ? bindings.keyArray() : new Object[0]; Object[] keys = bindings != null ? bindings.keyArray() : new Object[0];
ObjectSet<Object> all= new ObjectSet<Object>(16); ObjectSet<Object> all= new ObjectSet<Object>(16);
for (int i = 0; i < keys.length; i++) { for (Object key2 : keys) {
final char[] key = (char[]) keys[i]; final char[] key = (char[]) key2;
if (key != CONSTRUCTOR_KEY && CharArrayUtils.equals(key, 0, c.length, c, true)) { if (key != CONSTRUCTOR_KEY && CharArrayUtils.equals(key, 0, c.length, c, true)) {
obj= bindings.get(key); obj= bindings.get(key);
if (obj instanceof ObjectSet<?>) { if (obj instanceof ObjectSet<?>) {
@ -318,7 +318,7 @@ abstract public class CPPScope implements ICPPScope, ICPPASTInternalScope {
return CPPSemantics.findBindings(this, name, false); return CPPSemantics.findBindings(this, name, false);
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public void addBinding(IBinding binding) { public void addBinding(IBinding binding) {
if (bindings == null) if (bindings == null)
bindings = new CharArrayObjectMap(1); bindings = new CharArrayObjectMap(1);

View file

@ -44,7 +44,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
* A template template parameter. * A template template parameter.
*/ */
public class CPPTemplateTemplateParameter extends CPPTemplateParameter implements public class CPPTemplateTemplateParameter extends CPPTemplateParameter implements
ICPPTemplateTemplateParameter, ICPPClassType, ICPPInternalTemplate, ICPPUnknownBinding, ICPPTemplateTemplateParameter, ICPPInternalTemplate, ICPPUnknownBinding,
ICPPUnknownType { ICPPUnknownType {
private ICPPTemplateParameter[] templateParameters; private ICPPTemplateParameter[] templateParameters;

View file

@ -29,7 +29,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateId;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTypenameExpression; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTypenameExpression;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDeclaration; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDeclaration;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding; import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
import org.eclipse.cdt.core.index.IIndexFileSet; import org.eclipse.cdt.core.index.IIndexFileSet;
import org.eclipse.cdt.core.parser.util.CharArrayObjectMap; import org.eclipse.cdt.core.parser.util.CharArrayObjectMap;
@ -39,7 +38,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
* Models the scope represented by an unknown binding such (e.g.: template type parameter). Used within * Models the scope represented by an unknown binding such (e.g.: template type parameter). Used within
* the context of templates, only. * the context of templates, only.
*/ */
public class CPPUnknownScope implements ICPPScope, ICPPInternalUnknownScope { public class CPPUnknownScope implements ICPPInternalUnknownScope {
private final ICPPUnknownBinding binding; private final ICPPUnknownBinding binding;
private final IASTName scopeName; private final IASTName scopeName;
private CharArrayObjectMap map; private CharArrayObjectMap map;

View file

@ -55,7 +55,7 @@ public class CPPTypedefClone implements ITypedef, ITypeContainer, IIndexType, IC
return delegate.getOwner(); return delegate.getOwner();
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
return delegate.getAdapter(adapter); return delegate.getAdapter(adapter);
} }

View file

@ -59,7 +59,7 @@ public abstract class CompositeIndexBinding implements IIndexBinding {
return rbinding.getNameCharArray(); return rbinding.getNameCharArray();
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.isInstance(rbinding)) { if (adapter.isInstance(rbinding)) {
return rbinding; return rbinding;

View file

@ -16,7 +16,7 @@ import org.eclipse.cdt.internal.core.index.IIndexType;
/** /**
* Represents an index-contexting carrying type * Represents an index-contexting carrying type
*/ */
public abstract class CompositeType implements IType, IIndexType { public abstract class CompositeType implements IIndexType {
protected final IType type; protected final IType type;
protected final ICompositesFactory cf; protected final ICompositesFactory cf;

View file

@ -14,7 +14,6 @@ package org.eclipse.cdt.internal.core.index.composite.cpp;
import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateArgument; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateArgument;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance; import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
@ -22,7 +21,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameterMap;
import org.eclipse.cdt.core.parser.util.ObjectMap; import org.eclipse.cdt.core.parser.util.ObjectMap;
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory; import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
public class CompositeCPPFunctionInstance extends CompositeCPPFunction implements ICPPTemplateInstance, ICPPSpecialization { public class CompositeCPPFunctionInstance extends CompositeCPPFunction implements ICPPTemplateInstance {
public CompositeCPPFunctionInstance(ICompositesFactory cf, ICPPFunction rbinding) { public CompositeCPPFunctionInstance(ICompositesFactory cf, ICPPFunction rbinding) {
super(cf, rbinding); super(cf, rbinding);

View file

@ -20,7 +20,9 @@ import org.eclipse.cdt.internal.core.util.ILRUCacheable;
* *
* Although the size of the CodeReaderCache is specified in terms of MB, the actual granularity of * Although the size of the CodeReaderCache is specified in terms of MB, the actual granularity of
* the cache is KB. * the cache is KB.
* @deprecated
*/ */
@Deprecated
class CodeReaderCacheEntry implements ILRUCacheable { class CodeReaderCacheEntry implements ILRUCacheable {
private static final double CHAR_TO_KB_FACTOR = 1024; private static final double CHAR_TO_KB_FACTOR = 1024;

View file

@ -12,9 +12,7 @@ package org.eclipse.cdt.internal.core.parser;
import java.io.IOException; import java.io.IOException;
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
import org.eclipse.cdt.core.index.IIndexFileLocation; import org.eclipse.cdt.core.index.IIndexFileLocation;
import org.eclipse.cdt.core.parser.ICodeReaderCache;
import org.eclipse.cdt.core.parser.IncludeFileContentProvider; import org.eclipse.cdt.core.parser.IncludeFileContentProvider;
import org.eclipse.cdt.internal.core.dom.AbstractCodeReaderFactory; import org.eclipse.cdt.internal.core.dom.AbstractCodeReaderFactory;
import org.eclipse.cdt.internal.core.parser.scanner.InternalFileContentProvider; import org.eclipse.cdt.internal.core.parser.scanner.InternalFileContentProvider;
@ -26,7 +24,7 @@ public class CodeReaderFactoryAdapter extends AbstractCodeReaderFactory {
* @deprecated avoid using the adapter, its for backwards compatibility, only. * @deprecated avoid using the adapter, its for backwards compatibility, only.
*/ */
@Deprecated @Deprecated
public static ICodeReaderFactory adapt(IncludeFileContentProvider fileCreator) { public static org.eclipse.cdt.core.dom.ICodeReaderFactory adapt(IncludeFileContentProvider fileCreator) {
if (fileCreator == null) if (fileCreator == null)
return null; return null;
@ -62,7 +60,8 @@ public class CodeReaderFactoryAdapter extends AbstractCodeReaderFactory {
return CodeReaderAdapter.adapt(fDelegate.getContentForInclusion(path)); return CodeReaderAdapter.adapt(fDelegate.getContentForInclusion(path));
} }
public ICodeReaderCache getCodeReaderCache() { @Deprecated
public org.eclipse.cdt.core.parser.ICodeReaderCache getCodeReaderCache() {
return null; return null;
} }

View file

@ -19,7 +19,9 @@ import org.eclipse.cdt.internal.core.util.OverflowingLRUCache;
* *
* It uses CodeReaderCacheEntry (which implements ILRUCacheable) to specify that the size of * It uses CodeReaderCacheEntry (which implements ILRUCacheable) to specify that the size of
* the cache should be relative to the size of the entries and not the number of entries. * the cache should be relative to the size of the entries and not the number of entries.
* @deprecated
*/ */
@Deprecated
public class CodeReaderLRUCache extends OverflowingLRUCache<String, CodeReaderCacheEntry> { public class CodeReaderLRUCache extends OverflowingLRUCache<String, CodeReaderCacheEntry> {

View file

@ -13,7 +13,6 @@ package org.eclipse.cdt.internal.core.parser;
import java.io.IOException; import java.io.IOException;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
import org.eclipse.cdt.core.index.IIndexFileLocation; import org.eclipse.cdt.core.index.IIndexFileLocation;
import org.eclipse.cdt.core.parser.FileContent; import org.eclipse.cdt.core.parser.FileContent;
import org.eclipse.cdt.internal.core.dom.AbstractCodeReaderFactory; import org.eclipse.cdt.internal.core.dom.AbstractCodeReaderFactory;
@ -28,7 +27,7 @@ public class FileContentProviderAdapter extends InternalFileContentProvider {
* @deprecated avoid using the adapter, its for backwards compatibility, only. * @deprecated avoid using the adapter, its for backwards compatibility, only.
*/ */
@Deprecated @Deprecated
public static InternalFileContentProvider adapt(ICodeReaderFactory fileCreator) { public static InternalFileContentProvider adapt(org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator) {
if (fileCreator == null) if (fileCreator == null)
return null; return null;
@ -47,7 +46,11 @@ public class FileContentProviderAdapter extends InternalFileContentProvider {
setIncludeResolutionHeuristics((IIncludeFileResolutionHeuristics) factory.getAdapter(IIncludeFileResolutionHeuristics.class)); setIncludeResolutionHeuristics((IIncludeFileResolutionHeuristics) factory.getAdapter(IIncludeFileResolutionHeuristics.class));
} }
public ICodeReaderFactory getCodeReaderFactory() { /**
* @deprecated avoid using the adapter, its for backwards compatibility, only.
*/
@Deprecated
public org.eclipse.cdt.core.dom.ICodeReaderFactory getCodeReaderFactory() {
return fDelegate; return fDelegate;
} }

View file

@ -1555,7 +1555,7 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable {
return true; return true;
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "rawtypes", "unchecked" })
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(fMacroExpander.getClass())) { if (adapter.isAssignableFrom(fMacroExpander.getClass())) {
return fMacroExpander; return fMacroExpander;

View file

@ -67,7 +67,7 @@ abstract class PreprocessorMacro implements IMacroBinding {
return null; return null;
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Class clazz) { public Object getAdapter(Class clazz) {
return null; return null;
} }

View file

@ -192,7 +192,7 @@ public class PDOMProxy implements IPDOM {
fDelegate.resetCacheCounters(); fDelegate.resetCacheCounters();
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "rawtypes", "unchecked" })
public synchronized Object getAdapter(Class adapter) { public synchronized Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(PDOMProxy.class)) { if (adapter.isAssignableFrom(PDOMProxy.class)) {
return this; return this;

View file

@ -237,7 +237,7 @@ public class PDOMASTAdapter {
throw new PDOMNotImplementedError(); throw new PDOMNotImplementedError();
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
return fDelegate.getAdapter(adapter); return fDelegate.getAdapter(adapter);
} }
@ -289,7 +289,7 @@ public class PDOMASTAdapter {
return fDelegate.findField(name); return fDelegate.findField(name);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
return fDelegate.getAdapter(adapter); return fDelegate.getAdapter(adapter);
} }
@ -375,7 +375,7 @@ public class PDOMASTAdapter {
return qn; return qn;
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
return fDelegate.getAdapter(adapter); return fDelegate.getAdapter(adapter);
} }

View file

@ -61,7 +61,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding
super(linkage, record); super(linkage, record);
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(PDOMBinding.class)) if (adapter.isAssignableFrom(PDOMBinding.class))
return this; return this;

View file

@ -356,7 +356,7 @@ public class PDOMMacro implements IIndexMacro, IPDOMBinding, IASTFileLocation {
return null; return null;
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(PDOMMacro.class)) { if (adapter.isAssignableFrom(PDOMMacro.class)) {
return this; return this;

View file

@ -163,7 +163,7 @@ public class PDOMMacroContainer extends PDOMNamedNode implements IIndexMacroCont
return new String(getNameCharArray()); return new String(getNameCharArray());
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(PDOMMacroContainer.class)) { if (adapter.isAssignableFrom(PDOMMacroContainer.class)) {
return this; return this;

View file

@ -92,7 +92,7 @@ final class PDOMCParameter extends PDOMNamedNode implements IParameter, IPDOMBin
throw new PDOMNotImplementedError(); throw new PDOMNotImplementedError();
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
return null; return null;
} }

View file

@ -38,7 +38,6 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPClassSpecializationScope; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPClassSpecializationScope;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates; import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates;
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants; import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
import org.eclipse.cdt.internal.core.index.IIndexType;
import org.eclipse.cdt.internal.core.pdom.db.PDOMNodeLinkedList; import org.eclipse.cdt.internal.core.pdom.db.PDOMNodeLinkedList;
import org.eclipse.cdt.internal.core.pdom.dom.IPDOMMemberOwner; import org.eclipse.cdt.internal.core.pdom.dom.IPDOMMemberOwner;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding; import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
@ -51,7 +50,7 @@ import org.eclipse.core.runtime.CoreException;
* @author Bryan Wilkinson * @author Bryan Wilkinson
*/ */
class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
ICPPClassSpecialization, IPDOMMemberOwner, IIndexType, IPDOMCPPClassType { ICPPClassSpecialization, IPDOMMemberOwner, IPDOMCPPClassType {
private static final int FIRSTBASE = PDOMCPPSpecialization.RECORD_SIZE + 0; private static final int FIRSTBASE = PDOMCPPSpecialization.RECORD_SIZE + 0;
private static final int MEMBERLIST = PDOMCPPSpecialization.RECORD_SIZE + 4; private static final int MEMBERLIST = PDOMCPPSpecialization.RECORD_SIZE + 4;

View file

@ -31,7 +31,7 @@ import org.eclipse.cdt.core.IErrorParserNamed;
* @see IErrorParser * @see IErrorParser
* @since 5.2 * @since 5.2
*/ */
public class RegexErrorParser implements IErrorParserNamed, Cloneable { public class RegexErrorParser implements IErrorParserNamed {
private String fId; private String fId;
private String fName; private String fName;
private final List<RegexErrorPattern> fPatterns= new ArrayList<RegexErrorPattern>(); private final List<RegexErrorPattern> fPatterns= new ArrayList<RegexErrorPattern>();

View file

@ -424,7 +424,7 @@ public class UserDefinedVariableSupplier extends CoreMacroSupplierBase {
newSetCopy.removeAll(newSet); newSetCopy.removeAll(newSet);
HashSet modifiedSet = new HashSet(newSetCopy.size()); HashSet<VarKey> modifiedSet = new HashSet<VarKey>(newSetCopy.size());
for (Object element : newSetCopy) { for (Object element : newSetCopy) {
VarKey key = (VarKey)element; VarKey key = (VarKey)element;
modifiedSet.add(new VarKey(key.getVariable(), false)); modifiedSet.add(new VarKey(key.getVariable(), false));

View file

@ -29,7 +29,7 @@ public abstract class AbstractCodeReaderFactory implements ICodeReaderFactory, I
fHeuristics= heuristics; fHeuristics= heuristics;
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(IIncludeFileResolutionHeuristics.class)) { if (adapter.isAssignableFrom(IIncludeFileResolutionHeuristics.class)) {
return fHeuristics; return fHeuristics;

View file

@ -326,7 +326,7 @@ public class CygwinPEBinaryObject extends PEBinaryObject {
* *
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter == Addr2line.class) { if (adapter == Addr2line.class) {

View file

@ -69,7 +69,7 @@ public class CygwinPEParser extends PEParser {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(ICygwinToolsFactroy.class)) { if (adapter.isAssignableFrom(ICygwinToolsFactroy.class)) {

View file

@ -102,7 +102,7 @@ public class PEBinaryObject extends BinaryObjectAdapter {
return info; return info;
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.equals(PE.class)) { if (adapter.equals(PE.class)) {
@ -177,14 +177,14 @@ public class PEBinaryObject extends BinaryObjectAdapter {
} }
protected void addSymbols(Coff.Symbol[] peSyms, byte[] table, List<Symbol> list) { protected void addSymbols(Coff.Symbol[] peSyms, byte[] table, List<Symbol> list) {
for (int i = 0; i < peSyms.length; i++) { for (org.eclipse.cdt.utils.coff.Coff.Symbol peSym : peSyms) {
if (peSyms[i].isFunction() || peSyms[i].isPointer() || peSyms[i].isArray()) { if (peSym.isFunction() || peSym.isPointer() || peSym.isArray()) {
String name = peSyms[i].getName(table); String name = peSym.getName(table);
if (name == null || name.trim().length() == 0 || !Character.isJavaIdentifierStart(name.charAt(0))) { if (name == null || name.trim().length() == 0 || !Character.isJavaIdentifierStart(name.charAt(0))) {
continue; continue;
} }
int type = peSyms[i].isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE; int type = peSym.isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE;
list.add(new Symbol(this, name, type, new Addr32(peSyms[i].n_value), 1)); list.add(new Symbol(this, name, type, new Addr32(peSym.n_value), 1));
} }
} }
} }

View file

@ -16,7 +16,7 @@ import java.util.Comparator;
/** /**
* @deprecated This class is slated for removal, it is not used by the CDT classes * @deprecated This class is slated for removal, it is not used by the CDT classes
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Deprecated @Deprecated
public class SymbolSortCompare implements Comparator { public class SymbolSortCompare implements Comparator {
public int compare( Object o1, Object o2 ) { public int compare( Object o1, Object o2 ) {

View file

@ -69,7 +69,7 @@ public class ElfBinaryArchive extends BinaryFile implements IBinaryArchive {
/** /**
* @deprecated use {@link ElfBinaryArchive#createArchiveMembers(ARHeader[])} * @deprecated use {@link ElfBinaryArchive#createArchiveMembers(ARHeader[])}
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
@Deprecated @Deprecated
protected void addArchiveMembers(ARHeader[] headers, ArrayList children) { protected void addArchiveMembers(ARHeader[] headers, ArrayList children) {
IBinaryObject[] bobjs= createArchiveMembers(headers); IBinaryObject[] bobjs= createArchiveMembers(headers);

View file

@ -181,20 +181,20 @@ public class ElfBinaryObject extends BinaryObjectAdapter {
} }
protected void addSymbols(Elf.Symbol[] array, int type, List<Symbol> list) { protected void addSymbols(Elf.Symbol[] array, int type, List<Symbol> list) {
for (int i = 0; i < array.length; i++) { for (org.eclipse.cdt.utils.elf.Elf.Symbol element : array) {
// Multiple function symbol entries for the same address are generated // Multiple function symbol entries for the same address are generated
// do not add duplicate symbols with 0 size to the list // do not add duplicate symbols with 0 size to the list
boolean duplicateAddressFound = false; boolean duplicateAddressFound = false;
if (type == ISymbol.FUNCTION && array[i].st_size == 0){ if (type == ISymbol.FUNCTION && element.st_size == 0){
for (Symbol s : list) { for (Symbol s : list) {
if (s.getAddress().equals(array[i].st_value)){ if (s.getAddress().equals(element.st_value)){
duplicateAddressFound = true; duplicateAddressFound = true;
break; break;
} }
} }
} }
if (!duplicateAddressFound) if (!duplicateAddressFound)
list.add(new Symbol(this, array[i].toString(), type, array[i].st_value, array[i].st_size)); list.add(new Symbol(this, element.toString(), type, element.st_value, element.st_size));
} }
} }
@ -202,7 +202,7 @@ public class ElfBinaryObject extends BinaryObjectAdapter {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.equals(Elf.class)) { if (adapter.equals(Elf.class)) {

View file

@ -169,8 +169,8 @@ public class GNUElfBinaryObject extends ElfBinaryObject {
*/ */
@Override @Override
protected void addSymbols(Elf.Symbol[] array, int type, List<Symbol> list) { protected void addSymbols(Elf.Symbol[] array, int type, List<Symbol> list) {
for (int i = 0; i < array.length; i++) { for (org.eclipse.cdt.utils.elf.Elf.Symbol element : array) {
String name = array[i].toString(); String name = element.toString();
if (symbolLoadingCPPFilt != null) { if (symbolLoadingCPPFilt != null) {
try { try {
name = symbolLoadingCPPFilt.getFunction(name); name = symbolLoadingCPPFilt.getFunction(name);
@ -179,8 +179,8 @@ public class GNUElfBinaryObject extends ElfBinaryObject {
symbolLoadingCPPFilt = null; symbolLoadingCPPFilt = null;
} }
} }
IAddress addr = array[i].st_value; IAddress addr = element.st_value;
long size = array[i].st_size; long size = element.st_size;
if (symbolLoadingAddr2line != null) { if (symbolLoadingAddr2line != null) {
try { try {
String filename = symbolLoadingAddr2line.getFileName(addr); String filename = symbolLoadingAddr2line.getFileName(addr);
@ -207,7 +207,7 @@ public class GNUElfBinaryObject extends ElfBinaryObject {
* *
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter == Addr2line.class) { if (adapter == Addr2line.class) {

View file

@ -78,7 +78,7 @@ public class GNUElfParser extends ElfParser {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.equals(IGnuToolFactory.class)) { if (adapter.equals(IGnuToolFactory.class)) {

View file

@ -397,7 +397,7 @@ public class MachOBinaryObject extends BinaryObjectAdapter {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.equals(MachO.class)) { if (adapter.equals(MachO.class)) {

View file

@ -413,7 +413,7 @@ public class MachOBinaryObject64 extends BinaryObjectAdapter {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.equals(MachO64.class)) { if (adapter.equals(MachO64.class)) {

View file

@ -197,14 +197,14 @@ public class SOMBinaryObject extends BinaryObjectAdapter {
protected void addSymbols(SOM.Symbol[] peSyms, byte[] table, List<Symbol> list) { protected void addSymbols(SOM.Symbol[] peSyms, byte[] table, List<Symbol> list) {
CPPFilt cppfilt = getCPPFilt(); CPPFilt cppfilt = getCPPFilt();
Addr2line addr2line = getAddr2line(false); Addr2line addr2line = getAddr2line(false);
for (int i = 0; i < peSyms.length; i++) { for (org.eclipse.cdt.utils.som.SOM.Symbol peSym : peSyms) {
if (peSyms[i].isFunction() || peSyms[i].isVariable()) { if (peSym.isFunction() || peSym.isVariable()) {
String name = peSyms[i].getName(table); String name = peSym.getName(table);
if (name == null || name.trim().length() == 0 || !Character.isJavaIdentifierStart(name.charAt(0))) { if (name == null || name.trim().length() == 0 || !Character.isJavaIdentifierStart(name.charAt(0))) {
continue; continue;
} }
int type = peSyms[i].isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE; int type = peSym.isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE;
IAddress addr = new Addr32(peSyms[i].symbol_value); IAddress addr = new Addr32(peSym.symbol_value);
int size = 4; int size = 4;
if (cppfilt != null) { if (cppfilt != null) {
try { try {
@ -314,7 +314,7 @@ public class SOMBinaryObject extends BinaryObjectAdapter {
* *
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter == Addr2line.class) { if (adapter == Addr2line.class) {

View file

@ -155,7 +155,7 @@ public class SOMParser extends AbstractCExtension implements IBinaryParser {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.equals(IGnuToolFactory.class)) { if (adapter.equals(IGnuToolFactory.class)) {

View file

@ -173,7 +173,7 @@ public class XCOFF32Parser extends AbstractCExtension implements IBinaryParser {
* *
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.equals(IGnuToolFactory.class)) { if (adapter.equals(IGnuToolFactory.class)) {

View file

@ -306,7 +306,7 @@ public class XCOFFBinaryObject extends BinaryObjectAdapter {
* *
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter == Addr2line.class) { if (adapter == Addr2line.class) {

View file

@ -54,7 +54,7 @@ public class CElementAdapterFactory implements IAdapterFactory {
/** /**
* @see CElementAdapterFactory#getAdapter * @see CElementAdapterFactory#getAdapter
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public Object getAdapter(Object element, Class key) { public Object getAdapter(Object element, Class key) {
ICElement celem = (ICElement) element; ICElement celem = (ICElement) element;

View file

@ -28,7 +28,7 @@ public class CProjectAdapterFactory implements IAdapterFactory {
/* /*
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Object adaptableObject, Class adapterType) { public Object getAdapter(Object adaptableObject, Class adapterType) {
if (IProject.class.equals(adapterType)) { if (IProject.class.equals(adapterType)) {
return ((ICProject)adaptableObject).getProject(); return ((ICProject)adaptableObject).getProject();

View file

@ -40,7 +40,7 @@ public class ResourceAdapterFactory implements IAdapterFactory {
/** /**
* @see IAdapterFactory#getAdapter * @see IAdapterFactory#getAdapter
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Object element, Class key) { public Object getAdapter(Object element, Class key) {
if (ICElement.class.equals(key)) { if (ICElement.class.equals(key)) {
//try { //try {

View file

@ -477,7 +477,7 @@ public class BuildConsolePage extends Page
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Class required) { public Object getAdapter(Class required) {
if (IFindReplaceTarget.class.equals(required)) { if (IFindReplaceTarget.class.equals(required)) {
return getViewer().getFindReplaceTarget(); return getViewer().getFindReplaceTarget();

View file

@ -155,7 +155,7 @@ public class CHNode implements IAdaptable {
return fFileOfReferences; return fFileOfReferences;
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(ICElement.class)) { if (adapter.isAssignableFrom(ICElement.class)) {
return getRepresentedDeclaration(); return getRepresentedDeclaration();

View file

@ -92,7 +92,7 @@ public class OpenCallHierarchyAction extends SelectionDispatchAction {
return false; return false;
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
private Object getAdapter(Object object, Class desiredClass) { private Object getAdapter(Object object, Class desiredClass) {
if (desiredClass.isInstance(object)) { if (desiredClass.isInstance(object)) {
return object; return object;

View file

@ -313,7 +313,7 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
/** /**
* Answer the property defined by key. * Answer the property defined by key.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class key) { public Object getAdapter(Class key) {
if (key.equals(ISelectionProvider.class)) { if (key.equals(ISelectionProvider.class)) {
@ -936,8 +936,8 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
if (childMem != null) { if (childMem != null) {
ArrayList<ICElement> elements = new ArrayList<ICElement>(); ArrayList<ICElement> elements = new ArrayList<ICElement>();
IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT); IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT);
for (int i = 0; i < elementMem.length; i++) { for (IMemento element2 : elementMem) {
String p = elementMem[i].getString(TAG_PATH); String p = element2.getString(TAG_PATH);
if (p != null) { if (p != null) {
IPath path = new Path(p); IPath path = new Path(p);
ICElement element = factory.create(path); ICElement element = factory.create(path);
@ -952,8 +952,8 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
if (childMem != null) { if (childMem != null) {
ArrayList<ICElement> list = new ArrayList<ICElement>(); ArrayList<ICElement> list = new ArrayList<ICElement>();
IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT); IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT);
for (int i = 0; i < elementMem.length; i++) { for (IMemento element2 : elementMem) {
String p = elementMem[i].getString(TAG_PATH); String p = element2.getString(TAG_PATH);
if (p != null) { if (p != null) {
IPath path = new Path(p); IPath path = new Path(p);
ICElement element = factory.create(path); ICElement element = factory.create(path);
@ -1005,8 +1005,8 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
Object expandedElements[] = viewer.getExpandedElements(); Object expandedElements[] = viewer.getExpandedElements();
if (expandedElements.length > 0) { if (expandedElements.length > 0) {
IMemento expandedMem = memento.createChild(TAG_EXPANDED); IMemento expandedMem = memento.createChild(TAG_EXPANDED);
for (int i = 0; i < expandedElements.length; i++) { for (Object expandedElement : expandedElements) {
Object o = expandedElements[i]; Object o = expandedElement;
// Do not save expanded binary files are libraries. // Do not save expanded binary files are libraries.
if (o instanceof IParent if (o instanceof IParent
&& !(o instanceof IArchiveContainer || o instanceof IBinaryContainer || o instanceof IBinary || o instanceof IArchive)) { && !(o instanceof IArchiveContainer || o instanceof IBinaryContainer || o instanceof IBinary || o instanceof IArchive)) {
@ -1024,9 +1024,9 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
Object elements[] = ((IStructuredSelection) viewer.getSelection()).toArray(); Object elements[] = ((IStructuredSelection) viewer.getSelection()).toArray();
if (elements.length > 0) { if (elements.length > 0) {
IMemento selectionMem = memento.createChild(TAG_SELECTION); IMemento selectionMem = memento.createChild(TAG_SELECTION);
for (int i = 0; i < elements.length; i++) { for (Object element : elements) {
if (elements[i] instanceof ICElement) { if (element instanceof ICElement) {
ICElement e = (ICElement) elements[i]; ICElement e = (ICElement) element;
IResource r = e.getResource(); IResource r = e.getResource();
if (r != null && r.getLocation() != null) { if (r != null && r.getLocation() != null) {
IMemento elementMem = selectionMem.createChild(TAG_ELEMENT); IMemento elementMem = selectionMem.createChild(TAG_ELEMENT);

View file

@ -40,7 +40,7 @@ public class IncludeRefContainer extends CElementGrouping {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter == IWorkbenchAdapter.class) { if (adapter == IWorkbenchAdapter.class) {

View file

@ -44,7 +44,7 @@ public class LibraryRefContainer extends CElementGrouping {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter == IWorkbenchAdapter.class) { if (adapter == IWorkbenchAdapter.class) {
@ -64,11 +64,11 @@ public class LibraryRefContainer extends CElementGrouping {
try { try {
ILibraryReference[] references = fCProject.getLibraryReferences(); ILibraryReference[] references = fCProject.getLibraryReferences();
ArrayList<ILibraryReference> list = new ArrayList<ILibraryReference>(references.length); ArrayList<ILibraryReference> list = new ArrayList<ILibraryReference>(references.length);
for (int i = 0; i < references.length; i++) { for (ILibraryReference reference : references) {
IPath path = references[i].getPath(); IPath path = reference.getPath();
IFile file = references[i].getCModel().getWorkspace().getRoot().getFileForLocation(path); IFile file = reference.getCModel().getWorkspace().getRoot().getFileForLocation(path);
if (file == null || !file.isAccessible()) { if (file == null || !file.isAccessible()) {
list.add(references[i]); list.add(reference);
} }
} }
return list.toArray(); return list.toArray();

View file

@ -47,7 +47,7 @@ public class CPathContainerDescriptor implements IContainerDescriptor {
* @deprecated * @deprecated
*/ */
@Deprecated @Deprecated
public static class PathEntryContainerPageAdapter implements IWizardPage, IPathEntryContainerPage { public static class PathEntryContainerPageAdapter implements IPathEntryContainerPage {
public static IPathEntryContainerPage createAdapter(Object elem) { public static IPathEntryContainerPage createAdapter(Object elem) {
if (elem instanceof org.eclipse.cdt.ui.wizards.ICPathContainerPage) { if (elem instanceof org.eclipse.cdt.ui.wizards.ICPathContainerPage) {
return new PathEntryContainerPageAdapter((org.eclipse.cdt.ui.wizards.ICPathContainerPage) elem); return new PathEntryContainerPageAdapter((org.eclipse.cdt.ui.wizards.ICPathContainerPage) elem);
@ -341,9 +341,9 @@ public class CPathContainerDescriptor implements IContainerDescriptor {
String defaultPageName = CPathContainerDefaultPage.class.getName(); String defaultPageName = CPathContainerDefaultPage.class.getName();
IConfigurationElement[] elements = extensionPoint.getConfigurationElements(); IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
for (int i = 0; i < elements.length; i++) { for (IConfigurationElement element : elements) {
try { try {
CPathContainerDescriptor curr = new CPathContainerDescriptor(elements[i]); CPathContainerDescriptor curr = new CPathContainerDescriptor(element);
if (defaultPageName.equals(curr.getPageClass())) { if (defaultPageName.equals(curr.getPageClass())) {
defaultPage = curr; defaultPage = curr;
} else { } else {

View file

@ -281,7 +281,7 @@ public abstract class AbstractCModelOutlinePage extends Page implements IContent
/* /*
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Class key) { public Object getAdapter(Class key) {
if (key == IShowInSource.class) { if (key == IShowInSource.class) {
return getShowInSource(); return getShowInSource();

View file

@ -651,7 +651,7 @@ public class CDocumentProvider extends TextFileDocumentProvider {
* @see AnnotationModel#addAnnotation(Annotation, Position, boolean) * @see AnnotationModel#addAnnotation(Annotation, Position, boolean)
*/ */
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
protected void addAnnotation(Annotation annotation, Position position, boolean fireModelChanged) throws BadLocationException { protected void addAnnotation(Annotation annotation, Position position, boolean fireModelChanged) throws BadLocationException {
super.addAnnotation(annotation, position, fireModelChanged); super.addAnnotation(annotation, position, fireModelChanged);

View file

@ -1493,7 +1493,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
/** /**
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class required) { public Object getAdapter(Class required) {
if (IContentOutlinePage.class.equals(required)) { if (IContentOutlinePage.class.equals(required)) {
@ -2527,7 +2527,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
if (model == null) if (model == null)
return null; return null;
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
Iterator parent; Iterator parent;
if (model instanceof IAnnotationModelExtension2) { if (model instanceof IAnnotationModelExtension2) {
parent= ((IAnnotationModelExtension2)model).getAnnotationIterator(offset, length, true, true); parent= ((IAnnotationModelExtension2)model).getAnnotationIterator(offset, length, true, true);

View file

@ -544,7 +544,7 @@ public class DocumentAdapter implements IBuffer, IDocumentListener, IAdaptable {
} }
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(ITextFileBuffer.class)) { if (adapter.isAssignableFrom(ITextFileBuffer.class)) {
return fTextFileBuffer; return fTextFileBuffer;

View file

@ -126,7 +126,7 @@ public class AsmTextEditor extends TextEditor implements ISelectionChangedListen
/* /*
* @see org.eclipse.ui.editors.text.TextEditor#getAdapter(java.lang.Class) * @see org.eclipse.ui.editors.text.TextEditor#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (IContentOutlinePage.class.equals(adapter)) { if (IContentOutlinePage.class.equals(adapter)) {
@ -276,7 +276,7 @@ public class AsmTextEditor extends TextEditor implements ISelectionChangedListen
if (model == null) if (model == null)
return null; return null;
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
Iterator parent; Iterator parent;
if (model instanceof IAnnotationModelExtension2) { if (model instanceof IAnnotationModelExtension2) {
parent= ((IAnnotationModelExtension2)model).getAnnotationIterator(offset, length, true, true); parent= ((IAnnotationModelExtension2)model).getAnnotationIterator(offset, length, true, true);

View file

@ -297,7 +297,7 @@ public class CustomFiltersDialog extends SelectionDialog {
// ---------- result handling ---------- // ---------- result handling ----------
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
protected void setResult(List newResult) { protected void setResult(List newResult) {
super.setResult(newResult); super.setResult(newResult);

View file

@ -157,7 +157,7 @@ public class IBNode implements IAdaptable {
return fRepresentedFile.getName(); return fRepresentedFile.getName();
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (fRepresentedFile != null) { if (fRepresentedFile != null) {
if (adapter.isAssignableFrom(ITranslationUnit.class)) { if (adapter.isAssignableFrom(ITranslationUnit.class)) {

View file

@ -83,7 +83,7 @@ public class OpenIncludeBrowserAction extends SelectionDispatchAction {
return false; return false;
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
private Object getAdapter(Object object, Class desiredClass) { private Object getAdapter(Object object, Class desiredClass) {
if (desiredClass.isInstance(object)) { if (desiredClass.isInstance(object)) {
return object; return object;

View file

@ -273,7 +273,7 @@ public class CNavigatorContentProvider extends CViewContentProvider implements I
/* /*
* @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#getPipelinedChildren(java.lang.Object, java.util.Set) * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#getPipelinedChildren(java.lang.Object, java.util.Set)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public void getPipelinedChildren(Object parent, Set currentChildren) { public void getPipelinedChildren(Object parent, Set currentChildren) {
customizeCElements(getChildren(parent), currentChildren); customizeCElements(getChildren(parent), currentChildren);
} }
@ -281,7 +281,7 @@ public class CNavigatorContentProvider extends CViewContentProvider implements I
/* /*
* @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#getPipelinedElements(java.lang.Object, java.util.Set) * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#getPipelinedElements(java.lang.Object, java.util.Set)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public void getPipelinedElements(Object input, Set currentElements) { public void getPipelinedElements(Object input, Set currentElements) {
// only replace plain resource elements with custom elements // only replace plain resource elements with custom elements
// and avoid duplicating elements already customized // and avoid duplicating elements already customized

View file

@ -26,7 +26,7 @@ public abstract class CRefactoringContribution extends RefactoringContribution {
super(); super();
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Map retrieveArgumentMap(RefactoringDescriptor descriptor) { public Map retrieveArgumentMap(RefactoringDescriptor descriptor) {
if (descriptor instanceof CRefactoringDescription) { if (descriptor instanceof CRefactoringDescription) {

View file

@ -483,7 +483,7 @@ public class DocumentAdapter implements IBuffer, IAdaptable, IDocumentListener {
return fTextFileBuffer; return fTextFileBuffer;
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(ITextFileBuffer.class)) { if (adapter.isAssignableFrom(ITextFileBuffer.class)) {
return fTextFileBuffer; return fTextFileBuffer;

View file

@ -24,7 +24,7 @@ import org.eclipse.cdt.internal.ui.refactoring.CRefactoringContribution;
public class ExtractConstantRefactoringContribution extends public class ExtractConstantRefactoringContribution extends
CRefactoringContribution { CRefactoringContribution {
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
@Override @Override
public RefactoringDescriptor createDescriptor(String id, String project, public RefactoringDescriptor createDescriptor(String id, String project,
String description, String comment, Map arguments, int flags) String description, String comment, Map arguments, int flags)

View file

@ -23,7 +23,7 @@ import org.eclipse.cdt.internal.ui.refactoring.CRefactoringContribution;
*/ */
public class ExtractFunctionRefactoringContribution extends CRefactoringContribution { public class ExtractFunctionRefactoringContribution extends CRefactoringContribution {
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
@Override @Override
public RefactoringDescriptor createDescriptor(String id, String project, String description, public RefactoringDescriptor createDescriptor(String id, String project, String description,
String comment, Map arguments, int flags) throws IllegalArgumentException { String comment, Map arguments, int flags) throws IllegalArgumentException {

View file

@ -23,7 +23,7 @@ import org.eclipse.cdt.internal.ui.refactoring.CRefactoringContribution;
*/ */
public class ExtractLocalVariableRefactoringContribution extends CRefactoringContribution { public class ExtractLocalVariableRefactoringContribution extends CRefactoringContribution {
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
@Override @Override
public RefactoringDescriptor createDescriptor(String id, String project, String description, public RefactoringDescriptor createDescriptor(String id, String project, String description,
String comment, Map arguments, int flags) throws IllegalArgumentException { String comment, Map arguments, int flags) throws IllegalArgumentException {

View file

@ -23,7 +23,7 @@ import org.eclipse.cdt.internal.ui.refactoring.CRefactoringContribution;
*/ */
public class HideMethodRefactoringContribution extends CRefactoringContribution { public class HideMethodRefactoringContribution extends CRefactoringContribution {
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
@Override @Override
public RefactoringDescriptor createDescriptor(String id, String project, String description, public RefactoringDescriptor createDescriptor(String id, String project, String description,
String comment, Map arguments, int flags) throws IllegalArgumentException { String comment, Map arguments, int flags) throws IllegalArgumentException {

View file

@ -1337,8 +1337,8 @@ public class ASTManager {
} }
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
Collection coll= cflc[i]; Collection<?> coll= cflc[i];
for (Iterator iter = coll.iterator(); iter.hasNext();) { for (Iterator<?> iter = coll.iterator(); iter.hasNext();) {
boolean warn= false; boolean warn= false;
String msg= errs[i]; String msg= errs[i];
IBinding conflict = (IBinding) iter.next(); IBinding conflict = (IBinding) iter.next();

View file

@ -48,7 +48,7 @@ public class PDOMSearchElement implements IAdaptable {
return location; return location;
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public Object getAdapter(Class adapterType) { public Object getAdapter(Class adapterType) {
if (adapterType.isAssignableFrom(IFile.class)) { if (adapterType.isAssignableFrom(IFile.class)) {
String fullPath= location.getFullPath(); String fullPath= location.getFullPath();

View file

@ -40,7 +40,7 @@ public class HTMLAnnotationHover extends DefaultAnnotationHover {
/* /*
* Formats several message as HTML text. * Formats several message as HTML text.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
@Override @Override
protected String formatMultipleMessages(List messages) { protected String formatMultipleMessages(List messages) {
StringBuffer buffer= new StringBuffer(); StringBuffer buffer= new StringBuffer();

View file

@ -13,7 +13,6 @@
package org.eclipse.cdt.internal.ui.text.c.hover; package org.eclipse.cdt.internal.ui.text.c.hover;
import com.ibm.icu.text.MessageFormat;
import java.util.Iterator; import java.util.Iterator;
import org.eclipse.core.filebuffers.FileBuffers; import org.eclipse.core.filebuffers.FileBuffers;
@ -80,6 +79,8 @@ import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.texteditor.AnnotationPreference; import org.eclipse.ui.texteditor.AnnotationPreference;
import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess; import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess;
import com.ibm.icu.text.MessageFormat;
import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.internal.ui.CPluginImages; import org.eclipse.cdt.internal.ui.CPluginImages;
@ -207,8 +208,8 @@ public class AbstractAnnotationHover extends AbstractCEditorTextHover {
protected void disposeDeferredCreatedContent() { protected void disposeDeferredCreatedContent() {
Control[] children= fParent.getChildren(); Control[] children= fParent.getChildren();
for (int i= 0; i < children.length; i++) { for (Control element : children) {
children[i].dispose(); element.dispose();
} }
ToolBarManager toolBarManager= getToolBarManager(); ToolBarManager toolBarManager= getToolBarManager();
if (toolBarManager != null) if (toolBarManager != null)
@ -283,8 +284,8 @@ public class AbstractAnnotationHover extends AbstractCEditorTextHover {
if (control instanceof Composite) { if (control instanceof Composite) {
Control[] children= ((Composite) control).getChildren(); Control[] children= ((Composite) control).getChildren();
for (int i= 0; i < children.length; i++) { for (Control element : children) {
setColorAndFont(children[i], foreground, background, font); setColorAndFont(element, foreground, background, font);
} }
} }
} }
@ -658,7 +659,7 @@ public class AbstractAnnotationHover extends AbstractCEditorTextHover {
return null; return null;
try { try {
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
Iterator parent; Iterator parent;
if (model instanceof IAnnotationModelExtension2) if (model instanceof IAnnotationModelExtension2)
parent= ((IAnnotationModelExtension2) model).getAnnotationIterator(hoverRegion.getOffset(), hoverRegion.getLength(), true, true); parent= ((IAnnotationModelExtension2) model).getAnnotationIterator(hoverRegion.getOffset(), hoverRegion.getLength(), true, true);

View file

@ -375,7 +375,7 @@ public abstract class AbstractSpellDictionary implements ISpellDictionary {
if (bucket == null) { if (bucket == null) {
fHashBuckets.put(hash, word); fHashBuckets.put(hash, word);
} else if (bucket instanceof ArrayList<?>) { } else if (bucket instanceof ArrayList<?>) {
@SuppressWarnings("unchecked") @SuppressWarnings({"unchecked", "rawtypes"})
final ArrayList<Object> bucket2 = (ArrayList)bucket; final ArrayList<Object> bucket2 = (ArrayList)bucket;
bucket2.add(word); bucket2.add(word);
} else { } else {
@ -414,7 +414,7 @@ public abstract class AbstractSpellDictionary implements ISpellDictionary {
return true; return true;
return false; return false;
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
final ArrayList<String> candidateList= (ArrayList)candidates; final ArrayList<String> candidateList= (ArrayList)candidates;
if (candidateList.contains(word) || candidateList.contains(word.toLowerCase())) if (candidateList.contains(word) || candidateList.contains(word.toLowerCase()))
return true; return true;

View file

@ -76,7 +76,7 @@ public class OpenTypeHierarchyAction extends SelectionDispatchAction {
} }
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
private Object getAdapter(Object object, Class desiredClass) { private Object getAdapter(Object object, Class desiredClass) {
if (desiredClass.isInstance(object)) { if (desiredClass.isInstance(object)) {
return object; return object;

View file

@ -81,7 +81,7 @@ public class THNode implements IAdaptable {
return fElement; return fElement;
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(ICElement.class)) { if (adapter.isAssignableFrom(ICElement.class)) {
return getElement(); return getElement();

View file

@ -109,7 +109,7 @@ public final class ExternalEditorInput extends FileStoreEditorInput implements I
/* /*
* @see org.eclipse.ui.ide.FileStoreEditorInput#getAdapter(java.lang.Class) * @see org.eclipse.ui.ide.FileStoreEditorInput#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(ITranslationUnit.class) && unit != null) { if (adapter.isAssignableFrom(ITranslationUnit.class) && unit != null) {

View file

@ -48,7 +48,7 @@ public class PendingUpdateAdapter implements IWorkbenchAdapter, IAdaptable {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if (adapter == IWorkbenchAdapter.class) if (adapter == IWorkbenchAdapter.class)
return this; return this;

View file

@ -141,7 +141,7 @@ public class ResourceToItemsMapper {
} else if (existingMapping instanceof Item) { } else if (existingMapping instanceof Item) {
fResourceToItem.remove(resource); fResourceToItem.remove(resource);
} else { // List } else { // List
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
List<Item> list= (List) existingMapping; List<Item> list= (List) existingMapping;
list.remove(item); list.remove(item);
if (list.isEmpty()) { if (list.isEmpty()) {

View file

@ -69,7 +69,7 @@ public abstract class CElementGrouping extends WorkbenchAdapter implements IAdap
/* /*
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class)
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public Object getAdapter(Class clas) { public Object getAdapter(Class clas) {
if (clas == IWorkbenchAdapter.class) if (clas == IWorkbenchAdapter.class)
return this; return this;

View file

@ -39,7 +39,7 @@ public interface ICompletionContributor {
* @param proposals the current list of proposals. This method should add any additional * @param proposals the current list of proposals. This method should add any additional
* proposals to this list. * proposals to this list.
*/ */
@SuppressWarnings("unchecked") // no need to change, it's deprecated @SuppressWarnings("rawtypes") // no need to change, it's deprecated
void contributeCompletionProposals(ITextViewer viewer, void contributeCompletionProposals(ITextViewer viewer,
int offset, int offset,
IWorkingCopy workingCopy, IWorkingCopy workingCopy,

View file

@ -474,7 +474,7 @@ import org.eclipse.cdt.internal.ui.CPluginImages;
return IMG_ITEM; return IMG_ITEM;
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
public List filterItems(List items) { public List filterItems(List items) {
return items; return items;
} }