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)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class adapter) {
if (IBinaryArchive.class.equals(adapter)) {

View file

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

View file

@ -72,7 +72,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public Object getAdapter(Class adapter) {
// 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.IProgressMonitor;
public abstract class Openable extends Parent implements IOpenable, IBufferChangedListener {
public abstract class Openable extends Parent implements IOpenable {
protected IResource resource;

View file

@ -79,7 +79,7 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
}
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
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.ICodeReaderCache;
import org.eclipse.cdt.core.parser.IncludeFileContentProvider;
/**
* 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
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
* @deprecated replaced by {@link IncludeFileContentProvider}
*/
@Deprecated
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.
* @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

View file

@ -11,7 +11,6 @@
package org.eclipse.cdt.core.dom.ast.c;
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.
@ -19,8 +18,7 @@ import org.eclipse.cdt.core.dom.ast.IASTDeclarationListOwner;
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ICASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifier, ICASTDeclSpecifier,
IASTDeclarationListOwner {
public interface ICASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifier, ICASTDeclSpecifier {
/**
* @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.IASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclarationListOwner;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNameOwner;
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.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifier, ICPPASTDeclSpecifier,
IASTDeclarationListOwner {
public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifier, ICPPASTDeclSpecifier {
/**
* <code>k_class</code> C++ introduces the class concept for composite

View file

@ -50,7 +50,7 @@ public class GCCLanguage extends AbstractCLikeLanguage {
@Override
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
if (adapter == IPDOMLinkageFactory.class) {
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.IASTFunctionDeclarator;
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.
@ -23,7 +22,7 @@ import org.eclipse.cdt.core.dom.ast.IASTNameOwner;
* @noextend This interface is not intended to be extended 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

View file

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

View file

@ -15,7 +15,6 @@ package org.eclipse.cdt.core.dom.parser;
import java.util.ArrayList;
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.IASTCompletionNode;
import org.eclipse.cdt.core.dom.ast.IASTName;
@ -104,15 +103,16 @@ public abstract class AbstractCLikeLanguage extends AbstractLanguage implements
@Deprecated
public IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader,
IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, 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, ICodeReaderFactory codeReaderFactory, IIndex index, int options,
IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, IIndex index,
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
.adapt(codeReaderFactory), index, options, log);
}
@ -152,8 +152,8 @@ public abstract class AbstractCLikeLanguage extends AbstractLanguage implements
@Deprecated
public IASTCompletionNode getCompletionNode(org.eclipse.cdt.core.parser.CodeReader reader,
IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log,
int offset) throws CoreException {
IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, IIndex index,
IParserLogService log, int offset) throws CoreException {
return getCompletionNode(FileContent.adapt(reader), scanInfo, IncludeFileContentProvider
.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
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
.adapt(fileCreator), log);
}
@ -256,8 +257,8 @@ public abstract class AbstractCLikeLanguage extends AbstractLanguage implements
return cLanguageKeywords;
}
@SuppressWarnings("unchecked")
@Override
@SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
if(ICLanguageKeywords.class.equals(adapter))
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.
* @noimplement This interface is not intended to be implemented by clients.
* @deprecated
*/
@Deprecated
public interface ICodeReaderCache {
/**

View file

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

View file

@ -107,7 +107,7 @@ public abstract class ArrayUtil {
if (obj == null)
return array;
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[0] = obj;
return array;
@ -264,7 +264,7 @@ public abstract class ArrayUtil {
}
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);
System.arraycopy(source, 0, dest, 0, numToAdd);
return dest;

View file

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

View file

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

View file

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

View file

@ -13,6 +13,8 @@
*******************************************************************************/
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.IName;
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.core.runtime.PlatformObject;
import com.ibm.icu.text.MessageFormat;
/**
* 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 char[] arg;
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.IASTExpression;
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.IASTNode;
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.SemanticUtil;
/**
* @author jcamelon
*/
public class CPPASTFieldReference extends ASTNode implements
ICPPASTFieldReference, IASTAmbiguityParent, IASTCompletionContext, IASTImplicitNameOwner {
public class CPPASTFieldReference extends ASTNode implements ICPPASTFieldReference, IASTAmbiguityParent,
IASTCompletionContext {
private boolean isTemplate;
private IASTExpression owner;

View file

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

View file

@ -50,7 +50,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
/**
* 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$
private static final IProgressMonitor NPM = new NullProgressMonitor();
private IASTNode physicalNode;
@ -78,7 +78,7 @@ abstract public class CPPScope implements ICPPScope, ICPPASTInternalScope {
return physicalNode;
}
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public void addName(IASTName name) throws DOMException {
// don't add inactive names to the scope
if (!name.isActive())
@ -239,8 +239,8 @@ abstract public class CPPScope implements ICPPScope, ICPPASTInternalScope {
if (prefixLookup) {
Object[] keys = bindings != null ? bindings.keyArray() : new Object[0];
ObjectSet<Object> all= new ObjectSet<Object>(16);
for (int i = 0; i < keys.length; i++) {
final char[] key = (char[]) keys[i];
for (Object key2 : keys) {
final char[] key = (char[]) key2;
if (key != CONSTRUCTOR_KEY && CharArrayUtils.equals(key, 0, c.length, c, true)) {
obj= bindings.get(key);
if (obj instanceof ObjectSet<?>) {
@ -318,7 +318,7 @@ abstract public class CPPScope implements ICPPScope, ICPPASTInternalScope {
return CPPSemantics.findBindings(this, name, false);
}
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public void addBinding(IBinding binding) {
if (bindings == null)
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.
*/
public class CPPTemplateTemplateParameter extends CPPTemplateParameter implements
ICPPTemplateTemplateParameter, ICPPClassType, ICPPInternalTemplate, ICPPUnknownBinding,
ICPPTemplateTemplateParameter, ICPPInternalTemplate, ICPPUnknownBinding,
ICPPUnknownType {
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.ICPPASTUsingDeclaration;
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.index.IIndexFileSet;
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
* the context of templates, only.
*/
public class CPPUnknownScope implements ICPPScope, ICPPInternalUnknownScope {
public class CPPUnknownScope implements ICPPInternalUnknownScope {
private final ICPPUnknownBinding binding;
private final IASTName scopeName;
private CharArrayObjectMap map;

View file

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

View file

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

View file

@ -16,7 +16,7 @@ import org.eclipse.cdt.internal.core.index.IIndexType;
/**
* 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 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.IType;
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.ICPPTemplateDefinition;
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.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) {
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
* the cache is KB.
* @deprecated
*/
@Deprecated
class CodeReaderCacheEntry implements ILRUCacheable {
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 org.eclipse.cdt.core.dom.ICodeReaderFactory;
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.internal.core.dom.AbstractCodeReaderFactory;
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
public static ICodeReaderFactory adapt(IncludeFileContentProvider fileCreator) {
public static org.eclipse.cdt.core.dom.ICodeReaderFactory adapt(IncludeFileContentProvider fileCreator) {
if (fileCreator == null)
return null;
@ -62,7 +60,8 @@ public class CodeReaderFactoryAdapter extends AbstractCodeReaderFactory {
return CodeReaderAdapter.adapt(fDelegate.getContentForInclusion(path));
}
public ICodeReaderCache getCodeReaderCache() {
@Deprecated
public org.eclipse.cdt.core.parser.ICodeReaderCache getCodeReaderCache() {
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
* 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> {

View file

@ -13,7 +13,6 @@ package org.eclipse.cdt.internal.core.parser;
import java.io.IOException;
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.parser.FileContent;
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
public static InternalFileContentProvider adapt(ICodeReaderFactory fileCreator) {
public static InternalFileContentProvider adapt(org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator) {
if (fileCreator == null)
return null;
@ -47,7 +46,11 @@ public class FileContentProviderAdapter extends InternalFileContentProvider {
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;
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -92,7 +92,7 @@ final class PDOMCParameter extends PDOMNamedNode implements IParameter, IPDOMBin
throw new PDOMNotImplementedError();
}
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
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.semantics.CPPTemplates;
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.dom.IPDOMMemberOwner;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
@ -51,7 +50,7 @@ import org.eclipse.core.runtime.CoreException;
* @author Bryan Wilkinson
*/
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 MEMBERLIST = PDOMCPPSpecialization.RECORD_SIZE + 4;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -102,7 +102,7 @@ public class PEBinaryObject extends BinaryObjectAdapter {
return info;
}
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class adapter) {
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) {
for (int i = 0; i < peSyms.length; i++) {
if (peSyms[i].isFunction() || peSyms[i].isPointer() || peSyms[i].isArray()) {
String name = peSyms[i].getName(table);
for (org.eclipse.cdt.utils.coff.Coff.Symbol peSym : peSyms) {
if (peSym.isFunction() || peSym.isPointer() || peSym.isArray()) {
String name = peSym.getName(table);
if (name == null || name.trim().length() == 0 || !Character.isJavaIdentifierStart(name.charAt(0))) {
continue;
}
int type = peSyms[i].isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE;
list.add(new Symbol(this, name, type, new Addr32(peSyms[i].n_value), 1));
int type = peSym.isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE;
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
*/
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
@Deprecated
public class SymbolSortCompare implements Comparator {
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[])}
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Deprecated
protected void addArchiveMembers(ARHeader[] headers, ArrayList children) {
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) {
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
// do not add duplicate symbols with 0 size to the list
boolean duplicateAddressFound = false;
if (type == ISymbol.FUNCTION && array[i].st_size == 0){
if (type == ISymbol.FUNCTION && element.st_size == 0){
for (Symbol s : list) {
if (s.getAddress().equals(array[i].st_value)){
if (s.getAddress().equals(element.st_value)){
duplicateAddressFound = true;
break;
}
}
}
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)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class adapter) {
if (adapter.equals(Elf.class)) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -54,7 +54,7 @@ public class CElementAdapterFactory implements IAdapterFactory {
/**
* @see CElementAdapterFactory#getAdapter
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public Object getAdapter(Object element, Class key) {
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)
*/
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (IProject.class.equals(adapterType)) {
return ((ICProject)adaptableObject).getProject();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -651,7 +651,7 @@ public class CDocumentProvider extends TextFileDocumentProvider {
* @see AnnotationModel#addAnnotation(Annotation, Position, boolean)
*/
@Override
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
protected void addAnnotation(Annotation annotation, Position position, boolean fireModelChanged) throws BadLocationException {
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)
*/
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class required) {
if (IContentOutlinePage.class.equals(required)) {
@ -2527,7 +2527,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
if (model == null)
return null;
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
Iterator parent;
if (model instanceof IAnnotationModelExtension2) {
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) {
if (adapter.isAssignableFrom(ITextFileBuffer.class)) {
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)
*/
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class adapter) {
if (IContentOutlinePage.class.equals(adapter)) {
@ -276,7 +276,7 @@ public class AsmTextEditor extends TextEditor implements ISelectionChangedListen
if (model == null)
return null;
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
Iterator parent;
if (model instanceof IAnnotationModelExtension2) {
parent= ((IAnnotationModelExtension2)model).getAnnotationIterator(offset, length, true, true);

View file

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

View file

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

View file

@ -83,7 +83,7 @@ public class OpenIncludeBrowserAction extends SelectionDispatchAction {
return false;
}
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
private Object getAdapter(Object object, Class desiredClass) {
if (desiredClass.isInstance(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)
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public void getPipelinedChildren(Object parent, Set 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)
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public void getPipelinedElements(Object input, Set currentElements) {
// only replace plain resource elements with custom elements
// and avoid duplicating elements already customized

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -13,7 +13,6 @@
package org.eclipse.cdt.internal.ui.text.c.hover;
import com.ibm.icu.text.MessageFormat;
import java.util.Iterator;
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.DefaultMarkerAnnotationAccess;
import com.ibm.icu.text.MessageFormat;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.internal.ui.CPluginImages;
@ -207,8 +208,8 @@ public class AbstractAnnotationHover extends AbstractCEditorTextHover {
protected void disposeDeferredCreatedContent() {
Control[] children= fParent.getChildren();
for (int i= 0; i < children.length; i++) {
children[i].dispose();
for (Control element : children) {
element.dispose();
}
ToolBarManager toolBarManager= getToolBarManager();
if (toolBarManager != null)
@ -283,8 +284,8 @@ public class AbstractAnnotationHover extends AbstractCEditorTextHover {
if (control instanceof Composite) {
Control[] children= ((Composite) control).getChildren();
for (int i= 0; i < children.length; i++) {
setColorAndFont(children[i], foreground, background, font);
for (Control element : children) {
setColorAndFont(element, foreground, background, font);
}
}
}
@ -658,7 +659,7 @@ public class AbstractAnnotationHover extends AbstractCEditorTextHover {
return null;
try {
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
Iterator parent;
if (model instanceof IAnnotationModelExtension2)
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) {
fHashBuckets.put(hash, word);
} else if (bucket instanceof ArrayList<?>) {
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "rawtypes"})
final ArrayList<Object> bucket2 = (ArrayList)bucket;
bucket2.add(word);
} else {
@ -414,7 +414,7 @@ public abstract class AbstractSpellDictionary implements ISpellDictionary {
return true;
return false;
}
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
final ArrayList<String> candidateList= (ArrayList)candidates;
if (candidateList.contains(word) || candidateList.contains(word.toLowerCase()))
return true;

View file

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

View file

@ -81,7 +81,7 @@ public class THNode implements IAdaptable {
return fElement;
}
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(ICElement.class)) {
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)
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public Object getAdapter(Class adapter) {
if (adapter.isAssignableFrom(ITranslationUnit.class) && unit != null) {

View file

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

View file

@ -141,7 +141,7 @@ public class ResourceToItemsMapper {
} else if (existingMapping instanceof Item) {
fResourceToItem.remove(resource);
} else { // List
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
List<Item> list= (List) existingMapping;
list.remove(item);
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)
*/
@SuppressWarnings("unchecked")
@SuppressWarnings("rawtypes")
public Object getAdapter(Class clas) {
if (clas == IWorkbenchAdapter.class)
return this;

View file

@ -39,7 +39,7 @@ public interface ICompletionContributor {
* @param proposals the current list of proposals. This method should add any additional
* 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,
int offset,
IWorkingCopy workingCopy,

View file

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