Revert "Suppress 157 Eclipse warnings about unused exception parameters"

This reverts commit fe9f7a793a.
This commit is contained in:
Ben Liblit 2017-03-23 16:32:00 -05:00
parent 67013a0d77
commit 16492c7b78
94 changed files with 157 additions and 157 deletions

View File

@ -28,7 +28,7 @@ public final class Exception2 {
while ( (data = fis.read()) != -1 ) { while ( (data = fis.read()) != -1 ) {
fos.write(data); fos.write(data);
} }
} catch (@SuppressWarnings("unused") FileNotFoundException e) { } catch (FileNotFoundException e) {
System.err.println( "File not found" ); System.err.println( "File not found" );
// whatever // whatever
} catch (IOException e) { } catch (IOException e) {
@ -38,14 +38,14 @@ public final class Exception2 {
if (fis != null) { if (fis != null) {
try { try {
fis.close(); fis.close();
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
System.exit(-1); System.exit(-1);
} }
} }
if (fos != null) { if (fos != null) {
try { try {
fos.close(); fos.close();
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
System.exit(-1); System.exit(-1);
} }
} }

View File

@ -86,7 +86,7 @@ public class HTMLCGBuilder {
URL url = null; URL url = null;
try { try {
url = toUrl(src); url = toUrl(src);
} catch (@SuppressWarnings("unused") MalformedURLException e1) { } catch (MalformedURLException e1) {
Assert.fail("Could not find page to analyse: " + src); Assert.fail("Could not find page to analyse: " + src);
} }
com.ibm.wala.cast.js.ipa.callgraph.JSCallGraphUtil.setTranslatorFactory(new CAstRhinoTranslatorFactory()); com.ibm.wala.cast.js.ipa.callgraph.JSCallGraphUtil.setTranslatorFactory(new CAstRhinoTranslatorFactory());
@ -129,7 +129,7 @@ public class HTMLCGBuilder {
File f = (new FileProvider()).getFileFromClassLoader(src, HTMLCGBuilder.class.getClassLoader()); File f = (new FileProvider()).getFileFromClassLoader(src, HTMLCGBuilder.class.getClassLoader());
URL url = f.toURI().toURL(); URL url = f.toURI().toURL();
return url; return url;
} catch (@SuppressWarnings("unused") FileNotFoundException fnfe) { } catch (FileNotFoundException fnfe) {
return new URL(src); return new URL(src);
} }
} }

View File

@ -108,7 +108,7 @@ public class JSCallGraphBuilderUtil extends com.ibm.wala.cast.js.ipa.callgraph.J
FileProvider provider = new FileProvider(); FileProvider provider = new FileProvider();
try { try {
f = provider.getFile(dir + File.separator + name, loader); f = provider.getFile(dir + File.separator + name, loader);
} catch (@SuppressWarnings("unused") FileNotFoundException e) { } catch (FileNotFoundException e) {
// I guess we need to do this on Windows sometimes? --MS // I guess we need to do this on Windows sometimes? --MS
// if this fails, we won't catch the exception // if this fails, we won't catch the exception
f = provider.getFile(dir + "/" + name, JSCallGraphBuilderUtil.class.getClassLoader()); f = provider.getFile(dir + "/" + name, JSCallGraphBuilderUtil.class.getClassLoader());
@ -239,7 +239,7 @@ public class JSCallGraphBuilderUtil extends com.ibm.wala.cast.js.ipa.callgraph.J
builder.setContextSelector(new PropertyNameContextSelector(builder.getAnalysisCache(), 2, builder.getContextSelector())); builder.setContextSelector(new PropertyNameContextSelector(builder.getAnalysisCache(), 2, builder.getContextSelector()));
return builder; return builder;
} catch (@SuppressWarnings("unused") ClassHierarchyException e) { } catch (ClassHierarchyException e) {
Assert.assertTrue("internal error building class hierarchy", false); Assert.assertTrue("internal error building class hierarchy", false);
return null; return null;
} }

View File

@ -62,7 +62,7 @@ public class DefaultSourceExtractor extends DomLessSourceExtractor{
if (v != null && v.startsWith("javascript:")) { if (v != null && v.startsWith("javascript:")) {
try { try {
writeEntrypoint(" " + v.substring(11), e.getValue().snd, new URL(tag.getElementPosition().getURL().toString() + "#" + a), true); writeEntrypoint(" " + v.substring(11), e.getValue().snd, new URL(tag.getElementPosition().getURL().toString() + "#" + a), true);
} catch (@SuppressWarnings("unused") MalformedURLException ex) { } catch (MalformedURLException ex) {
writeEntrypoint(v.substring(11), e.getValue().snd, entrypointUrl, false); writeEntrypoint(v.substring(11), e.getValue().snd, entrypointUrl, false);
} }
} }

View File

@ -81,7 +81,7 @@ public class JerichoTag implements ITag {
public URL getURL() { public URL getURL() {
try { try {
return new URL("file://" + sourceFile); return new URL("file://" + sourceFile);
} catch (@SuppressWarnings("unused") MalformedURLException e) { } catch (MalformedURLException e) {
return null; return null;
} }
} }

View File

@ -226,10 +226,10 @@ public class JSCallGraphUtil extends com.ibm.wala.cast.ipa.callgraph.CAstCallGra
cha.addClass(fcls); cha.addClass(fcls);
} }
return names; return names;
} catch (@SuppressWarnings("unused") Error e) { } catch (Error e) {
return Collections.emptySet(); return Collections.emptySet();
} }
} catch (@SuppressWarnings("unused") RuntimeException e) { } catch (RuntimeException e) {
return Collections.emptySet(); return Collections.emptySet();
} }
} }

View File

@ -203,7 +203,7 @@ public class JSSSAPropagationCallGraphBuilder extends AstSSAPropagationCallGraph
try { try {
byte[] utf8 = "__proto__".getBytes("UTF-8"); byte[] utf8 = "__proto__".getBytes("UTF-8");
x = FieldReference.findOrCreate(JavaScriptTypes.Root, Atom.findOrCreate(utf8, 0, utf8.length), JavaScriptTypes.Root); x = FieldReference.findOrCreate(JavaScriptTypes.Root, Atom.findOrCreate(utf8, 0, utf8.length), JavaScriptTypes.Root);
} catch (@SuppressWarnings("unused") UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
assert false; assert false;
} }
prototypeRef = x; prototypeRef = x;

View File

@ -81,11 +81,11 @@ public class LoadFileTargetSelector implements MethodTargetSelector {
IClass script = builder.getClassHierarchy().lookupClass(TypeReference.findOrCreate(cl.getReference(), "L" + url.getFile())); IClass script = builder.getClassHierarchy().lookupClass(TypeReference.findOrCreate(cl.getReference(), "L" + url.getFile()));
return script.getMethod(JavaScriptMethods.fnSelector); return script.getMethod(JavaScriptMethods.fnSelector);
} }
} catch (@SuppressWarnings("unused") MalformedURLException e1) { } catch (MalformedURLException e1) {
// do nothing, fall through and return 'target' // do nothing, fall through and return 'target'
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
// do nothing, fall through and return 'target' // do nothing, fall through and return 'target'
} catch (@SuppressWarnings("unused") RuntimeException e) { } catch (RuntimeException e) {
// do nothing, fall through and return 'target' // do nothing, fall through and return 'target'
} }
} }

View File

@ -291,7 +291,7 @@ public class CorrelationFinder {
IClassHierarchy cha = ClassHierarchyFactory.make(scope, loaders, JavaScriptLoader.JS); IClassHierarchy cha = ClassHierarchyFactory.make(scope, loaders, JavaScriptLoader.JS);
try { try {
Util.checkForFrontEndErrors(cha); Util.checkForFrontEndErrors(cha);
} catch (@SuppressWarnings("unused") WalaException e) { } catch (WalaException e) {
return Collections.emptyMap(); return Collections.emptyMap();
} }
IRFactory<IMethod> factory = AstIRFactory.makeDefaultFactory(); IRFactory<IMethod> factory = AstIRFactory.makeDefaultFactory();

View File

@ -521,7 +521,7 @@ public class JavaScriptConstructorFunctions {
public URL getURL() { public URL getURL() {
try { try {
return new URL("file://" + fileName); return new URL("file://" + fileName);
} catch (@SuppressWarnings("unused") MalformedURLException e) { } catch (MalformedURLException e) {
assert false; assert false;
return null; return null;
} }
@ -542,7 +542,7 @@ public class JavaScriptConstructorFunctions {
if (fcls != null) if (fcls != null)
return makeFunctionConstructor(cls, fcls); return makeFunctionConstructor(cls, fcls);
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
} }

View File

@ -262,7 +262,7 @@ public class JavaScriptLoader extends CAstAbstractModuleLoader {
byte[] utf8 = field.getBytes("UTF-8"); byte[] utf8 = field.getBytes("UTF-8");
return PutInstruction(iindex, ref, value, return PutInstruction(iindex, ref, value,
FieldReference.findOrCreate(JavaScriptTypes.Root, Atom.findOrCreate(utf8, 0, utf8.length), JavaScriptTypes.Root)); FieldReference.findOrCreate(JavaScriptTypes.Root, Atom.findOrCreate(utf8, 0, utf8.length), JavaScriptTypes.Root));
} catch (@SuppressWarnings("unused") UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
return null; return null;
} }

View File

@ -99,7 +99,7 @@ public class AstCallGraph extends ExplicitCallGraph {
for (Iterator<Function<Object, Object>> x = callbacks.iterator(); x.hasNext();) { for (Iterator<Function<Object, Object>> x = callbacks.iterator(); x.hasNext();) {
x.next().apply(null); x.next().apply(null);
} }
} catch (@SuppressWarnings("unused") ConcurrentModificationException e) { } catch (ConcurrentModificationException e) {
done = false; done = false;
continue; continue;
} }

View File

@ -444,7 +444,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
String fieldName = null; String fieldName = null;
try { try {
fieldName = inst.getDeclaredField().getName().toUnicodeString(); fieldName = inst.getDeclaredField().getName().toUnicodeString();
} catch (@SuppressWarnings("unused") UTFDataFormatException e) { } catch (UTFDataFormatException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
} }

View File

@ -73,7 +73,7 @@ public class CAstCallGraphUtil {
System.err.println("removing BOM " + bs.getBOM()); System.err.println("removing BOM " + bs.getBOM());
} }
return bs; return bs;
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
return super.getInputStream(); return super.getInputStream();
} }
} }
@ -150,7 +150,7 @@ public class CAstCallGraphUtil {
PointerKey n = (PointerKey) x.next(); PointerKey n = (PointerKey) x.next();
try { try {
System.err.println((n + " --> " + PA.getPointsToSet(n))); System.err.println((n + " --> " + PA.getPointsToSet(n)));
} catch (@SuppressWarnings("unused") Throwable e) { } catch (Throwable e) {
System.err.println(("error computing set for " + n)); System.err.println(("error computing set for " + n));
} }
} }

View File

@ -57,7 +57,7 @@ abstract public class AstFunctionClass implements IClass, ClassConstants {
public String toString() { public String toString() {
try { try {
return "function " + functionBody.getReference().getDeclaringClass().getName(); return "function " + functionBody.getReference().getDeclaringClass().getName();
} catch (@SuppressWarnings("unused") NullPointerException e) { } catch (NullPointerException e) {
return "<need to set code body>"; return "<need to set code body>";
} }
} }

View File

@ -177,7 +177,7 @@ public abstract class CAstAbstractLoader implements IClassLoader {
public Reader getSource(IClass klass) { public Reader getSource(IClass klass) {
try { try {
return ((AstClass)klass).getSourcePosition().getReader(); return ((AstClass)klass).getSourcePosition().getReader();
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
return null; return null;
} }
} }
@ -186,7 +186,7 @@ public abstract class CAstAbstractLoader implements IClassLoader {
public Reader getSource(IMethod method, int bcOffset) { public Reader getSource(IMethod method, int bcOffset) {
try { try {
return ((AstMethod)method).getSourcePosition(bcOffset).getReader(); return ((AstMethod)method).getSourcePosition(bcOffset).getReader();
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
return null; return null;
} }
} }

View File

@ -34,7 +34,7 @@ public abstract class SingleClassLoaderFactory implements ClassLoaderFactory {
THE_LOADER = makeTheLoader(cha); THE_LOADER = makeTheLoader(cha);
try { try {
THE_LOADER.init(scope.getModules(getTheReference())); THE_LOADER.init(scope.getModules(getTheReference()));
} catch (@SuppressWarnings("unused") java.io.IOException e) { } catch (java.io.IOException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
} }
} }

View File

@ -60,7 +60,7 @@ public class CAstImpl implements CAst {
public CAstNode getChild(int n) { public CAstNode getChild(int n) {
try { try {
return cs[n]; return cs[n];
} catch (@SuppressWarnings("unused") ArrayIndexOutOfBoundsException e) { } catch (ArrayIndexOutOfBoundsException e) {
throw new NoSuchElementException(n + " of " + CAstPrinter.print(this)); throw new NoSuchElementException(n + " of " + CAstPrinter.print(this));
} }
} }

View File

@ -259,7 +259,7 @@ public class CAstPrinter {
w.write("</" + kindAsString(top.getKind()) + ">\n"); w.write("</" + kindAsString(top.getKind()) + ">\n");
} }
} }
} catch (@SuppressWarnings("unused") java.io.IOException e) { } catch (java.io.IOException e) {
} }
} }

View File

@ -33,7 +33,7 @@ public class TypeAnnotatedClass1 extends @TypeAnnotationTypeUse Object {
try { try {
throw new NullPointerException(); throw new NullPointerException();
} catch (@SuppressWarnings("unused") @TypeAnnotationTypeUse RuntimeException e) { } catch (@TypeAnnotationTypeUse RuntimeException e) {
x = 911; x = 911;
} }

View File

@ -29,7 +29,7 @@ public class MainClass {
private String toStringImpl() { private String toStringImpl() {
try { try {
return "mc:" + x.toString(); return "mc:" + x.toString();
} catch (@SuppressWarnings("unused") NullPointerException e) { } catch (NullPointerException e) {
return callSomething(x); return callSomething(x);
} }
} }

View File

@ -19,7 +19,7 @@ public class TestPruning {
invokeSingleRecursive2(i); invokeSingleRecursive2(i);
break; break;
} }
} catch (@SuppressWarnings("unused") OwnException e) { } catch (OwnException e) {
} }
} }
@ -37,7 +37,7 @@ public class TestPruning {
case 4: case 4:
res = a[5]; res = a[5];
} }
} catch (@SuppressWarnings("unused") ArrayIndexOutOfBoundsException e) { } catch (ArrayIndexOutOfBoundsException e) {
} }
@ -56,7 +56,7 @@ public class TestPruning {
invokeAllPassThrough(); invokeAllPassThrough();
break; break;
} }
} catch (@SuppressWarnings("unused") RuntimeException e) { } catch (RuntimeException e) {
} }
} }
@ -86,9 +86,9 @@ public class TestPruning {
invokeAllPassThrough(); invokeAllPassThrough();
break; break;
} }
} catch (@SuppressWarnings("unused") ArrayIndexOutOfBoundsException e) { } catch (ArrayIndexOutOfBoundsException e) {
} catch (@SuppressWarnings("unused") OwnException e) { } catch (OwnException e) {
} }
return res; return res;

View File

@ -29,7 +29,7 @@ public class TestCD3 {
System.out.println("Y"); System.out.println("Y");
} }
} }
} catch (@SuppressWarnings("unused") Throwable e) { } catch (Throwable e) {
} }
doNothing(I); doNothing(I);
} }

View File

@ -41,7 +41,7 @@ public class DupFieldsTest extends WalaTestCase {
boolean threwException = false; boolean threwException = false;
try { try {
klass.getField(Atom.findOrCreateUnicodeAtom("a")); klass.getField(Atom.findOrCreateUnicodeAtom("a"));
} catch (@SuppressWarnings("unused") IllegalStateException e) { } catch (IllegalStateException e) {
threwException = true; threwException = true;
} }
Assert.assertTrue(threwException); Assert.assertTrue(threwException);

View File

@ -121,7 +121,7 @@ public class SimpleThreadEscapeAnalysis extends AbstractAnalysisEngine<InstanceK
try { try {
Properties p = WalaProperties.loadProperties(); Properties p = WalaProperties.loadProperties();
javaHomePath = p.getProperty(WalaProperties.J2SE_DIR); javaHomePath = p.getProperty(WalaProperties.J2SE_DIR);
} catch (@SuppressWarnings("unused") WalaException e) { } catch (WalaException e) {
// no luck. // no luck.
} }

View File

@ -186,7 +186,7 @@ public class ContextInsensitiveReachingDefs {
framework); framework);
try { try {
solver.solve(null); solver.solve(null);
} catch (@SuppressWarnings("unused") CancelException e) { } catch (CancelException e) {
// this shouldn't happen // this shouldn't happen
assert false; assert false;
} }

View File

@ -289,7 +289,7 @@ public class ContextSensitiveReachingDefs {
TabulationResult<BasicBlockInContext<IExplodedBasicBlock>, CGNode, Pair<CGNode, Integer>> result = null; TabulationResult<BasicBlockInContext<IExplodedBasicBlock>, CGNode, Pair<CGNode, Integer>> result = null;
try { try {
result = solver.solve(); result = solver.solve();
} catch (@SuppressWarnings("unused") CancelException e) { } catch (CancelException e) {
// this shouldn't happen // this shouldn't happen
assert false; assert false;
} }

View File

@ -160,7 +160,7 @@ public class IntraprocReachingDefs {
BitVectorSolver<IExplodedBasicBlock> solver = new BitVectorSolver<>(framework); BitVectorSolver<IExplodedBasicBlock> solver = new BitVectorSolver<>(framework);
try { try {
solver.solve(null); solver.solve(null);
} catch (@SuppressWarnings("unused") CancelException e) { } catch (CancelException e) {
// this shouldn't happen // this shouldn't happen
assert false; assert false;
} }

View File

@ -363,7 +363,7 @@ public class StaticInitializer {
TabulationResult<BasicBlockInContext<IExplodedBasicBlock>, CGNode, IClass> result = null; TabulationResult<BasicBlockInContext<IExplodedBasicBlock>, CGNode, IClass> result = null;
try { try {
result = solver.solve(); result = solver.solve();
} catch (@SuppressWarnings("unused") CancelException e) { } catch (CancelException e) {
// this shouldn't happen // this shouldn't happen
assert false; assert false;
} }

View File

@ -43,7 +43,7 @@ public class IntraproceduralNullPointerAnalysis {
paramValNum, ir, cfg.entry()); paramValNum, ir, cfg.entry());
try { try {
this.solver.solve(NO_PROGRESS_MONITOR); this.solver.solve(NO_PROGRESS_MONITOR);
} catch (@SuppressWarnings("unused") final CancelException e) { } catch (final CancelException e) {
// can't happen as we have no monitor // can't happen as we have no monitor
} }
} }

View File

@ -97,7 +97,7 @@ class ReflectiveInvocationSelector implements ContextSelector {
} else { } else {
return new IllegalArgumentExceptionContext(); return new IllegalArgumentExceptionContext();
} }
} catch (@SuppressWarnings("unused") IllegalArgumentException e) { } catch (IllegalArgumentException e) {
return new ReceiverInstanceContext(receiver[0]); return new ReceiverInstanceContext(receiver[0]);
} }
} }

View File

@ -213,7 +213,7 @@ public class TypeInference extends SSAInference<TypeVariable> implements FixedPo
} catch (InvalidClassFileException e) { } catch (InvalidClassFileException e) {
e.printStackTrace(); e.printStackTrace();
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
} catch (@SuppressWarnings("unused") UnsupportedOperationException e) { } catch (UnsupportedOperationException e) {
x = new TypeReference[]{ language.getThrowableType() }; x = new TypeReference[]{ language.getThrowableType() };
} }
if (x != null) { if (x != null) {

View File

@ -76,7 +76,7 @@ public abstract class AbstractNestedJarFileModule implements Module {
cache.put(name, bb); cache.put(name, bb);
} }
} }
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
// just go with what we have // just go with what we have
Warnings.add(new Warning() { Warnings.add(new Warning() {

View File

@ -43,7 +43,7 @@ public abstract class AbstractURLModule implements Module, ModuleEntry {
return ((JarURLConnection) con).getEntryName(); return ((JarURLConnection) con).getEntryName();
else else
return (new FileProvider()).filePathFromURL(url); return (new FileProvider()).filePathFromURL(url);
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
return null; return null;
} }
@ -53,7 +53,7 @@ public abstract class AbstractURLModule implements Module, ModuleEntry {
public InputStream getInputStream() { public InputStream getInputStream() {
try { try {
return url.openConnection().getInputStream(); return url.openConnection().getInputStream();
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
return null; return null;
} }

View File

@ -34,7 +34,7 @@ public class BinaryDirectoryTreeModule extends DirectoryTreeModule {
protected FileModule makeFile(final File file) { protected FileModule makeFile(final File file) {
try { try {
return new ClassFileModule(file, this); return new ClassFileModule(file, this);
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
Warnings.add(new Warning(Warning.MODERATE) { Warnings.add(new Warning(Warning.MODERATE) {
@Override @Override

View File

@ -98,7 +98,7 @@ public class ClassLoaderFactoryImpl implements ClassLoaderFactory {
Constructor<?> ctor = impl.getDeclaredConstructor(new Class[] { ClassLoaderReference.class, IClassLoader.class, Constructor<?> ctor = impl.getDeclaredConstructor(new Class[] { ClassLoaderReference.class, IClassLoader.class,
SetOfClasses.class, IClassHierarchy.class }); SetOfClasses.class, IClassHierarchy.class });
cl = (IClassLoader) ctor.newInstance(new Object[] { classLoaderReference, parent, exclusions, cha }); cl = (IClassLoader) ctor.newInstance(new Object[] { classLoaderReference, parent, exclusions, cha });
} catch (@SuppressWarnings("unused") Exception e) { } catch (Exception e) {
try { try {
Class<?> impl = Class.forName(implClass); Class<?> impl = Class.forName(implClass);
Constructor<?> ctor = impl.getDeclaredConstructor(new Class[] { ClassLoaderReference.class, ArrayClassLoader.class, Constructor<?> ctor = impl.getDeclaredConstructor(new Class[] { ClassLoaderReference.class, ArrayClassLoader.class,

View File

@ -296,7 +296,7 @@ public class ClassLoaderImpl implements IClassLoader {
Warnings.add(InvalidClassFile.create(className)); Warnings.add(InvalidClassFile.create(className));
} }
} }
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
if (DEBUG_LEVEL > 0) { if (DEBUG_LEVEL > 0) {
System.err.println("Ignoring class " + className + " due to InvalidClassFileException"); System.err.println("Ignoring class " + className + " due to InvalidClassFileException");
} }
@ -568,13 +568,13 @@ public class ClassLoaderImpl implements IClassLoader {
while (n != -1) { while (n != -1) {
n = s.read(b); n = s.read(b);
} }
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
} finally { } finally {
try { try {
if (s != null) { if (s != null) {
s.close(); s.close();
} }
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
} }
} }
} }

View File

@ -74,7 +74,7 @@ public class JarStreamModule extends JarInputStream implements Module {
cache.put(name, bb); cache.put(name, bb);
} }
} }
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
// just go with what we have // just go with what we have
Warnings.add(new Warning() { Warnings.add(new Warning() {

View File

@ -369,7 +369,7 @@ public abstract class ShrikeBTMethod implements IMethod, BytecodeConstants {
ImmutableByteArray desc = ImmutableByteArray.make(getMethodSignature()); ImmutableByteArray desc = ImmutableByteArray.make(getMethodSignature());
Descriptor D = Descriptor.findOrCreate(declaringClass.getClassLoader().getLanguage(), desc); Descriptor D = Descriptor.findOrCreate(declaringClass.getClassLoader().getLanguage(), desc);
return MethodReference.findOrCreate(declaringClass.getReference(), name, D); return MethodReference.findOrCreate(declaringClass.getReference(), name, D);
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
return null; return null;
} }
@ -804,7 +804,7 @@ public abstract class ShrikeBTMethod implements IMethod, BytecodeConstants {
result[i] = TypeReference.findOrCreate(loader, TypeName.findOrCreate(ImmutableByteArray.make("L" + strings[i]))); result[i] = TypeReference.findOrCreate(loader, TypeName.findOrCreate(ImmutableByteArray.make("L" + strings[i])));
} }
return result; return result;
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
return null; return null;
} }
@ -833,7 +833,7 @@ public abstract class ShrikeBTMethod implements IMethod, BytecodeConstants {
public int getLineNumber(int bcIndex) { public int getLineNumber(int bcIndex) {
try { try {
return (getBCInfo().lineNumberMap == null) ? -1 : getBCInfo().lineNumberMap[bcIndex]; return (getBCInfo().lineNumberMap == null) ? -1 : getBCInfo().lineNumberMap[bcIndex];
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
return -1; return -1;
} }
} }

View File

@ -106,7 +106,7 @@ public final class ShrikeCTMethod extends ShrikeBTMethod implements IBytecodeMet
final Decoder d = new CTDecoder(reader); final Decoder d = new CTDecoder(reader);
try { try {
d.decode(); d.decode();
} catch (@SuppressWarnings("unused") Decoder.InvalidBytecodeException ex) { } catch (Decoder.InvalidBytecodeException ex) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
} }
return d; return d;
@ -279,7 +279,7 @@ public final class ShrikeCTMethod extends ShrikeBTMethod implements IBytecodeMet
int[][] map = null; int[][] map = null;
try { try {
map = getBCInfo().localVariableMap; map = getBCInfo().localVariableMap;
} catch (@SuppressWarnings("unused") InvalidClassFileException e1) { } catch (InvalidClassFileException e1) {
return null; return null;
} }
@ -488,7 +488,7 @@ public final class ShrikeCTMethod extends ShrikeBTMethod implements IBytecodeMet
try { try {
result.addAll(getAnnotations(true)); result.addAll(getAnnotations(true));
result.addAll(getAnnotations(false)); result.addAll(getAnnotations(false));
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
} }
return result; return result;

View File

@ -143,7 +143,7 @@ public final class ShrikeClass extends JVMClass<IClassLoader> {
if (s != null) { if (s != null) {
superName = ImmutableByteArray.make("L" + s); superName = ImmutableByteArray.make("L" + s);
} }
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
} }
} }
@ -161,7 +161,7 @@ public final class ShrikeClass extends JVMClass<IClassLoader> {
for (int i = 0; i < interfaceNames.length; i++) { for (int i = 0; i < interfaceNames.length; i++) {
interfaceNames[i] = ImmutableByteArray.make("L" + s[i]); interfaceNames[i] = ImmutableByteArray.make("L" + s[i]);
} }
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
} }
} }
@ -257,7 +257,7 @@ public final class ShrikeClass extends JVMClass<IClassLoader> {
try { try {
result.addAll(getAnnotations(true)); result.addAll(getAnnotations(true));
result.addAll(getAnnotations(false)); result.addAll(getAnnotations(false));
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
} }
return result; return result;
@ -313,7 +313,7 @@ public final class ShrikeClass extends JVMClass<IClassLoader> {
return reader.getReader(iter); return reader.getReader(iter);
} }
} }
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
} }
return null; return null;
@ -333,7 +333,7 @@ public final class ShrikeClass extends JVMClass<IClassLoader> {
break; break;
} }
} }
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
} }
return result; return result;
@ -432,7 +432,7 @@ public final class ShrikeClass extends JVMClass<IClassLoader> {
break; break;
} }
} }
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
} }
return result; return result;

View File

@ -124,7 +124,7 @@ public class ShrikeIRFactory implements IRFactory<IBytecodeMethod> {
} else { } else {
return "(line " + lineNumber + ")"; return "(line " + lineNumber + ")";
} }
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
return ""; return "";
} }
} }

View File

@ -185,7 +185,7 @@ public class DemandRefinementPointsTo extends AbstractDemandPointsTo {
CallSiteReference site = iterator.next(); CallSiteReference site = iterator.next();
try { try {
caller.getIR().getCalls(site); caller.getIR().getCalls(site);
} catch (@SuppressWarnings("unused") IllegalArgumentException e) { } catch (IllegalArgumentException e) {
System.err.println(caller + " is pred of " + callee); System.err.println(caller + " is pred of " + callee);
System.err.println("no calls at site " + site); System.err.println("no calls at site " + site);
System.err.println(caller.getIR()); System.err.println(caller.getIR());
@ -338,13 +338,13 @@ public class DemandRefinementPointsTo extends AbstractDemandPointsTo {
} }
completedPassInBudget = true; completedPassInBudget = true;
break; break;
} catch (@SuppressWarnings("unused") StatesMergedException e) { } catch (StatesMergedException e) {
if (DEBUG) { if (DEBUG) {
System.err.println("restarting..."); System.err.println("restarting...");
} }
} }
} }
} catch (@SuppressWarnings("unused") BudgetExceededException e) { } catch (BudgetExceededException e) {
} }
if (curP2Set != null) { if (curP2Set != null) {
@ -446,7 +446,7 @@ public class DemandRefinementPointsTo extends AbstractDemandPointsTo {
completedPassInBudget = true; completedPassInBudget = true;
completedSomePass = true; completedSomePass = true;
break; break;
} catch (@SuppressWarnings("unused") StatesMergedException e) { } catch (StatesMergedException e) {
if (DEBUG) { if (DEBUG) {
System.err.println("restarting..."); System.err.println("restarting...");
} }
@ -466,7 +466,7 @@ public class DemandRefinementPointsTo extends AbstractDemandPointsTo {
} }
} }
} catch (@SuppressWarnings("unused") BudgetExceededException e) { } catch (BudgetExceededException e) {
} }
if (completedPassInBudget) { if (completedPassInBudget) {
@ -585,13 +585,13 @@ public class DemandRefinementPointsTo extends AbstractDemandPointsTo {
System.err.println("FLOWS-TO SET " + curFlowsToSet); System.err.println("FLOWS-TO SET " + curFlowsToSet);
} }
break; break;
} catch (@SuppressWarnings("unused") StatesMergedException e) { } catch (StatesMergedException e) {
if (DEBUG) { if (DEBUG) {
System.err.println("restarting..."); System.err.println("restarting...");
} }
} }
} }
} catch (@SuppressWarnings("unused") BudgetExceededException e) { } catch (BudgetExceededException e) {
} }
if (curFlowsToSet != null) { if (curFlowsToSet != null) {

View File

@ -408,7 +408,7 @@ public class AnalysisScope {
Assertions.UNREACHABLE("Manifest for " + rtJar.getName() + " has no value for Specification-Version"); Assertions.UNREACHABLE("Manifest for " + rtJar.getName() + " has no value for Specification-Version");
} }
return result; return result;
} catch (@SuppressWarnings("unused") java.io.IOException e) { } catch (java.io.IOException e) {
Assertions.UNREACHABLE("error getting rt.jar manifest!"); Assertions.UNREACHABLE("error getting rt.jar manifest!");
return null; return null;
} }

View File

@ -727,7 +727,7 @@ public abstract class PropagationCallGraphBuilder implements CallGraphBuilder<In
} }
try { try {
return getCallGraph().findOrCreateNode(targetMethod, targetContext); return getCallGraph().findOrCreateNode(targetMethod, targetContext);
} catch (@SuppressWarnings("unused") CancelException e) { } catch (CancelException e) {
return null; return null;
} }
} }

View File

@ -205,7 +205,7 @@ public abstract class AbstractRTABuilder extends PropagationCallGraphBuilder {
try { try {
target = callGraph.findOrCreateNode(targetMethod, Everywhere.EVERYWHERE); target = callGraph.findOrCreateNode(targetMethod, Everywhere.EVERYWHERE);
processResolvedCall(callGraph.getFakeWorldClinitNode(), s.getCallSite(), target); processResolvedCall(callGraph.getFakeWorldClinitNode(), s.getCallSite(), target);
} catch (@SuppressWarnings("unused") CancelException e) { } catch (CancelException e) {
if (DEBUG) { if (DEBUG) {
System.err.println("Could not add node for class initializer: " + targetMethod.getSignature() System.err.println("Could not add node for class initializer: " + targetMethod.getSignature()
+ " due to constraints on the maximum number of nodes in the call graph."); + " due to constraints on the maximum number of nodes in the call graph.");

View File

@ -60,7 +60,7 @@ public final class WalaProperties {
Properties p = null; Properties p = null;
try { try {
p = WalaProperties.loadProperties(); p = WalaProperties.loadProperties();
} catch (@SuppressWarnings("unused") WalaException e) { } catch (WalaException e) {
return PlatformUtil.getBootClassPathJars(); return PlatformUtil.getBootClassPathJars();
} }

View File

@ -81,7 +81,7 @@ public class DefUse {
} }
uses[use].add(i); uses[use].add(i);
} }
} catch (@SuppressWarnings("unused") ArrayIndexOutOfBoundsException e) { } catch (ArrayIndexOutOfBoundsException e) {
assert false : "unexpected value number " + use; assert false : "unexpected value number " + use;
} }
} }

View File

@ -451,7 +451,7 @@ public class SymbolTable implements Cloneable {
nt.constants = HashMapFactory.make(this.constants); nt.constants = HashMapFactory.make(this.constants);
nt.copy = true; nt.copy = true;
return nt; return nt;
} catch (@SuppressWarnings("unused") CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
return null; return null;
} }

View File

@ -785,7 +785,7 @@ public class TypeAnnotation {
try { try {
final int catchIIndex = method.getInstructionIndex(target.getCatchPC()); final int catchIIndex = method.getInstructionIndex(target.getCatchPC());
return new CatchTarget(catchIIndex, catchType); return new CatchTarget(catchIIndex, catchType);
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
return new CatchTarget(TypeAnnotationTarget.INSTRUCTION_INDEX_UNAVAILABLE, catchType); return new CatchTarget(TypeAnnotationTarget.INSTRUCTION_INDEX_UNAVAILABLE, catchType);
} }
@ -797,7 +797,7 @@ public class TypeAnnotation {
try { try {
final int iindex = method.getInstructionIndex(target.getOffset()); final int iindex = method.getInstructionIndex(target.getOffset());
return new OffsetTarget(iindex); return new OffsetTarget(iindex);
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
return new OffsetTarget(TypeAnnotationTarget.INSTRUCTION_INDEX_UNAVAILABLE); return new OffsetTarget(TypeAnnotationTarget.INSTRUCTION_INDEX_UNAVAILABLE);
} }
} }
@ -808,7 +808,7 @@ public class TypeAnnotation {
try { try {
final int iindex = method.getInstructionIndex(target.getOffset()); final int iindex = method.getInstructionIndex(target.getOffset());
return new TypeArgumentTarget(iindex, target.getTypeArgumentIndex()); return new TypeArgumentTarget(iindex, target.getTypeArgumentIndex());
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
return new TypeArgumentTarget(TypeAnnotationTarget.INSTRUCTION_INDEX_UNAVAILABLE, target.getTypeArgumentIndex()); return new TypeArgumentTarget(TypeAnnotationTarget.INSTRUCTION_INDEX_UNAVAILABLE, target.getTypeArgumentIndex());
} }
} }

View File

@ -107,7 +107,7 @@ public class ProgressMaster implements IProgressMonitor {
currentNanny.interrupt(); currentNanny.interrupt();
try { try {
currentNanny.join(); currentNanny.join();
} catch (@SuppressWarnings("unused") InterruptedException e) { } catch (InterruptedException e) {
} }
currentNanny = null; currentNanny = null;
} }
@ -203,7 +203,7 @@ public class ProgressMaster implements IProgressMonitor {
} }
timedOut = true; timedOut = true;
} catch (@SuppressWarnings("unused") InterruptedException e) { } catch (InterruptedException e) {
return; return;
} }
} }

View File

@ -233,7 +233,7 @@ public class AnalysisScopeReader {
} }
} }
} }
} catch (@SuppressWarnings("unused") RuntimeException e) { } catch (RuntimeException e) {
System.err.println("warning: trouble processing class path of " + path); System.err.println("warning: trouble processing class path of " + path);
} }
} else { } else {

View File

@ -95,7 +95,7 @@ public class FileProvider {
URL url = null; URL url = null;
try { try {
url = loader.getResource(fileName); url = loader.getResource(fileName);
} catch (@SuppressWarnings("unused") Exception e) { } catch (Exception e) {
} }
if (DEBUG_LEVEL > 0) { if (DEBUG_LEVEL > 0) {
System.err.println(("FileProvider got url: " + url + " for " + fileName)); System.err.println(("FileProvider got url: " + url + " for " + fileName));
@ -206,7 +206,7 @@ public class FileProvider {
try { try {
URI uri = new File(URLDecoder.decode(url.getPath(), "UTF-8")).toURI(); URI uri = new File(URLDecoder.decode(url.getPath(), "UTF-8")).toURI();
return uri.getPath(); return uri.getPath();
} catch (@SuppressWarnings("unused") UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
// this really shouldn't happen // this really shouldn't happen
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
return null; return null;

View File

@ -611,7 +611,7 @@ public class ParameterAccessor {
throw new IllegalArgumentException("Class " + asType + " is not a super-class of " + throw new IllegalArgumentException("Class " + asType + " is not a super-class of " +
this.method.getParameterType(self)); this.method.getParameterType(self));
} }
} catch (@SuppressWarnings("unused") ClassLookupException e) { } catch (ClassLookupException e) {
// Cant't test assume all fitts // Cant't test assume all fitts
} }
@ -1344,7 +1344,7 @@ public class ParameterAccessor {
continue forEachParameter; continue forEachParameter;
} }
} }
} catch (@SuppressWarnings("unused") ClassLookupException e) { } catch (ClassLookupException e) {
} }
} }
@ -1356,7 +1356,7 @@ public class ParameterAccessor {
debug("\t\tAsigning: {} from the callrs params (ass)", cand); debug("\t\tAsigning: {} from the callrs params (ass)", cand);
continue forEachParameter; continue forEachParameter;
} }
} catch (@SuppressWarnings("unused") ClassLookupException e) { } catch (ClassLookupException e) {
} }
} }
} }

View File

@ -617,7 +617,7 @@ public class TypeSafeInstructionFactory {
public boolean isAssignableFrom(final TypeReference from, final TypeReference to) { public boolean isAssignableFrom(final TypeReference from, final TypeReference to) {
try { try {
return ParameterAccessor.isAssignable(from, to, this.cha); return ParameterAccessor.isAssignable(from, to, this.cha);
} catch (@SuppressWarnings("unused") ClassLookupException e) { } catch (ClassLookupException e) {
return true; return true;
} }
} }

View File

@ -99,7 +99,7 @@ public abstract class UTF8Convert {
+ (i - 3)); + (i - 3));
} }
} }
} catch (@SuppressWarnings("unused") ArrayIndexOutOfBoundsException e) { } catch (ArrayIndexOutOfBoundsException e) {
throw new UTFDataFormatException("unexpected end at location " + i); throw new UTFDataFormatException("unexpected end at location " + i);
} }
} }
@ -202,7 +202,7 @@ public abstract class UTF8Convert {
if (c < '\u0800') if (c < '\u0800')
return false; return false;
} }
} catch (@SuppressWarnings("unused") ArrayIndexOutOfBoundsException e) { } catch (ArrayIndexOutOfBoundsException e) {
return false; return false;
} }
} }

View File

@ -107,7 +107,7 @@ public class IrViewer extends JPanel{
} }
lineNum++; lineNum++;
} }
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
// ??? // ???
assert false; assert false;
} }
@ -127,7 +127,7 @@ public class IrViewer extends JPanel{
String pcString = line.substring(0, firstSpace); String pcString = line.substring(0, firstSpace);
try { try {
return Integer.parseInt(pcString); return Integer.parseInt(pcString);
} catch (@SuppressWarnings("unused") NumberFormatException e) { } catch (NumberFormatException e) {
return NA; return NA;
} }
} else { } else {

View File

@ -75,7 +75,7 @@ public class SourceViewer extends JPanel{
} }
br.close(); br.close();
return true; return true;
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
System.err.println("Could not load source at " + url); System.err.println("Could not load source at " + url);
return false; return false;
} }

View File

@ -52,7 +52,7 @@ public class APKCallGraphDriver {
try { try {
timeout = Integer.parseInt(args[1]); timeout = Integer.parseInt(args[1]);
System.err.println("timeout is " + timeout); System.err.println("timeout is " + timeout);
} catch (@SuppressWarnings("unused") Throwable e) { } catch (Throwable e) {
// no timeout specified // no timeout specified
} }
FileUtil.recurseFiles(new VoidFunction<File>() { FileUtil.recurseFiles(new VoidFunction<File>() {

View File

@ -35,7 +35,7 @@ public class Util {
static { static {
try { try {
walaProperties = WalaProperties.loadProperties(); walaProperties = WalaProperties.loadProperties();
} catch (@SuppressWarnings("unused") WalaException e) { } catch (WalaException e) {
walaProperties = null; walaProperties = null;
} }
} }

View File

@ -400,7 +400,7 @@ public class DexIClass extends BytecodeClass<IClassLoader> {
if (methods == null){ if (methods == null){
try { try {
computeDeclaredMethods(); computeDeclaredMethods();
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
} }
} }
// return construcorId!=-1?methods[construcorId]:null; // return construcorId!=-1?methods[construcorId]:null;

View File

@ -92,7 +92,7 @@ public class DexIRFactory extends DefaultIRFactory {
} else { } else {
return "(line " + lineNumber + ")"; return "(line " + lineNumber + ")";
} }
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
return ""; return "";
} }
} }

View File

@ -193,7 +193,7 @@ public class ReuseParameters {
final int localNumber = ssaFor(inCallTo, firstOf(param, inCallTo)); final int localNumber = ssaFor(inCallTo, firstOf(param, inCallTo));
try { try {
withName = inCallTo.getLocalVariableName (bcIndex, localNumber); withName = inCallTo.getLocalVariableName (bcIndex, localNumber);
} catch (@SuppressWarnings("unused") UnsupportedOperationException e) { } catch (UnsupportedOperationException e) {
// DexIMethod doesn't implement this :( // DexIMethod doesn't implement this :(
withName = null; withName = null;

View File

@ -64,7 +64,7 @@ public class JavaEclipseProjectPath extends EclipseProjectPath<IClasspathEntry,
if (p.hasNature(JavaCore.NATURE_ID)) { if (p.hasNature(JavaCore.NATURE_ID)) {
return JavaCore.create(p); return JavaCore.create(p);
} }
} catch (@SuppressWarnings("unused") CoreException e) { } catch (CoreException e) {
// not a Java project // not a Java project
} }
return null; return null;

View File

@ -83,7 +83,7 @@ public class JdtUtil {
String packageName = pkgDecl[0].getElementName(); String packageName = pkgDecl[0].getElementName();
return packageName; return packageName;
} }
} catch (@SuppressWarnings("unused") JavaModelException e) { } catch (JavaModelException e) {
} }
return ""; return "";
@ -137,7 +137,7 @@ public class JdtUtil {
} }
try { try {
return cu.getAllTypes(); return cu.getAllTypes();
} catch (@SuppressWarnings("unused") JavaModelException e) { } catch (JavaModelException e) {
} }
return null; return null;
} }
@ -200,7 +200,7 @@ public class JdtUtil {
result.add(jp); result.add(jp);
} }
} }
} catch (@SuppressWarnings("unused") CoreException e) { } catch (CoreException e) {
// do nothing // do nothing
} }
} }
@ -293,7 +293,7 @@ public class JdtUtil {
IType type = null; IType type = null;
try { try {
type = findJavaClassInProjects(klass, projects); type = findJavaClassInProjects(klass, projects);
} catch (@SuppressWarnings("unused") Throwable t) { } catch (Throwable t) {
return null; return null;
} }
if (type == null) { if (type == null) {

View File

@ -45,7 +45,7 @@ public class EclipseWebProjectPath extends JavaScriptEclipseProjectPath {
try { try {
scripts = WebUtil.extractScriptFromHTML(new URL(urlString), DefaultSourceExtractor.factory ).fst; scripts = WebUtil.extractScriptFromHTML(new URL(urlString), DefaultSourceExtractor.factory ).fst;
s.addAll(scripts); s.addAll(scripts);
} catch (@SuppressWarnings("unused") MalformedURLException e1) { } catch (MalformedURLException e1) {
assert false : "internal error constructing URL " + urlString; assert false : "internal error constructing URL " + urlString;
} catch (Error e1) { } catch (Error e1) {
System.err.print("skipping " + htmlPage.getAbsolutePath() + ": " + e1.warning); System.err.print("skipping " + htmlPage.getAbsolutePath() + ": " + e1.warning);

View File

@ -87,7 +87,7 @@ public class JavaScriptEclipseProjectPath extends EclipseProjectPath<IIncludePat
} else { } else {
return null; return null;
} }
} catch (@SuppressWarnings("unused") CoreException e) { } catch (CoreException e) {
return null; return null;
} }
} }

View File

@ -30,7 +30,7 @@ public class JavaScriptHeadlessUtil extends HeadlessUtil {
return jp; return jp;
} }
} }
} catch (@SuppressWarnings("unused") CoreException e) { } catch (CoreException e) {
} }
// failed to match // failed to match
return null; return null;

View File

@ -132,11 +132,11 @@ public class JsdtUtil {
info.cg.addEdge(call.getMember(), (IFunction)elt); info.cg.addEdge(call.getMember(), (IFunction)elt);
} }
} }
} catch (@SuppressWarnings("unused") Throwable e) { } catch (Throwable e) {
// Eclipse does whatever it wants, and we ignore stuff :) // Eclipse does whatever it wants, and we ignore stuff :)
} }
} }
} catch (@SuppressWarnings("unused") RuntimeException e) { } catch (RuntimeException e) {
} }
// TODO Auto-generated method stub // TODO Auto-generated method stub

View File

@ -48,11 +48,11 @@ abstract public class EclipseProjectSourceAnalysisEngine<P, I extends InstanceKe
try { try {
setExclusionsFile((new EclipseFileProvider()).getFileFromPlugin(CorePlugin.getDefault(), "J2SEClassHierarchyExclusions.txt") setExclusionsFile((new EclipseFileProvider()).getFileFromPlugin(CorePlugin.getDefault(), "J2SEClassHierarchyExclusions.txt")
.getAbsolutePath()); .getAbsolutePath());
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
try { try {
setExclusionsFile((new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt", getClass().getClassLoader()) setExclusionsFile((new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt", getClass().getClassLoader())
.getAbsolutePath()); .getAbsolutePath());
} catch (@SuppressWarnings("unused") IOException f) { } catch (IOException f) {
Assertions.UNREACHABLE("Cannot find exclusions file"); Assertions.UNREACHABLE("Cannot find exclusions file");
} }
} }

View File

@ -29,7 +29,7 @@ public class CorePlugin extends Plugin {
{ {
result = Platform.isRunning(); result = Platform.isRunning();
} }
catch (@SuppressWarnings("unused") Throwable exception) catch (Throwable exception)
{ {
// Assume that we aren't running. // Assume that we aren't running.
} }
@ -47,7 +47,7 @@ public class CorePlugin extends Plugin {
Bundle resourcesBundle = Platform.getBundle("org.eclipse.core.resources"); Bundle resourcesBundle = Platform.getBundle("org.eclipse.core.resources");
result = resourcesBundle != null && (resourcesBundle.getState() & (Bundle.ACTIVE | Bundle.STARTING | Bundle.RESOLVED)) != 0; result = resourcesBundle != null && (resourcesBundle.getState() & (Bundle.ACTIVE | Bundle.STARTING | Bundle.RESOLVED)) != 0;
} }
catch (@SuppressWarnings("unused") Throwable exception) catch (Throwable exception)
{ {
// Assume that it's not available. // Assume that it's not available.
} }

View File

@ -79,7 +79,7 @@ public class EclipseFileProvider extends FileProvider {
return new JarFileModule(jar); return new JarFileModule(jar);
} }
} }
} catch (@SuppressWarnings("unused") Exception e) { } catch (Exception e) {
} }
return null; return null;
} }
@ -205,7 +205,7 @@ public class EclipseFileProvider extends FileProvider {
} else { } else {
try { try {
return getFileFromPlugin(p, fileName); return getFileFromPlugin(p, fileName);
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
return getFileFromClassLoader(fileName, loader); return getFileFromClassLoader(fileName, loader);
} }
} }

View File

@ -146,10 +146,10 @@ public abstract class EclipseProjectPath<E, P> {
JarFile j; JarFile j;
try { try {
j = new JarFile(file); j = new JarFile(file);
} catch (@SuppressWarnings("unused") ZipException z) { } catch (ZipException z) {
// a corrupted file. ignore it. // a corrupted file. ignore it.
return; return;
} catch (@SuppressWarnings("unused") IOException z) { } catch (IOException z) {
// should ignore directories as well.. // should ignore directories as well..
return; return;
} }
@ -216,7 +216,7 @@ public abstract class EclipseProjectPath<E, P> {
// This is horrible. We can't figure out the race condition yet which causes this to happen. // This is horrible. We can't figure out the race condition yet which causes this to happen.
try { try {
Thread.sleep(5000); Thread.sleep(5000);
} catch (@SuppressWarnings("unused") InterruptedException e) { } catch (InterruptedException e) {
// whatever. // whatever.
} }
bd = findModel(p).getBundleDescription(); bd = findModel(p).getBundleDescription();

View File

@ -101,7 +101,7 @@ public class PrefixTransferGraph implements Graph<InstanceKeySite> {
{ {
sbua = new StringBuilderUseAnalysis(k,pa); sbua = new StringBuilderUseAnalysis(k,pa);
} }
catch(@SuppressWarnings("unused") Exception e) catch(Exception e)
{ {
continue; continue;

View File

@ -162,7 +162,7 @@ public class UriPrefixTransferGraph implements Graph<InstanceKeySite> {
final StringBuilderUseAnalysis sbua; final StringBuilderUseAnalysis sbua;
try { try {
sbua = new StringBuilderUseAnalysis(ik, pa); sbua = new StringBuilderUseAnalysis(ik, pa);
} catch(@SuppressWarnings("unused") Exception e) { } catch(Exception e) {
return; return;
} }

View File

@ -123,7 +123,7 @@ public class DexDotUtil extends DotUtil {
// if we get here, the process has terminated // if we get here, the process has terminated
repeat = false; repeat = false;
} catch (@SuppressWarnings("unused") IllegalThreadStateException e) { } catch (IllegalThreadStateException e) {
// this means the process has not yet terminated. // this means the process has not yet terminated.
repeat = true; repeat = true;
} }

View File

@ -65,7 +65,7 @@ public class Mangler {
int seed; int seed;
try { try {
seed = Integer.parseInt(args[0]); seed = Integer.parseInt(args[0]);
} catch (@SuppressWarnings("unused") NumberFormatException ex) { } catch (NumberFormatException ex) {
System.err.println("Invalid number: " + args[0]); System.err.println("Invalid number: " + args[0]);
return; return;
} }

View File

@ -69,19 +69,19 @@ public class Runtime {
private Runtime(String fileName, String filterFileName, String policyClassName) { private Runtime(String fileName, String filterFileName, String policyClassName) {
try (final FileInputStream in = new FileInputStream(filterFileName)) { try (final FileInputStream in = new FileInputStream(filterFileName)) {
filter = new FileOfClasses(in); filter = new FileOfClasses(in);
} catch (@SuppressWarnings("unused") Exception e) { } catch (Exception e) {
filter = null; filter = null;
} }
try { try {
output = new PrintWriter(new OutputStreamWriter(new GZIPOutputStream(new FileOutputStream(fileName)), "UTF-8")); output = new PrintWriter(new OutputStreamWriter(new GZIPOutputStream(new FileOutputStream(fileName)), "UTF-8"));
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
output = new PrintWriter(System.err); output = new PrintWriter(System.err);
} }
try { try {
handleCallback = (Policy) Class.forName(policyClassName).newInstance(); handleCallback = (Policy) Class.forName(policyClassName).newInstance();
} catch (@SuppressWarnings("unused") InstantiationException | IllegalAccessException | ClassNotFoundException e) { } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
handleCallback = new DefaultCallbackPolicy(); handleCallback = new DefaultCallbackPolicy();
} }

View File

@ -1653,7 +1653,7 @@ public abstract class Compiler implements Constants {
} else { } else {
return p; return p;
} }
} catch (@SuppressWarnings("unused") IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {
return null; return null;
} }
} }

View File

@ -47,7 +47,7 @@ final public class OfflineInstrumenter extends OfflineInstrumenterBase {
protected String getClassName(Object cl) { protected String getClassName(Object cl) {
try { try {
return ((ClassInstrumenter) cl).getReader().getName().replace('/', '.'); return ((ClassInstrumenter) cl).getReader().getName().replace('/', '.');
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
return null; return null;
} }
} }

View File

@ -176,7 +176,7 @@ public class AddSerialVersion {
} catch (IOException e1) { } catch (IOException e1) {
throw new Error("Unexpected IOException: " + e1.getMessage()); throw new Error("Unexpected IOException: " + e1.getMessage());
} }
} catch (@SuppressWarnings("unused") IOException e2) { } catch (IOException e2) {
} }
byte[] hash = digest.digest(); byte[] hash = digest.digest();
@ -193,11 +193,11 @@ public class AddSerialVersion {
byte[] data = Util.readFully(in); byte[] data = Util.readFully(in);
ClassReader r = new ClassReader(data); ClassReader r = new ClassReader(data);
System.out.println(Util.makeClass(r.getName()) + ": serialVersionUID = " + computeSerialVersionUID(r)); System.out.println(Util.makeClass(r.getName()) + ": serialVersionUID = " + computeSerialVersionUID(r));
} catch (@SuppressWarnings("unused") FileNotFoundException e) { } catch (FileNotFoundException e) {
System.err.println("File not found: " + args[i]); System.err.println("File not found: " + args[i]);
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
System.err.println("Error reading file: " + args[i]); System.err.println("Error reading file: " + args[i]);
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
System.err.println("Invalid class file: " + args[i]); System.err.println("Invalid class file: " + args[i]);
} }
} }

View File

@ -383,7 +383,7 @@ public class AnnotationsReader extends AttributeReader {
return new AnnotationsReader(iter, attrName); return new AnnotationsReader(iter, attrName);
} }
} }
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
} }
return null; return null;

View File

@ -197,7 +197,7 @@ public final class ClassReader implements ClassConstants {
} else { } else {
try { try {
return cpParser.getCPClass(c); return cpParser.getCPClass(c);
} catch (@SuppressWarnings("unused") IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {
throw new InvalidClassFileException(addr, "Invalid class constant pool index: " + c); throw new InvalidClassFileException(addr, "Invalid class constant pool index: " + c);
} }
} }
@ -361,7 +361,7 @@ public final class ClassReader implements ClassConstants {
} else { } else {
try { try {
return cpParser.getCPUtf8(s); return cpParser.getCPUtf8(s);
} catch (@SuppressWarnings("unused") IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {
throw new InvalidClassFileException(addr, "Invalid Utf8 constant pool index: " + s); throw new InvalidClassFileException(addr, "Invalid Utf8 constant pool index: " + s);
} }
} }

View File

@ -801,7 +801,7 @@ public class TypeAnnotationsReader extends AnnotationsReader {
for (; iter.isValid(); iter.advance()) { for (; iter.isValid(); iter.advance()) {
if (iter.getName().equals(attrName)) return newReader.apply(); if (iter.getName().equals(attrName)) return newReader.apply();
} }
} catch (@SuppressWarnings("unused") InvalidClassFileException e) { } catch (InvalidClassFileException e) {
Assertions.UNREACHABLE(); Assertions.UNREACHABLE();
} }
return null; return null;

View File

@ -105,7 +105,7 @@ public final class CRTable extends PositionsAttribute {
try { try {
short short_pc = (short) (pc & 0xFFFF); short short_pc = (short) (pc & 0xFFFF);
sourceInfo = new CRTData(short_pc, short_pc, 0, 0, CRTFlags.CRT_SOURCE_INFO); sourceInfo = new CRTData(short_pc, short_pc, 0, 0, CRTFlags.CRT_SOURCE_INFO);
} catch (@SuppressWarnings("unused") InvalidCRTDataException e) { } catch (InvalidCRTDataException e) {
assert false; assert false;
} }
} }

View File

@ -105,12 +105,12 @@ public final class MethodPositions extends PositionsAttribute {
Position end = null; Position end = null;
try { try {
start = readPosition(in, startVarName); start = readPosition(in, startVarName);
} catch (@SuppressWarnings("unused") InvalidPositionException e) { } catch (InvalidPositionException e) {
valid = false; valid = false;
} }
try { try {
end = readPosition(in, endVarName); end = readPosition(in, endVarName);
} catch (@SuppressWarnings("unused") InvalidPositionException e) { } catch (InvalidPositionException e) {
valid = false; valid = false;
} }
if (valid) { if (valid) {

View File

@ -54,7 +54,7 @@ public class ParanoidHashMap<K, V> extends LinkedHashMap<K, V> {
if (method.getDeclaringClass() == Object.class) { if (method.getDeclaringClass() == Object.class) {
assert false : o.getClass().toString(); assert false : o.getClass().toString();
} }
} catch (@SuppressWarnings("unused") Exception e) { } catch (Exception e) {
assert false : "Could not find hashCode method"; assert false : "Could not find hashCode method";
} }
} }

View File

@ -124,7 +124,7 @@ public class FloydWarshall<T> {
for(int j = 0; j <= G.getMaxNumber(); j++) { for(int j = 0; j <= G.getMaxNumber(); j++) {
try { try {
s += getPath(G.getNode(i), G.getNode(j)); s += getPath(G.getNode(i), G.getNode(j));
} catch (@SuppressWarnings("unused") UnsupportedOperationException e) { } catch (UnsupportedOperationException e) {
} }
} }
@ -179,7 +179,7 @@ public class FloydWarshall<T> {
for(int j = 0; j <= G.getMaxNumber(); j++) { for(int j = 0; j <= G.getMaxNumber(); j++) {
try { try {
x.add(getPaths(G.getNode(i), G.getNode(j))); x.add(getPaths(G.getNode(i), G.getNode(j)));
} catch (@SuppressWarnings("unused") UnsupportedOperationException e) { } catch (UnsupportedOperationException e) {
} }
} }

View File

@ -105,7 +105,7 @@ abstract public class BitVectorBase<T extends BitVectorBase> implements Cloneabl
BitVectorBase<T> result = null; BitVectorBase<T> result = null;
try { try {
result = (BitVectorBase<T>) super.clone(); result = (BitVectorBase<T>) super.clone();
} catch (@SuppressWarnings("unused") CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
// this shouldn't happen, since we are Cloneable // this shouldn't happen, since we are Cloneable
throw new InternalError(); throw new InternalError();
} }

View File

@ -119,7 +119,7 @@ public final class FixedSizeBitVector implements Cloneable, java.io.Serializable
int n = subscript(bit); int n = subscript(bit);
try { try {
return ((bits[n] & (1 << shiftBits)) != 0); return ((bits[n] & (1 << shiftBits)) != 0);
} catch (@SuppressWarnings("unused") ArrayIndexOutOfBoundsException e) { } catch (ArrayIndexOutOfBoundsException e) {
return false; return false;
} }
} }
@ -324,7 +324,7 @@ public final class FixedSizeBitVector implements Cloneable, java.io.Serializable
FixedSizeBitVector result = null; FixedSizeBitVector result = null;
try { try {
result = (FixedSizeBitVector) super.clone(); result = (FixedSizeBitVector) super.clone();
} catch (@SuppressWarnings("unused") CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
// this shouldn't happen, since we are Cloneable // this shouldn't happen, since we are Cloneable
throw new InternalError(); throw new InternalError();
} }

View File

@ -32,7 +32,7 @@ public class IntSetUtil {
Class<?> intSetFactoryClass = Class.forName(System.getProperty(INT_SET_FACTORY_CONFIG_PROPERTY_NAME)); Class<?> intSetFactoryClass = Class.forName(System.getProperty(INT_SET_FACTORY_CONFIG_PROPERTY_NAME));
MutableIntSetFactory<?> intSetFactory = (MutableIntSetFactory<?>) intSetFactoryClass.newInstance(); MutableIntSetFactory<?> intSetFactory = (MutableIntSetFactory<?>) intSetFactoryClass.newInstance();
setDefaultIntSetFactory(intSetFactory); setDefaultIntSetFactory(intSetFactory);
} catch (@SuppressWarnings("unused") Exception e) { } catch (Exception e) {
System.err.println(("Cannot use int set factory " + System.getProperty(INT_SET_FACTORY_CONFIG_PROPERTY_NAME))); System.err.println(("Cannot use int set factory " + System.getProperty(INT_SET_FACTORY_CONFIG_PROPERTY_NAME)));
setDefaultIntSetFactory(defaultFactory); setDefaultIntSetFactory(defaultFactory);
} }

View File

@ -29,7 +29,7 @@ public class LongSetUtil {
Class<?> intSetFactoryClass = Class.forName(System.getProperty(INT_SET_FACTORY_CONFIG_PROPERTY_NAME)); Class<?> intSetFactoryClass = Class.forName(System.getProperty(INT_SET_FACTORY_CONFIG_PROPERTY_NAME));
MutableLongSetFactory intSetFactory = (MutableLongSetFactory) intSetFactoryClass.newInstance(); MutableLongSetFactory intSetFactory = (MutableLongSetFactory) intSetFactoryClass.newInstance();
setDefaultLongSetFactory(intSetFactory); setDefaultLongSetFactory(intSetFactory);
} catch (@SuppressWarnings("unused") Exception e) { } catch (Exception e) {
System.err.println(("Cannot use int set factory " + System.getProperty(INT_SET_FACTORY_CONFIG_PROPERTY_NAME))); System.err.println(("Cannot use int set factory " + System.getProperty(INT_SET_FACTORY_CONFIG_PROPERTY_NAME)));
setDefaultLongSetFactory(defaultFactory); setDefaultLongSetFactory(defaultFactory);
} }

View File

@ -238,7 +238,7 @@ public abstract class Launcher {
while (repeat) { while (repeat) {
try { try {
Thread.sleep(SLEEP_MS); Thread.sleep(SLEEP_MS);
} catch (@SuppressWarnings("unused") InterruptedException e1) { } catch (InterruptedException e1) {
// e1.printStackTrace(); // e1.printStackTrace();
// just ignore and continue // just ignore and continue
} }
@ -251,7 +251,7 @@ public abstract class Launcher {
if (logger != null) { if (logger != null) {
logger.fine("process terminated with exit code " + p.exitValue()); logger.fine("process terminated with exit code " + p.exitValue());
} }
} catch (@SuppressWarnings("unused") IllegalThreadStateException e) { } catch (IllegalThreadStateException e) {
// this means the process has not yet terminated. // this means the process has not yet terminated.
repeat = true; repeat = true;
} }
@ -280,7 +280,7 @@ public abstract class Launcher {
s.read(data); s.read(data);
p.print(new String(data)); p.print(new String(data));
} }
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
// assume the stream has been closed (e.g. the process died) // assume the stream has been closed (e.g. the process died)
// so, just exit // so, just exit
} }
@ -298,7 +298,7 @@ public abstract class Launcher {
b.write(next); b.write(next);
next = s.read(); next = s.read();
} }
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
// assume the stream has been closed (e.g. the process died) // assume the stream has been closed (e.g. the process died)
// so, just print the data and then leave // so, just print the data and then leave
} }
@ -317,7 +317,7 @@ public abstract class Launcher {
int nRead = s.read(data); int nRead = s.read(data);
b.write(data, 0, nRead); b.write(data, 0, nRead);
} }
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
// assume the stream has been closed (e.g. the process died) // assume the stream has been closed (e.g. the process died)
// so, just exit // so, just exit
} }
@ -333,7 +333,7 @@ public abstract class Launcher {
b.write(next); b.write(next);
next = s.read(); next = s.read();
} }
} catch (@SuppressWarnings("unused") IOException e) { } catch (IOException e) {
// assume the stream has been closed (e.g. the process died) // assume the stream has been closed (e.g. the process died)
// so, just exit // so, just exit
} }

View File

@ -129,7 +129,7 @@ public class DotUtil {
// if we get here, the process has terminated // if we get here, the process has terminated
repeat = false; repeat = false;
System.out.println("process terminated with exit code " + p.exitValue()); System.out.println("process terminated with exit code " + p.exitValue());
} catch (@SuppressWarnings("unused") IllegalThreadStateException e) { } catch (IllegalThreadStateException e) {
// this means the process has not yet terminated. // this means the process has not yet terminated.
repeat = true; repeat = true;
} }