mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 20:05:35 +02:00
Fix warnings.
This commit is contained in:
parent
843732d750
commit
cd81b282d5
9 changed files with 14 additions and 13 deletions
|
@ -203,11 +203,12 @@ public class ASTPrinter {
|
||||||
IASTDeclarator declarator = (IASTDeclarator) n;
|
IASTDeclarator declarator = (IASTDeclarator) n;
|
||||||
|
|
||||||
IASTPointerOperator[] pointers = declarator.getPointerOperators();
|
IASTPointerOperator[] pointers = declarator.getPointerOperators();
|
||||||
if(pointers != null && pointers.length > 0)
|
if(pointers != null && pointers.length > 0) {
|
||||||
out.println();
|
out.println();
|
||||||
for (IASTPointerOperator pointer : pointers) {
|
for (IASTPointerOperator pointer : pointers) {
|
||||||
print(out, indentLevel+1, pointer);
|
print(out, indentLevel+1, pointer);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (declarator instanceof IASTArrayDeclarator) {
|
if (declarator instanceof IASTArrayDeclarator) {
|
||||||
IASTArrayDeclarator decl = (IASTArrayDeclarator)declarator;
|
IASTArrayDeclarator decl = (IASTArrayDeclarator)declarator;
|
||||||
org.eclipse.cdt.core.dom.ast.IASTArrayModifier[] modifiers = decl.getArrayModifiers();
|
org.eclipse.cdt.core.dom.ast.IASTArrayModifier[] modifiers = decl.getArrayModifiers();
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class WeakHashSet<T> {
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (!(obj instanceof HashableWeakReference)) return false;
|
if (!(obj instanceof HashableWeakReference<?>)) return false;
|
||||||
Object referent = get();
|
Object referent = get();
|
||||||
Object other = ((HashableWeakReference<?>) obj).get();
|
Object other = ((HashableWeakReference<?>) obj).get();
|
||||||
if (referent == null) return other == null;
|
if (referent == null) return other == null;
|
||||||
|
|
|
@ -178,7 +178,7 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
|
||||||
ObjectInputStream input= new ObjectInputStream(zip.getInputStream(indexEntry));
|
ObjectInputStream input= new ObjectInputStream(zip.getInputStream(indexEntry));
|
||||||
try {
|
try {
|
||||||
Object obj= input.readObject();
|
Object obj= input.readObject();
|
||||||
if (obj instanceof Map) {
|
if (obj instanceof Map<?, ?>) {
|
||||||
return (Map<?,?>) obj;
|
return (Map<?,?>) obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -580,7 +580,7 @@ public class CDocumentProvider extends TextFileDocumentProvider {
|
||||||
|
|
||||||
private void overlayMarkers(Position position, ProblemAnnotation problemAnnotation) {
|
private void overlayMarkers(Position position, ProblemAnnotation problemAnnotation) {
|
||||||
Object value= getAnnotations(position);
|
Object value= getAnnotations(position);
|
||||||
if (value instanceof List) {
|
if (value instanceof List<?>) {
|
||||||
List<?> list= (List<?>) value;
|
List<?> list= (List<?>) value;
|
||||||
for (Object element : list)
|
for (Object element : list)
|
||||||
setOverlay(element, problemAnnotation);
|
setOverlay(element, problemAnnotation);
|
||||||
|
@ -681,7 +681,7 @@ public class CDocumentProvider extends TextFileDocumentProvider {
|
||||||
Position position= getPosition(annotation);
|
Position position= getPosition(annotation);
|
||||||
synchronized (getLockObject()) {
|
synchronized (getLockObject()) {
|
||||||
Object cached= fReverseMap.get(position);
|
Object cached= fReverseMap.get(position);
|
||||||
if (cached instanceof List) {
|
if (cached instanceof List<?>) {
|
||||||
List<?> list= (List<?>) cached;
|
List<?> list= (List<?>) cached;
|
||||||
list.remove(annotation);
|
list.remove(annotation);
|
||||||
if (list.size() == 1) {
|
if (list.size() == 1) {
|
||||||
|
|
|
@ -159,7 +159,7 @@ public class CodeTemplatePreferencePage extends PropertyAndPreferencePage {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void applyData(Object data) {
|
public void applyData(Object data) {
|
||||||
if (data instanceof Map) {
|
if (data instanceof Map<?, ?>) {
|
||||||
Object id= ((Map<?, ?>) data).get(DATA_SELECT_TEMPLATE);
|
Object id= ((Map<?, ?>) data).get(DATA_SELECT_TEMPLATE);
|
||||||
if (id instanceof String) {
|
if (id instanceof String) {
|
||||||
final TemplatePersistenceData[] templates= fCodeTemplateConfigurationBlock.fTemplateStore.getTemplateData();
|
final TemplatePersistenceData[] templates= fCodeTemplateConfigurationBlock.fTemplateStore.getTemplateData();
|
||||||
|
|
|
@ -332,7 +332,7 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void applyData(Object data) {
|
public void applyData(Object data) {
|
||||||
if (data instanceof Map) {
|
if (data instanceof Map<?, ?>) {
|
||||||
fData= (Map<?,?>) data;
|
fData= (Map<?,?>) data;
|
||||||
}
|
}
|
||||||
if (fChangeWorkspaceSettings != null) {
|
if (fChangeWorkspaceSettings != null) {
|
||||||
|
|
|
@ -374,7 +374,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")
|
||||||
final ArrayList<Object> bucket2 = (ArrayList)bucket;
|
final ArrayList<Object> bucket2 = (ArrayList)bucket;
|
||||||
bucket2.add(word);
|
bucket2.add(word);
|
||||||
|
@ -553,7 +553,7 @@ public abstract class AbstractSpellDictionary implements ISpellDictionary {
|
||||||
Iterator<Serializable> iter= fHashBuckets.values().iterator();
|
Iterator<Serializable> iter= fHashBuckets.values().iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
Object element= iter.next();
|
Object element= iter.next();
|
||||||
if (element instanceof ArrayList)
|
if (element instanceof ArrayList<?>)
|
||||||
((ArrayList<?>)element).trimToSize();
|
((ArrayList<?>)element).trimToSize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class ListContentProvider implements IStructuredContentProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||||
if (newInput instanceof List)
|
if (newInput instanceof List<?>)
|
||||||
fContents= (List<?>)newInput;
|
fContents= (List<?>)newInput;
|
||||||
else
|
else
|
||||||
fContents= null;
|
fContents= null;
|
||||||
|
|
|
@ -539,7 +539,7 @@ public class EnvironmentTab extends AbstractCPropertyTab {
|
||||||
|
|
||||||
public Object[] getElements(Object inputElement) {
|
public Object[] getElements(Object inputElement) {
|
||||||
String[] els = null;
|
String[] els = null;
|
||||||
if (inputElement instanceof Map) {
|
if (inputElement instanceof Map<?, ?>) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Map<String,?> m = (Map)inputElement;
|
Map<String,?> m = (Map)inputElement;
|
||||||
els = new String[m.size()];
|
els = new String[m.size()];
|
||||||
|
|
Loading…
Add table
Reference in a new issue