This commit is contained in:
Julian Dolby 2017-07-28 13:42:45 -04:00
commit 9dda017450
138 changed files with 281 additions and 424 deletions

View File

@ -32,8 +32,7 @@ public class ECJClassLoaderFactory extends ClassLoaderFactoryImpl {
}
}
protected JavaSourceLoaderImpl makeSourceLoader(ClassLoaderReference classLoaderReference, IClassHierarchy cha, IClassLoader parent)
throws IOException {
protected JavaSourceLoaderImpl makeSourceLoader(ClassLoaderReference classLoaderReference, IClassHierarchy cha, IClassLoader parent) {
return new ECJSourceLoaderImpl(classLoaderReference, parent, getExclusions(), cha, false);
}

View File

@ -37,8 +37,6 @@
*/
package com.ibm.wala.cast.java.translator.jdt.ecj;
import java.io.IOException;
import com.ibm.wala.cast.java.loader.JavaSourceLoaderImpl;
import com.ibm.wala.cast.java.translator.SourceModuleTranslator;
import com.ibm.wala.classLoader.IClassLoader;
@ -49,11 +47,11 @@ import com.ibm.wala.util.config.SetOfClasses;
public class ECJSourceLoaderImpl extends JavaSourceLoaderImpl {
private final boolean dump;
public ECJSourceLoaderImpl(ClassLoaderReference loaderRef, IClassLoader parent, SetOfClasses exclusions, IClassHierarchy cha) throws IOException {
public ECJSourceLoaderImpl(ClassLoaderReference loaderRef, IClassLoader parent, SetOfClasses exclusions, IClassHierarchy cha) {
this(loaderRef, parent, exclusions, cha, false);
}
public ECJSourceLoaderImpl(ClassLoaderReference loaderRef, IClassLoader parent, SetOfClasses exclusions, IClassHierarchy cha, boolean dump) throws IOException {
public ECJSourceLoaderImpl(ClassLoaderReference loaderRef, IClassLoader parent, SetOfClasses exclusions, IClassHierarchy cha, boolean dump) {
super(loaderRef, parent, exclusions, cha);
this.dump = dump;
}

View File

@ -21,8 +21,8 @@ org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.comparingIdentical=ignore
org.eclipse.jdt.core.compiler.problem.deadCode=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=error
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
@ -30,10 +30,10 @@ org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
@ -60,9 +60,9 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=error
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=ignore
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
@ -75,17 +75,17 @@ org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
@ -102,23 +102,23 @@ org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=error
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=ignore
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16

View File

@ -20,7 +20,6 @@ public class Array1 {
ary[i]= i;
}
@SuppressWarnings("unused")
int sum = 0;
for(int j= 0; j < ary.length; j++) {

View File

@ -9,7 +9,6 @@
* IBM Corporation - initial API and implementation
*****************************************************************************/
public class ArrayLiteral1 {
@SuppressWarnings("unused")
public static void main(String[] args) {
ArrayLiteral1 al1= new ArrayLiteral1();
int[] a= new int[] { 0, 1, 2, 3, 5 };

View File

@ -9,7 +9,6 @@
* IBM Corporation - initial API and implementation
*****************************************************************************/
public class ArrayLiteral2 {
@SuppressWarnings("unused")
public static void main(String[] args) {
ArrayLiteral2 al2= new ArrayLiteral2();
int[] x= {};

View File

@ -9,7 +9,7 @@
* IBM Corporation - initial API and implementation
*****************************************************************************/
public class CastFromNull {
@SuppressWarnings({ "cast", "unused" })
@SuppressWarnings({ "cast" })
public static void main(String args[]) {
new CastFromNull();
Object x = (Object) null;

View File

@ -14,7 +14,6 @@ public class Casts {
(new Casts()).test(args);
}
@SuppressWarnings("unused")
private void test(String[] args) {
long l1 = Long.parseLong(args[0]);
int i1 = Integer.parseInt(args[1]);

View File

@ -11,7 +11,6 @@
public class DefaultConstructors {
public static void main(String args[]) {
@SuppressWarnings("unused")
E e = new E();
// System.out.println(e.x);
// System.out.println(e.y);

View File

@ -11,7 +11,6 @@
public class Exception1 {
public static void main(String[] args) {
@SuppressWarnings("unused")
Exception1 e1= new Exception1();
try {
FooEx1 f = new FooEx1();

View File

@ -15,8 +15,8 @@ import java.io.IOException;
public final class Exception2 {
@SuppressWarnings("resource")
public static void main(String[] args) {
@SuppressWarnings("unused")
Exception2 e2= new Exception2();
FileInputStream fis = null;
FileOutputStream fos = null;

View File

@ -10,7 +10,6 @@
*****************************************************************************/
public class Finally1 {
public static void main(String[] args) throws BadLanguageExceptionF1 {
@SuppressWarnings("unused")
Finally1 f1= new Finally1();
try {
FooF1 f = new FooF1();

View File

@ -10,7 +10,6 @@
*****************************************************************************/
public class Inheritance1 {
public static void main(String[] args) {
@SuppressWarnings("unused")
Inheritance1 ih1= new Inheritance1();
Base b1 = new Base();
Base b2 = new Derived();
@ -23,7 +22,6 @@ public class Inheritance1 {
}
class Base {
public void foo() {
@SuppressWarnings("unused")
int i= 0;
}
public String bar(int x) {

View File

@ -10,7 +10,6 @@
*****************************************************************************/
public class InheritedField {
public static void main(String[] args) {
@SuppressWarnings("unused")
InheritedField if1= new InheritedField();
B b = new B();

View File

@ -22,7 +22,6 @@ public class InnerClass {
}
public void method() {
@SuppressWarnings("unused")
WhatsIt w= new WhatsIt();
}

View File

@ -52,7 +52,6 @@ public class InnerClassA {
AB ab = new AB();
AB.ABSubA absuba = ab.new ABSubA();
absuba.aba_x = 7;
@SuppressWarnings("unused")
AB.ABA.ABAA abaa2 = ab.new ABA().new ABAA(); // just used to add ABA instance key in ABAA.getABA_X()
AB.ABA aba = ab.new ABA();

View File

@ -48,7 +48,6 @@ public class InnerClassLexicalReads {
* 4 invokevirtual < Source, Ljava/io/PrintStream, println(I)V > v7,v8 @4 exception:v10[18:2] -> [18:38]
*/
public static void main(String args[]) {
@SuppressWarnings("unused")
InnerClassLexicalReads ignored = new InnerClassLexicalReads(); // call this just to make <init> reachable (test checks for unreachable methods)
int foo = 5;
int haha = foo * foo;

View File

@ -10,10 +10,8 @@
*****************************************************************************/
public class InterfaceTest1 {
public static void main(String[] args) {
@SuppressWarnings("unused")
InterfaceTest1 it= new InterfaceTest1();
IFoo foo = new FooIT1('a');
@SuppressWarnings("unused")
char ch2 = foo.getValue();
}
}

View File

@ -11,7 +11,6 @@
public class NullArrayInit {
String[] x = {null};
@SuppressWarnings("unused")
public static void main(String[] args) {
new NullArrayInit();
Object a[] = new Object[] {null,null};

View File

@ -9,7 +9,6 @@
* IBM Corporation - initial API and implementation
*****************************************************************************/
public class QualifiedStatic {
@SuppressWarnings("unused")
public static void main(String[] args) {
QualifiedStatic qs= new QualifiedStatic();
FooQ fq= new FooQ();

View File

@ -10,7 +10,6 @@
*****************************************************************************/
public class Scoping1 {
public static void main(String[] args) {
@SuppressWarnings("unused")
Scoping1 s1= new Scoping1();
{
int x= 5;

View File

@ -10,7 +10,6 @@
*****************************************************************************/
public class Scoping2 {
public static void main(String[] args) {
@SuppressWarnings("unused")
Scoping2 s2 = new Scoping2();
{
final int x = 5;

View File

@ -19,7 +19,6 @@ public class Simple1 {
this(0);
}
public static void doStuff(int N) {
@SuppressWarnings("unused")
int prod = 1;
for(int j=0; j < N; j++)
prod *= j;

View File

@ -9,7 +9,6 @@
* IBM Corporation - initial API and implementation
*****************************************************************************/
public class StaticNesting {
@SuppressWarnings("unused")
public static void main(String[] args) {
StaticNesting sn= new StaticNesting();
WhatsIt w= new WhatsIt();

View File

@ -38,6 +38,7 @@ public class Switch1 {
}
}
@SuppressWarnings("incomplete-switch")
public void testThree(String[] args) {
char ch = '?';
switch(Integer.parseInt(args[0])) {

View File

@ -18,7 +18,6 @@ public class TwoClasses {
this(0);
}
public static void doStuff(int N) {
@SuppressWarnings("unused")
int prod= 1;
TwoClasses tc= new TwoClasses();
tc.instanceMethod1();
@ -36,7 +35,6 @@ public class TwoClasses {
instanceMethod2();
}
public void instanceMethod2() {
@SuppressWarnings("unused")
Bar b= Bar.create('a');
}
}

View File

@ -10,7 +10,6 @@
*****************************************************************************/
public class WhileTest1 {
public static void main(String[] args) {
@SuppressWarnings("unused")
WhileTest1 wt1= new WhileTest1();
int x= 235834;
boolean stop= false;

View File

@ -87,7 +87,6 @@ public class InnerClassAA {
AB ab = new AB();
AB.ABSubA absuba = ab.new ABSubA();
absuba.aba_x = 7;
@SuppressWarnings("unused")
AB.ABA.ABAA abaa2 = ab.new ABA().new ABAA(); // just used to add ABA instance key in ABAA.getABA_X()
AB.ABA aba = ab.new ABA();

View File

@ -42,7 +42,7 @@ public class ArraysAndSuch {
public static void main(String args[]) {
ArraysAndSuch.main();
}
@SuppressWarnings("unused")
@SuppressWarnings("null")
public static void main() {
Object o1 = null;
Object[] os1 = new Object[] { null, o1, null };

View File

@ -102,7 +102,6 @@ public class ConstructorsAndInitializers extends Super {
class T{
}
@SuppressWarnings("unused")
T t = new T();
}
}

View File

@ -40,7 +40,6 @@ package foo.bar.hello.world;
public class CopyOfLoopsAndLabels {
static int X=5;
public static void main(String args[]) {
@SuppressWarnings("unused")
int k=X;
for (; ; k++)
break;

View File

@ -90,7 +90,6 @@ public class InnerClasses extends Temp {
se2.setSEVar();
System.out.println(sub2.hello()); //1001
@SuppressWarnings("unused")
int foo = 12;
foo++;
--foo;

View File

@ -51,7 +51,6 @@ public class MethodMadness {
public static void staticTest() {
System.out.println("staticTest");
}
@SuppressWarnings("static-access")
protected int protectedInteger() {
this.s = 5;
new MethodMadness("thrownaway").staticTest(); // MethodMadness object evaluated but thrown away

View File

@ -40,7 +40,6 @@ package foo.bar.hello.world;
public class MiniaturList2 {
public static void main(String[] args) {
@SuppressWarnings("unused")
int a;
for ( ;; ) {
break;

View File

@ -39,7 +39,7 @@ package foo.bar.hello.world;
public class Misc {
@SuppressWarnings({ "cast", "unused" })
@SuppressWarnings({ "cast", "incomplete-switch" })
public static void main(String args[]) {
if ( "hello" instanceof Object ) {
System.out.println("strings are objects in java");

View File

@ -116,13 +116,11 @@ public class CustomGenericsAndFields {
/////////////////////////////
@SuppressWarnings("unused")
String thrownaway = cg2.bar("a","b");
cg2.setFoo("real one");
MyGeneric<String,ConcreteGeneric2<String>> mygeneric = new MyGeneric<String,ConcreteGeneric2<String>>("useless",cg2);
String x = mygeneric.doFoo();
System.out.println(x);
@SuppressWarnings("unused")
String y = cg2.x;
System.out.println(mygeneric.getB().y);
System.out.println(mygeneric.b.y); // TODO: fields are going to be a pain... watch out for Lvalues in context?

View File

@ -47,7 +47,6 @@ public class ExplicitBoxingTest {
int a = 6;
a = a + a;
System.out.println(a);
@SuppressWarnings("unused")
Integer useless1 = new Integer(5+6);
Integer aa = new Integer(a+a);
int aaa = aa.intValue();
@ -56,7 +55,6 @@ public class ExplicitBoxingTest {
int b = 6;
b = b + b;
System.out.println(b);
@SuppressWarnings("unused")
Integer useless2 = 5+6;
Integer bb = b+b;
int bbb = bb;

View File

@ -52,7 +52,6 @@ public class GenericArrays {
List<Integer> li = new ArrayList<Integer>();
li.add(new Integer(3));
oa[1] = li; // correct
@SuppressWarnings("unused")
String s = (String) lsa[1].get(0); // run time error, but cast is explicit
}

View File

@ -13,7 +13,6 @@ package javaonepointfive;
public class TypeInferencePrimAndStringOp {
public static void main(String[] args) {
int a = 2;
@SuppressWarnings("unused")
String result = "a" + a;
}
}

View File

@ -11,7 +11,6 @@
package p;
public class NonPrimaryTopLevel {
@SuppressWarnings("unused")
public static void main(String[] args) {
NonPrimaryTopLevel nptl= new NonPrimaryTopLevel();
Foo f = new Foo();

View File

@ -102,7 +102,7 @@ org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

View File

@ -369,7 +369,7 @@ public abstract class IRTests {
return Pair.make(callGraph, engine.getPointerAnalysis());
}
protected static void dumpIR(CallGraph cg, Collection<String> sources, boolean assertReachable) throws IOException {
protected static void dumpIR(CallGraph cg, Collection<String> sources, boolean assertReachable) {
Set<String> sourcePaths = HashSetFactory.make();
for(String src : sources) {
sourcePaths.add(src.substring(src.lastIndexOf(File.separator)+1));

View File

@ -67,11 +67,11 @@ public abstract class JavaIRTests extends IRTests {
@Test public void testSimple1() throws IllegalArgumentException, CancelException, IOException {
List<? extends IRAssertion> assertions = Arrays.asList(
new SourceMapAssertion("Source#Simple1#doStuff#(I)V", "prod", 25),
new SourceMapAssertion("Source#Simple1#doStuff#(I)V", "j", 24),
new SourceMapAssertion("Source#Simple1#main#([Ljava/lang/String;)V", "s", 33),
new SourceMapAssertion("Source#Simple1#main#([Ljava/lang/String;)V", "i", 29),
new SourceMapAssertion("Source#Simple1#main#([Ljava/lang/String;)V", "sum", 30),
new SourceMapAssertion("Source#Simple1#doStuff#(I)V", "prod", 24),
new SourceMapAssertion("Source#Simple1#doStuff#(I)V", "j", 23),
new SourceMapAssertion("Source#Simple1#main#([Ljava/lang/String;)V", "s", 32),
new SourceMapAssertion("Source#Simple1#main#([Ljava/lang/String;)V", "i", 28),
new SourceMapAssertion("Source#Simple1#main#([Ljava/lang/String;)V", "sum", 29),
EdgeAssertions.make("Source#Simple1#main#([Ljava/lang/String;)V", "Source#Simple1#doStuff#(I)V"),
EdgeAssertions.make("Source#Simple1#instanceMethod1#()V", "Source#Simple1#instanceMethod2#()V"));

View File

@ -102,7 +102,7 @@ org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

View File

@ -483,12 +483,12 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
/** BEGIN Custom change: Common superclass is optional */
public JavaSourceLoaderImpl(boolean existsCommonSuperClass, ClassLoaderReference loaderRef, IClassLoader parent,
SetOfClasses exclusions, IClassHierarchy cha) throws IOException {
SetOfClasses exclusions, IClassHierarchy cha) {
super(loaderRef, cha.getScope().getArrayClassLoader(), parent, cha.getScope().getExclusions(), cha);
this.existsCommonSuperclass = existsCommonSuperClass;
}
public JavaSourceLoaderImpl(ClassLoaderReference loaderRef, IClassLoader parent, SetOfClasses exclusions, IClassHierarchy cha) throws IOException {
public JavaSourceLoaderImpl(ClassLoaderReference loaderRef, IClassLoader parent, SetOfClasses exclusions, IClassHierarchy cha) {
// standard case: we have a common super class
this(true, loaderRef, parent, exclusions, cha);
}

View File

@ -102,7 +102,7 @@ org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

View File

@ -43,7 +43,6 @@ import com.ibm.wala.ipa.callgraph.propagation.cfa.ZeroXInstanceKeys;
import com.ibm.wala.ipa.cha.ClassHierarchyFactory;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.ssa.IRFactory;
import com.ibm.wala.util.CancelException;
import com.ibm.wala.util.WalaException;
/**
@ -52,12 +51,12 @@ import com.ibm.wala.util.WalaException;
public class NodejsCallGraphBuilderUtil extends JSCallGraphUtil {
public static PropagationCallGraphBuilder makeCGBuilder(File mainFile)
throws IOException, IllegalArgumentException, CancelException, WalaException {
throws IOException, IllegalArgumentException, WalaException {
return makeCGBuilder(mainFile.getParentFile(), mainFile);
}
public static PropagationCallGraphBuilder makeCGBuilder(File workingDir, File mainFile)
throws IOException, IllegalArgumentException, CancelException, WalaException {
throws IOException, IllegalArgumentException, WalaException {
JavaScriptTranslatorFactory translatorFactory = new CAstRhinoTranslatorFactory();
JSCallGraphUtil.setTranslatorFactory(translatorFactory);

View File

@ -102,7 +102,7 @@ org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

View File

@ -1,6 +1,5 @@
package com.ibm.wala.cast.js.rhino.callgraph.fieldbased.test;
import java.io.IOException;
import java.net.URL;
import java.util.Map;
import java.util.Set;
@ -34,11 +33,11 @@ public abstract class AbstractFieldBasedTest extends TestJSCallGraphShape {
util = new FieldBasedCGUtil(new CAstRhinoTranslatorFactory());
}
protected JSCallGraph runTest(String script, Object[][] assertions, BuilderType... builderTypes) throws IOException, WalaException, Error, CancelException {
protected JSCallGraph runTest(String script, Object[][] assertions, BuilderType... builderTypes) throws WalaException, Error, CancelException {
return runTest(TestFieldBasedCG.class.getClassLoader().getResource(script), assertions, builderTypes);
}
protected JSCallGraph runTest(URL url, Object[][] assertions, BuilderType... builderTypes) throws IOException, WalaException, Error, CancelException {
protected JSCallGraph runTest(URL url, Object[][] assertions, BuilderType... builderTypes) throws WalaException, Error, CancelException {
JSCallGraph cg = null;
for(BuilderType builderType : builderTypes) {
ProgressMaster monitor = ProgressMaster.make(new NullProgressMonitor(), 45000, true);
@ -56,7 +55,7 @@ public abstract class AbstractFieldBasedTest extends TestJSCallGraphShape {
/**
* for long-running tests that tend to time out on Travis
*/
protected JSCallGraph runTestExceptOnTravis(URL url, Object[][] assertions, BuilderType... builderTypes) throws IOException, WalaException, Error, CancelException {
protected JSCallGraph runTestExceptOnTravis(URL url, Object[][] assertions, BuilderType... builderTypes) throws WalaException, Error, CancelException {
if (System.getenv("TRAVIS") == null) {
return runTest(url, assertions, builderTypes);
} else {

View File

@ -1,7 +1,5 @@
package com.ibm.wala.cast.js.rhino.callgraph.fieldbased.test;
import java.io.IOException;
import org.junit.Test;
import com.ibm.wala.cast.ir.translator.TranslatorToCAst.Error;
@ -13,7 +11,7 @@ import com.ibm.wala.util.WalaException;
public class FieldBasedComparisonTest extends AbstractFieldBasedTest {
private void test(String file, Object[][] assertions, BuilderType builderType) throws IOException, WalaException, Error, CancelException {
private void test(String file, Object[][] assertions, BuilderType builderType) throws WalaException, Error, CancelException {
boolean save = JSSourceExtractor.USE_TEMP_NAME;
try {
JSSourceExtractor.USE_TEMP_NAME = false;
@ -24,32 +22,32 @@ public class FieldBasedComparisonTest extends AbstractFieldBasedTest {
}
@Test(expected = AssertionError.class)
public void testSkeletonPessimistic() throws IOException, WalaException, Error, CancelException {
public void testSkeletonPessimistic() throws WalaException, Error, CancelException {
test("pages/skeleton.html", TestSimplePageCallGraphShape.assertionsForSkeleton, BuilderType.PESSIMISTIC);
}
@Test
public void testSkeletonOptimistic() throws IOException, WalaException, Error, CancelException {
public void testSkeletonOptimistic() throws WalaException, Error, CancelException {
test("pages/skeleton.html", TestSimplePageCallGraphShape.assertionsForSkeleton, BuilderType.OPTIMISTIC);
}
@Test
public void testSkeletonWorklist() throws IOException, WalaException, Error, CancelException {
public void testSkeletonWorklist() throws WalaException, Error, CancelException {
test("pages/skeleton.html", TestSimplePageCallGraphShape.assertionsForSkeleton, BuilderType.OPTIMISTIC_WORKLIST);
}
@Test(expected = AssertionError.class)
public void testSkeleton2Pessimistic() throws IOException, WalaException, Error, CancelException {
public void testSkeleton2Pessimistic() throws WalaException, Error, CancelException {
test("pages/skeleton2.html", TestSimplePageCallGraphShape.assertionsForSkeleton2, BuilderType.PESSIMISTIC);
}
@Test
public void testSkeleton2Optimistic() throws IOException, WalaException, Error, CancelException {
public void testSkeleton2Optimistic() throws WalaException, Error, CancelException {
test("pages/skeleton2.html", TestSimplePageCallGraphShape.assertionsForSkeleton2, BuilderType.OPTIMISTIC);
}
@Test
public void testSkeleton2Worklist() throws IOException, WalaException, Error, CancelException {
public void testSkeleton2Worklist() throws WalaException, Error, CancelException {
test("pages/skeleton2.html", TestSimplePageCallGraphShape.assertionsForSkeleton2, BuilderType.OPTIMISTIC_WORKLIST);
}

View File

@ -10,8 +10,6 @@
*****************************************************************************/
package com.ibm.wala.cast.js.rhino.callgraph.fieldbased.test;
import java.io.IOException;
import org.junit.Test;
import com.ibm.wala.cast.ir.translator.TranslatorToCAst.Error;
@ -28,17 +26,17 @@ public class TestFieldBasedCG extends AbstractFieldBasedTest {
};
@Test
public void testSimpleJSPessimistic() throws IOException, WalaException, Error, CancelException {
public void testSimpleJSPessimistic() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/simple.js", assertionsForSimpleJS, BuilderType.PESSIMISTIC);
}
@Test
public void testSimpleJSOptimistic() throws IOException, WalaException, Error, CancelException {
public void testSimpleJSOptimistic() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/simple.js", assertionsForSimpleJS, BuilderType.OPTIMISTIC);
}
@Test
public void testSimpleJSWorklist() throws IOException, WalaException, Error, CancelException {
public void testSimpleJSWorklist() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/simple.js", assertionsForSimpleJS, BuilderType.OPTIMISTIC_WORKLIST);
}
@ -49,17 +47,17 @@ public class TestFieldBasedCG extends AbstractFieldBasedTest {
};
@Test
public void testOneshotPessimistic() throws IOException, WalaException, Error, CancelException {
public void testOneshotPessimistic() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/oneshot.js", assertionsForOneShot, BuilderType.PESSIMISTIC);
}
@Test
public void testOneshotOptimistic() throws IOException, WalaException, Error, CancelException {
public void testOneshotOptimistic() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/oneshot.js", assertionsForOneShot, BuilderType.OPTIMISTIC);
}
@Test
public void testOneshotWorklist() throws IOException, WalaException, Error, CancelException {
public void testOneshotWorklist() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/oneshot.js", assertionsForOneShot, BuilderType.OPTIMISTIC_WORKLIST);
}
@ -71,12 +69,12 @@ public class TestFieldBasedCG extends AbstractFieldBasedTest {
};
@Test
public void testCallbacksOptimistic() throws IOException, WalaException, Error, CancelException {
public void testCallbacksOptimistic() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/callbacks.js", assertionsForCallbacks, BuilderType.OPTIMISTIC_WORKLIST);
}
@Test
public void testCallbacksWorklist() throws IOException, WalaException, Error, CancelException {
public void testCallbacksWorklist() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/callbacks.js", assertionsForCallbacks, BuilderType.OPTIMISTIC_WORKLIST);
}
@ -85,17 +83,17 @@ public class TestFieldBasedCG extends AbstractFieldBasedTest {
};
@Test
public void testLexicalPessimistic() throws IOException, WalaException, Error, CancelException {
public void testLexicalPessimistic() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/lexical.js", assertionsForLexical, BuilderType.PESSIMISTIC);
}
@Test
public void testLexicalOptimistic() throws IOException, WalaException, Error, CancelException {
public void testLexicalOptimistic() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/lexical.js", assertionsForLexical, BuilderType.OPTIMISTIC);
}
@Test
public void testLexicalWorklist() throws IOException, WalaException, Error, CancelException {
public void testLexicalWorklist() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/lexical.js", assertionsForLexical, BuilderType.OPTIMISTIC_WORKLIST);
}
@ -107,12 +105,12 @@ public class TestFieldBasedCG extends AbstractFieldBasedTest {
};
@Test
public void testReflectiveCallOptimistic() throws IOException, WalaException, Error, CancelException {
public void testReflectiveCallOptimistic() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/reflective_calls.js", assertionsForReflectiveCall, BuilderType.OPTIMISTIC);
}
@Test
public void testReflectiveCallWorklist() throws IOException, WalaException, Error, CancelException {
public void testReflectiveCallWorklist() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/reflective_calls.js", assertionsForReflectiveCall, BuilderType.OPTIMISTIC_WORKLIST);
}
@ -122,12 +120,12 @@ public class TestFieldBasedCG extends AbstractFieldBasedTest {
};
@Test
public void testNewOptimistic() throws IOException, WalaException, Error, CancelException {
public void testNewOptimistic() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/new.js", assertionsForNew, BuilderType.OPTIMISTIC);
}
@Test
public void testNewWorklist() throws IOException, WalaException, Error, CancelException {
public void testNewWorklist() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/new.js", assertionsForNew, BuilderType.OPTIMISTIC_WORKLIST);
}
@ -137,17 +135,17 @@ public class TestFieldBasedCG extends AbstractFieldBasedTest {
};
@Test
public void testCallbacks2Optimistic() throws IOException, WalaException, Error, CancelException {
public void testCallbacks2Optimistic() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/callbacks2.js", assertionsForCallbacks2, BuilderType.OPTIMISTIC);
}
@Test
public void testCallbacks2Worklist() throws IOException, WalaException, Error, CancelException {
public void testCallbacks2Worklist() throws WalaException, Error, CancelException {
runTest("tests/fieldbased/callbacks2.js", assertionsForCallbacks2, BuilderType.OPTIMISTIC_WORKLIST);
}
// @Test
public void testBug2979() throws IOException, WalaException, Error, CancelException {
public void testBug2979() throws WalaException, Error, CancelException {
System.err.println(runTest("pages/2979.html", new Object[][]{}, BuilderType.PESSIMISTIC, BuilderType.OPTIMISTIC, BuilderType.OPTIMISTIC_WORKLIST));
}

View File

@ -90,7 +90,7 @@ public class PrintIRs {
}
private static void printIRsForHTML(String filename) throws IllegalArgumentException, MalformedURLException, IOException,
CancelException, WalaException, Error {
WalaException, Error {
// use Rhino to parse JavaScript
JSCallGraphUtil.setTranslatorFactory(new CAstRhinoTranslatorFactory());
// add model for DOM APIs

View File

@ -31,7 +31,6 @@ import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.cha.ClassHierarchyException;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.util.CancelException;
import com.ibm.wala.util.collections.HashMapFactory;
public class TestRhinoSourceMap {
@ -149,7 +148,7 @@ public class TestRhinoSourceMap {
};
@Test
public void testJquerySpecTestSourceMappings() throws IllegalArgumentException, IOException, CancelException, ClassHierarchyException {
public void testJquerySpecTestSourceMappings() throws IllegalArgumentException, IOException, ClassHierarchyException {
checkFunctionBodies("jquery_spec_test.js", jquery_spec_testSource);
}

View File

@ -10,7 +10,6 @@
*****************************************************************************/
package com.ibm.wala.cast.js.test;
import java.io.IOException;
import java.net.URL;
import org.junit.Before;
@ -35,14 +34,14 @@ public abstract class TestSimplePageCallGraphShapeRhino extends TestSimplePageCa
new Object[] { "page3.html", new String[] { "page3.html/__WINDOW_MAIN__" } }
};
@Test public void testPage3() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testPage3() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/page3.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url, DefaultSourceExtractor.factory);
verifyGraphAssertions(CG, assertionsForPage3);
}
@Test(expected = WalaException.class)
public void testJSParseError() throws IOException, IllegalArgumentException, CancelException, WalaException {
public void testJSParseError() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/garbage2.html");
JSCFABuilder B = JSCallGraphBuilderUtil.makeHTMLCGBuilder(url, DefaultSourceExtractor.factory);
B.makeCallGraph(B.getOptions());

View File

@ -10,7 +10,6 @@
*******************************************************************************/
package com.ibm.wala.cast.js.test;
import java.io.IOException;
import java.net.URL;
import org.junit.Test;
@ -27,13 +26,13 @@ import com.ibm.wala.util.WalaException;
public class TestSimplePageCallGraphShapeRhinoJericho extends TestSimplePageCallGraphShapeRhino {
@Test public void testCrawl() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testCrawl() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/crawl.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url, DefaultSourceExtractor.factory);
verifyGraphAssertions(CG, null);
}
@Test public void testParseError() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testParseError() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/garbage.html");
JSCFABuilder B = JSCallGraphBuilderUtil.makeHTMLCGBuilder(url, DefaultSourceExtractor.factory);
B.makeCallGraph(B.getOptions());

View File

@ -101,7 +101,7 @@ org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

View File

@ -62,11 +62,11 @@ public class FieldBasedCGUtil {
this.translatorFactory = translatorFactory;
}
public Pair<JSCallGraph, PointerAnalysis<ObjectVertex>> buildCG(URL url, BuilderType builderType, boolean supportFullPointerAnalysis, Function<Void, JSSourceExtractor> fExtractor) throws IOException, WalaException, CancelException {
public Pair<JSCallGraph, PointerAnalysis<ObjectVertex>> buildCG(URL url, BuilderType builderType, boolean supportFullPointerAnalysis, Function<Void, JSSourceExtractor> fExtractor) throws WalaException, CancelException {
return buildCG(url, builderType, new NullProgressMonitor(), supportFullPointerAnalysis, fExtractor);
}
public Pair<JSCallGraph, PointerAnalysis<ObjectVertex>> buildCG(URL url, BuilderType builderType, IProgressMonitor monitor, boolean supportFullPointerAnalysis, Function<Void, JSSourceExtractor> fExtractor) throws IOException, WalaException, CancelException {
public Pair<JSCallGraph, PointerAnalysis<ObjectVertex>> buildCG(URL url, BuilderType builderType, IProgressMonitor monitor, boolean supportFullPointerAnalysis, Function<Void, JSSourceExtractor> fExtractor) throws WalaException, CancelException {
if (url.getFile().endsWith(".js")) {
return buildScriptCG(url, builderType, monitor, supportFullPointerAnalysis);
} else {
@ -74,7 +74,7 @@ public class FieldBasedCGUtil {
}
}
public Pair<JSCallGraph, PointerAnalysis<ObjectVertex>> buildScriptCG(URL url, BuilderType builderType, IProgressMonitor monitor, boolean supportFullPointerAnalysis) throws IOException, WalaException, CancelException {
public Pair<JSCallGraph, PointerAnalysis<ObjectVertex>> buildScriptCG(URL url, BuilderType builderType, IProgressMonitor monitor, boolean supportFullPointerAnalysis) throws WalaException, CancelException {
JavaScriptLoaderFactory loaders = new JavaScriptLoaderFactory(translatorFactory);
Module[] scripts = new Module[]{
new SourceURLModule(url),
@ -89,13 +89,13 @@ public class FieldBasedCGUtil {
return buildCG(loaders, scripts, builderType, monitor, supportFullPointerAnalysis);
}
public Pair<JSCallGraph, PointerAnalysis<ObjectVertex>> buildPageCG(URL url, BuilderType builderType, IProgressMonitor monitor, boolean supportFullPointerAnalysis, Function<Void, JSSourceExtractor> fExtractor) throws IOException, WalaException, CancelException {
public Pair<JSCallGraph, PointerAnalysis<ObjectVertex>> buildPageCG(URL url, BuilderType builderType, IProgressMonitor monitor, boolean supportFullPointerAnalysis, Function<Void, JSSourceExtractor> fExtractor) throws WalaException, CancelException {
JavaScriptLoaderFactory loaders = new WebPageLoaderFactory(translatorFactory);
SourceModule[] scripts = JSCallGraphBuilderUtil.makeHtmlScope(url, loaders, fExtractor);
return buildCG(loaders, scripts, builderType, monitor, supportFullPointerAnalysis);
}
public Pair<JSCallGraph, PointerAnalysis<ObjectVertex>> buildCG(JavaScriptLoaderFactory loaders, Module[] scripts, BuilderType builderType, IProgressMonitor monitor, boolean supportFullPointerAnalysis) throws IOException, WalaException, CancelException {
public Pair<JSCallGraph, PointerAnalysis<ObjectVertex>> buildCG(JavaScriptLoaderFactory loaders, Module[] scripts, BuilderType builderType, IProgressMonitor monitor, boolean supportFullPointerAnalysis) throws WalaException, CancelException {
CAstAnalysisScope scope = new CAstAnalysisScope(scripts, loaders, Collections.singleton(JavaScriptLoader.JS));
IClassHierarchy cha = ClassHierarchyFactory.make(scope, loaders, JavaScriptLoader.JS);
Util.checkForFrontEndErrors(cha);

View File

@ -160,7 +160,7 @@ public class JSCallGraphBuilderUtil extends com.ibm.wala.cast.js.ipa.callgraph.J
return CG;
}
public static CallGraph makeScriptCG(SourceModule[] scripts, CGBuilderType builderType, IRFactory<IMethod> irFactory) throws IOException, IllegalArgumentException,
public static CallGraph makeScriptCG(SourceModule[] scripts, CGBuilderType builderType, IRFactory<IMethod> irFactory) throws IllegalArgumentException,
CancelException, WalaException {
CAstRewriterFactory<?, ?> preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, scripts) : null;
PropagationCallGraphBuilder b = makeCGBuilder(makeLoaders(preprocessor), scripts, builderType, irFactory);
@ -169,11 +169,11 @@ public class JSCallGraphBuilderUtil extends com.ibm.wala.cast.js.ipa.callgraph.J
return CG;
}
public static JSCFABuilder makeHTMLCGBuilder(URL url, Function<Void, JSSourceExtractor> fExtractor) throws IOException, WalaException {
public static JSCFABuilder makeHTMLCGBuilder(URL url, Function<Void, JSSourceExtractor> fExtractor) throws WalaException {
return makeHTMLCGBuilder(url, CGBuilderType.ZERO_ONE_CFA, fExtractor);
}
public static JSCFABuilder makeHTMLCGBuilder(URL url, CGBuilderType builderType, Function<Void, JSSourceExtractor> fExtractor) throws IOException, WalaException {
public static JSCFABuilder makeHTMLCGBuilder(URL url, CGBuilderType builderType, Function<Void, JSSourceExtractor> fExtractor) throws WalaException {
IRFactory<IMethod> irFactory = AstIRFactory.makeDefaultFactory();
CAstRewriterFactory<?, ?> preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, url) : null;
JavaScriptLoaderFactory loaders = new WebPageLoaderFactory(translatorFactory, preprocessor);
@ -205,26 +205,26 @@ public class JSCallGraphBuilderUtil extends com.ibm.wala.cast.js.ipa.callgraph.J
return scriptsArray;
}
public static CallGraph makeHTMLCG(URL url, Function<Void, JSSourceExtractor> fExtractor) throws IOException, IllegalArgumentException, CancelException, WalaException {
public static CallGraph makeHTMLCG(URL url, Function<Void, JSSourceExtractor> fExtractor) throws IllegalArgumentException, CancelException, WalaException {
SSAPropagationCallGraphBuilder b = makeHTMLCGBuilder(url, fExtractor);
CallGraph CG = b.makeCallGraph(b.getOptions());
dumpCG(b.getCFAContextInterpreter(), b.getPointerAnalysis(), CG);
return CG;
}
public static CallGraph makeHTMLCG(URL url, CGBuilderType builderType, Function<Void, JSSourceExtractor> fExtractor) throws IOException, IllegalArgumentException,
public static CallGraph makeHTMLCG(URL url, CGBuilderType builderType, Function<Void, JSSourceExtractor> fExtractor) throws IllegalArgumentException,
CancelException, WalaException {
PropagationCallGraphBuilder b = makeHTMLCGBuilder(url, builderType, fExtractor);
CallGraph CG = b.makeCallGraph(b.getOptions());
return CG;
}
public static JSCFABuilder makeCGBuilder(JavaScriptLoaderFactory loaders, SourceModule[] scripts, CGBuilderType builderType, IRFactory<IMethod> irFactory) throws IOException, WalaException {
public static JSCFABuilder makeCGBuilder(JavaScriptLoaderFactory loaders, SourceModule[] scripts, CGBuilderType builderType, IRFactory<IMethod> irFactory) throws WalaException {
AnalysisScope scope = makeScope(scripts, loaders, JavaScriptLoader.JS);
return makeCG(loaders, scope, builderType, irFactory);
}
protected static JSCFABuilder makeCG(JavaScriptLoaderFactory loaders, AnalysisScope scope, CGBuilderType builderType, IRFactory<IMethod> irFactory) throws IOException, WalaException {
protected static JSCFABuilder makeCG(JavaScriptLoaderFactory loaders, AnalysisScope scope, CGBuilderType builderType, IRFactory<IMethod> irFactory) throws WalaException {
try {
IClassHierarchy cha = makeHierarchy(scope, loaders);
com.ibm.wala.cast.js.util.Util.checkForFrontEndErrors(cha);
@ -244,15 +244,15 @@ public class JSCallGraphBuilderUtil extends com.ibm.wala.cast.js.ipa.callgraph.J
}
}
public static CallGraph makeHTMLCG(URL url, CGBuilderType zeroOneCfaNoCallApply) throws IllegalArgumentException, IOException, CancelException, WalaException {
public static CallGraph makeHTMLCG(URL url, CGBuilderType zeroOneCfaNoCallApply) throws IllegalArgumentException, CancelException, WalaException {
return makeHTMLCG(url, zeroOneCfaNoCallApply, DefaultSourceExtractor.factory);
}
public static CallGraph makeHTMLCG(URL url) throws IllegalArgumentException, IOException, CancelException, WalaException {
public static CallGraph makeHTMLCG(URL url) throws IllegalArgumentException, CancelException, WalaException {
return makeHTMLCG(url, DefaultSourceExtractor.factory);
}
public static JSCFABuilder makeHTMLCGBuilder(URL url) throws IOException, WalaException {
public static JSCFABuilder makeHTMLCGBuilder(URL url) throws WalaException {
return makeHTMLCGBuilder(url, DefaultSourceExtractor.factory);
}
}

View File

@ -10,7 +10,6 @@
*****************************************************************************/
package com.ibm.wala.cast.js.test;
import java.io.IOException;
import java.net.URL;
import org.junit.Test;
@ -30,7 +29,7 @@ public abstract class TestAjaxsltCallGraphShape extends TestJSCallGraphShape {
};
@Test public void testAjaxslt() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testAjaxslt() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("ajaxslt/test/xslt.html");
// need to turn off call/apply handling for this to scale; alternatively use 1-CFA
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url, CGBuilderType.ZERO_ONE_CFA_NO_CALL_APPLY);
@ -42,7 +41,7 @@ public abstract class TestAjaxsltCallGraphShape extends TestJSCallGraphShape {
};
@Test public void testAjaxpath() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testAjaxpath() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("ajaxslt/test/xpath.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url);
verifyGraphAssertions(CG, assertionsForAjaxpath);

View File

@ -34,14 +34,14 @@ public abstract class TestForInLoopHack extends TestJSCallGraphShape {
JSSourceExtractor.DELETE_UPON_EXIT = false;
}
@Test public void testPage3WithoutHack() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testPage3WithoutHack() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/page3.html");
JSCFABuilder builder = JSCallGraphBuilderUtil.makeHTMLCGBuilder(url);
CallGraph CG = builder.makeCallGraph(builder.getOptions());
CAstCallGraphUtil.dumpCG(builder.getCFAContextInterpreter(), builder.getPointerAnalysis(), CG);
}
@Test public void testPage3WithHack() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testPage3WithHack() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/page3.html");
JSCFABuilder builder = JSCallGraphBuilderUtil.makeHTMLCGBuilder(url);
addHackedForInLoopSensitivity(builder);
@ -50,7 +50,7 @@ public abstract class TestForInLoopHack extends TestJSCallGraphShape {
}
@Ignore("This test now blows up due to proper handling of the || construct, used in extend(). Should handle this eventually.")
@Test public void testJQueryWithHack() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testJQueryWithHack() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/jquery_hacked.html");
JSCFABuilder builder = JSCallGraphBuilderUtil.makeHTMLCGBuilder(url);
addHackedForInLoopSensitivity(builder);

View File

@ -10,7 +10,6 @@
*******************************************************************************/
package com.ibm.wala.cast.js.test;
import java.io.IOException;
import java.net.URL;
import org.junit.Before;
@ -37,7 +36,7 @@ public class TestJQueryExamples extends TestJSCallGraphShape {
}
@Ignore("This tries to analyze unmodified jquery, which we can't do yet")
@Test public void testEx1() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testEx1() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/jquery/ex1.html");
JSCFABuilder builder = JSCallGraphBuilderUtil.makeHTMLCGBuilder(url);
CallGraph CG = builder.makeCallGraph(builder.getOptions());

View File

@ -162,7 +162,7 @@ public abstract class TestPointerAnalyses {
return false;
}
private void testPage(URL page, Predicate<MethodReference> filter, Predicate<Pair<Set<Pair<CGNode, NewSiteReference>>, Set<Pair<CGNode, NewSiteReference>>>> test) throws IOException, WalaException, CancelException {
private void testPage(URL page, Predicate<MethodReference> filter, Predicate<Pair<Set<Pair<CGNode, NewSiteReference>>, Set<Pair<CGNode, NewSiteReference>>>> test) throws WalaException, CancelException {
boolean save = JSSourceExtractor.USE_TEMP_NAME;
try {
JSSourceExtractor.USE_TEMP_NAME = false;
@ -366,7 +366,7 @@ public abstract class TestPointerAnalyses {
}, node, vn);
}
private void testPageUserCodeEquivalent(URL page) throws IOException, WalaException, CancelException {
private void testPageUserCodeEquivalent(URL page) throws WalaException, CancelException {
final String name = page.getFile().substring(page.getFile().lastIndexOf('/')+1, page.getFile().lastIndexOf('.'));
testPage(page, nameFilter(name), new CheckPointers());
}
@ -383,7 +383,7 @@ public abstract class TestPointerAnalyses {
}
@Test
public void testWindowOnload() throws IOException, WalaException, CancelException {
public void testWindowOnload() throws WalaException, CancelException {
testPageUserCodeEquivalent(getClass().getClassLoader().getResource("pages/windowonload.html"));
}

View File

@ -10,7 +10,6 @@
*****************************************************************************/
package com.ibm.wala.cast.js.test;
import java.io.IOException;
import java.net.URL;
import org.junit.Ignore;
@ -32,7 +31,7 @@ public abstract class TestPrototypeCallGraphShape extends TestJSCallGraphShape {
@Ignore("reminder that this no longer works with correlation tracking")
@Test
public void testPrototype() throws IOException, IllegalArgumentException, CancelException, WalaException {
public void testPrototype() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/prototype.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url);
verifyGraphAssertions(CG, assertionsForPrototype);

View File

@ -10,7 +10,6 @@
*****************************************************************************/
package com.ibm.wala.cast.js.test;
import java.io.IOException;
import java.net.URL;
import org.junit.Before;
@ -50,7 +49,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
}
};
@Test public void testPage1() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testPage1() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/page1.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url);
verifyGraphAssertions(CG, assertionsForPage1);
@ -61,7 +60,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
new Object[] { "page2.html", new String[] { "page2.html/__WINDOW_MAIN__" } }
};
@Test public void testPage2() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testPage2() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/page2.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url);
verifyGraphAssertions(CG, assertionsForPage2);
@ -78,7 +77,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
}
};
@Test public void testCrawlPage11() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testCrawlPage11() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/crawl/page11.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url);
verifyGraphAssertions(CG, assertionsForPage11);
@ -95,7 +94,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
}
};
@Test public void testCrawlPage11b() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testCrawlPage11b() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/crawl/page11b.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url);
verifyGraphAssertions(CG, assertionsForPage11b);
@ -127,7 +126,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
},
};
@Test public void testCrawlPage12() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testCrawlPage12() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/crawl/page12.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url);
verifyGraphAssertions(CG, assertionsForPage12);
@ -160,7 +159,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
}
};
@Test public void testCrawlPage13() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testCrawlPage13() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/crawl/page13.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url);
verifyGraphAssertions(CG, assertionsForPage13);
@ -178,7 +177,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
}
};
@Test public void testCrawlPage15() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testCrawlPage15() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/crawl/page15.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url);
verifyGraphAssertions(CG, assertionsForPage15);
@ -196,7 +195,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
}
};
@Test public void testCrawlPage16() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testCrawlPage16() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/crawl/page16.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url);
verifyGraphAssertions(CG, assertionsForPage16);
@ -219,7 +218,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
}
};
@Test public void testCrawlPage17() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testCrawlPage17() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/crawl/page17.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url);
verifyGraphAssertions(CG, assertionsForPage17);
@ -232,19 +231,19 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
new Object[] { "apollo-example.html/__WINDOW_MAIN__/signon", new String[] { "preamble.js/DOMWindow/window_open" } }
};
@Test public void testApolloExample() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testApolloExample() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/apollo-example.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url);
verifyGraphAssertions(CG, assertionsForApolloExample);
}
@Test public void testNojs() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testNojs() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/nojs.html");
// all we need is for it to finish building CG successfully.
JSCallGraphBuilderUtil.makeHTMLCG(url);
}
@Test public void testPage4() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testPage4() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/page4.html");
JSCallGraphBuilderUtil.makeHTMLCG(url);
}
@ -259,7 +258,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
new Object[]{ "suffix:forall_base", "pages/collection.js", 4, 4 }
};
@Test public void testList() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testList() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/list.html");
JSCFABuilder builder = JSCallGraphBuilderUtil.makeHTMLCGBuilder(url);
CallGraph CG = builder.makeCallGraph(builder.getOptions());
@ -268,7 +267,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
verifySourceAssertions(CG, sourceAssertionsForList);
}
@Test public void testIframeTest2() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testIframeTest2() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/iframeTest2.html");
JSCallGraphBuilderUtil.makeHTMLCG(url);
}
@ -282,7 +281,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
};
@Test public void testWindowx() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testWindowx() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/windowx.html");
JSCFABuilder builder = JSCallGraphBuilderUtil.makeHTMLCGBuilder(url);
CallGraph CG = builder.makeCallGraph(builder.getOptions());
@ -296,7 +295,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
new Object[] { "windowonload.html/__WINDOW_MAIN__", new String[] { "windowonload.html/__WINDOW_MAIN__/onload_handler" } },
};
@Test public void testWindowOnload() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testWindowOnload() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/windowonload.html");
JSCFABuilder builder = JSCallGraphBuilderUtil.makeHTMLCGBuilder(url);
CallGraph CG = builder.makeCallGraph(builder.getOptions());
@ -312,7 +311,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
new Object[] { "skeleton.html/__WINDOW_MAIN__/bad_guy", new String[] { "skeleton.html/__WINDOW_MAIN__/dollar" } },
};
@Test public void testSkeleton() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testSkeleton() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/skeleton.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url);
verifyGraphAssertions(CG, assertionsForSkeleton);
@ -328,7 +327,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
new Object[] { "skeleton2.html/__WINDOW_MAIN__/bad_guy", new String[] { "skeleton2.html/__WINDOW_MAIN__/dollar" } },
};
@Test public void testSkeleton2() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testSkeleton2() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/skeleton2.html");
CallGraph CG = JSCallGraphBuilderUtil.makeHTMLCG(url);
System.err.println(CG);
@ -336,7 +335,7 @@ public abstract class TestSimplePageCallGraphShape extends TestJSCallGraphShape
}
/*
@Test public void testJQuery() throws IOException, IllegalArgumentException, CancelException, WalaException {
@Test public void testJQuery() throws IllegalArgumentException, CancelException, WalaException {
URL url = getClass().getClassLoader().getResource("pages/jquery.html");
CallGraph CG = Util.makeHTMLCG(url);
}

View File

@ -102,7 +102,7 @@ org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

View File

@ -93,7 +93,7 @@ public class OptimisticCallgraphBuilder extends FieldBasedCallGraphBuilder {
}
// add flow corresponding to a new call edge
private static void addEdge(FlowGraph flowgraph, CallVertex c, FuncVertex callee, IProgressMonitor monitor) throws CancelException {
private static void addEdge(FlowGraph flowgraph, CallVertex c, FuncVertex callee, IProgressMonitor monitor) {
VertexFactory factory = flowgraph.getVertexFactory();
JavaScriptInvoke invk = c.getInstruction();
FuncVertex caller = c.getCaller();

View File

@ -133,7 +133,7 @@ public class WorklistBasedOptimisticCallgraphBuilder extends FieldBasedCallGraph
}
// add flow corresponding to a new call edge
private void addCallEdge(FlowGraph flowgraph, CallVertex c, FuncVertex callee, Set<Vertex> worklist) throws CancelException {
private void addCallEdge(FlowGraph flowgraph, CallVertex c, FuncVertex callee, Set<Vertex> worklist) {
VertexFactory factory = flowgraph.getVertexFactory();
FuncVertex caller = c.getCaller();
JavaScriptInvoke invk = c.getInstruction();
@ -161,7 +161,7 @@ public class WorklistBasedOptimisticCallgraphBuilder extends FieldBasedCallGraph
// add data flow corresponding to a reflective invocation via Function.prototype.call
// NB: for f.call(...), f will _not_ appear as a call target, but the appropriate argument and return data flow will be set up
private void addReflectiveCallEdge(FlowGraph flowgraph, VarVertex reflectiveCallee, JavaScriptInvoke invk, FuncVertex realCallee, Set<Vertex> worklist) throws CancelException {
private void addReflectiveCallEdge(FlowGraph flowgraph, VarVertex reflectiveCallee, JavaScriptInvoke invk, FuncVertex realCallee, Set<Vertex> worklist) {
VertexFactory factory = flowgraph.getVertexFactory();
FuncVertex caller = reflectiveCallee.getFunction();

View File

@ -10,7 +10,6 @@
*****************************************************************************/
package com.ibm.wala.cast.js.client;
import java.io.IOException;
import java.util.Collections;
import java.util.Set;
import java.util.jar.JarFile;
@ -59,15 +58,11 @@ public abstract class JavaScriptAnalysisEngine<I extends InstanceKey> extends Ab
@Override
public void buildAnalysisScope() {
try {
loaderFactory = new JavaScriptLoaderFactory(translatorFactory);
loaderFactory = new JavaScriptLoaderFactory(translatorFactory);
SourceModule[] files = moduleFiles.toArray(new SourceModule[moduleFiles.size()]);
SourceModule[] files = moduleFiles.toArray(new SourceModule[moduleFiles.size()]);
scope = new CAstAnalysisScope(files, loaderFactory, Collections.singleton(JavaScriptLoader.JS));
} catch (IOException e) {
Assertions.UNREACHABLE(e.toString());
}
scope = new CAstAnalysisScope(files, loaderFactory, Collections.singleton(JavaScriptLoader.JS));
}
@Override

View File

@ -283,7 +283,7 @@ public class DomLessSourceExtractor extends JSSourceExtractor {
}
}
protected String getScriptName(URL url) throws MalformedURLException {
protected String getScriptName(URL url) {
String file = url.getFile();
int lastIdxOfSlash = file.lastIndexOf('/');
file = (lastIdxOfSlash == (-1)) ? file : file.substring(lastIdxOfSlash + 1);

View File

@ -120,7 +120,7 @@ public class JSCallGraphUtil extends com.ibm.wala.cast.ipa.callgraph.CAstCallGra
return makeLoaders(null);
}
public static IClassHierarchy makeHierarchyForScripts(String... scriptFiles) throws IOException, ClassHierarchyException {
public static IClassHierarchy makeHierarchyForScripts(String... scriptFiles) throws ClassHierarchyException {
JavaScriptLoaderFactory loaders = makeLoaders();
AnalysisScope scope = CAstCallGraphUtil.makeScope(scriptFiles, loaders, JavaScriptLoader.JS);
return makeHierarchy(scope, loaders);

View File

@ -12,7 +12,6 @@
package com.ibm.wala.cast.js.ipa.callgraph.correlations;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
@ -240,7 +239,7 @@ public class CorrelationFinder {
}
@SuppressWarnings("unused")
private void printCorrelatedAccesses(URL url) throws IOException, ClassHierarchyException {
private void printCorrelatedAccesses(URL url) throws ClassHierarchyException {
printCorrelatedAccesses(findCorrelatedAccesses(url));
}
@ -261,7 +260,7 @@ public class CorrelationFinder {
System.out.println((i++) + " -- " + p.fst + ": " + p.snd);
}
public Map<IMethod, CorrelationSummary> findCorrelatedAccesses(URL url) throws IOException, ClassHierarchyException {
public Map<IMethod, CorrelationSummary> findCorrelatedAccesses(URL url) throws ClassHierarchyException {
Set<? extends SourceModule> scripts = null;
if(url.getPath().endsWith(".js")) {
scripts = Collections.singleton(new SourceURLModule(url));
@ -278,13 +277,11 @@ public class CorrelationFinder {
return summaries;
}
public Map<IMethod, CorrelationSummary> findCorrelatedAccesses(Collection<? extends SourceModule> scripts) throws IOException,
ClassHierarchyException {
public Map<IMethod, CorrelationSummary> findCorrelatedAccesses(Collection<? extends SourceModule> scripts) throws ClassHierarchyException {
return findCorrelatedAccesses(scripts.toArray(new SourceModule[scripts.size()]));
}
public Map<IMethod, CorrelationSummary> findCorrelatedAccesses(SourceModule[] scripts_array) throws IOException,
ClassHierarchyException {
public Map<IMethod, CorrelationSummary> findCorrelatedAccesses(SourceModule[] scripts_array) throws ClassHierarchyException {
JSCallGraphUtil.setTranslatorFactory(translatorFactory);
JavaScriptLoaderFactory loaders = JSCallGraphUtil.makeLoaders(null);
CAstAnalysisScope scope = new CAstAnalysisScope(scripts_array, loaders, Collections.singleton(JavaScriptLoader.JS));

View File

@ -11,7 +11,6 @@
package com.ibm.wala.cast.js.ipa.callgraph.correlations.extraction;
import java.io.IOException;
import java.net.URL;
import java.util.Map;
@ -29,11 +28,11 @@ import com.ibm.wala.ipa.cha.ClassHierarchyException;
public class CorrelatedPairExtractorFactory implements CAstRewriterFactory<NodePos, NoKey> {
private final Map<IMethod, CorrelationSummary> summaries;
public CorrelatedPairExtractorFactory(JavaScriptTranslatorFactory translatorFactory, URL entryPoint) throws ClassHierarchyException, IOException {
public CorrelatedPairExtractorFactory(JavaScriptTranslatorFactory translatorFactory, URL entryPoint) throws ClassHierarchyException {
this(new CorrelationFinder(translatorFactory).findCorrelatedAccesses(entryPoint));
}
public CorrelatedPairExtractorFactory(JavaScriptTranslatorFactory translatorFactory, SourceModule[] scripts) throws ClassHierarchyException, IOException {
public CorrelatedPairExtractorFactory(JavaScriptTranslatorFactory translatorFactory, SourceModule[] scripts) throws ClassHierarchyException {
this(new CorrelationFinder(translatorFactory).findCorrelatedAccesses(scripts));
}

View File

@ -103,7 +103,7 @@ org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

View File

@ -10,7 +10,6 @@
package com.ibm.wala.cast.ipa.callgraph;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
@ -31,8 +30,7 @@ public class CAstAnalysisScope extends AnalysisScope {
this.theLoader = loaders.getTheReference();
}
public CAstAnalysisScope(String[] sourceFileNames, SingleClassLoaderFactory loaders, Collection<Language> languages)
throws IOException {
public CAstAnalysisScope(String[] sourceFileNames, SingleClassLoaderFactory loaders, Collection<Language> languages) {
this(loaders, languages);
for (int i = 0; i < sourceFileNames.length; i++) {
File F = new File(sourceFileNames[i]);
@ -40,8 +38,7 @@ public class CAstAnalysisScope extends AnalysisScope {
}
}
public CAstAnalysisScope(Module[] sources, SingleClassLoaderFactory loaders, Collection<Language> languages)
throws IOException {
public CAstAnalysisScope(Module[] sources, SingleClassLoaderFactory loaders, Collection<Language> languages) {
this(loaders, languages);
for (int i = 0; i < sources.length; i++) {
addToScope(theLoader, sources[i]);

View File

@ -80,13 +80,12 @@ public class CAstCallGraphUtil {
};
}
public static AnalysisScope makeScope(String[] files, SingleClassLoaderFactory loaders, Language language) throws IOException {
public static AnalysisScope makeScope(String[] files, SingleClassLoaderFactory loaders, Language language) {
CAstAnalysisScope result = new CAstAnalysisScope(files, loaders, Collections.singleton(language));
return result;
}
public static AnalysisScope makeScope(Module[] files, SingleClassLoaderFactory loaders, Language language)
throws IOException {
public static AnalysisScope makeScope(Module[] files, SingleClassLoaderFactory loaders, Language language) {
CAstAnalysisScope result = new CAstAnalysisScope(files, loaders, Collections.singleton(language));
return result;
}

View File

@ -47,7 +47,7 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
@ -61,7 +61,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=error
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
@ -103,7 +103,7 @@ org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
@ -111,14 +111,14 @@ org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=error
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false

View File

@ -19,6 +19,7 @@ import sun.java2d.FontSupport;
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
@SuppressWarnings("restriction")
public class Main {
public static void main(String[] args) {

View File

@ -17,6 +17,7 @@ import java.io.InputStream;
public class TryFinally {
@SuppressWarnings("resource")
public void test1(InputStream i1, InputStream i2) throws IOException {
BufferedInputStream in = new BufferedInputStream(i1);
try {

View File

@ -18,6 +18,7 @@ import sun.java2d.FontSupport;
* When analyzed with J2EEClassHierarchy exclusions, the superinterface
* FontSupport should not be found because we exclude sun.java2d.*
*/
@SuppressWarnings("restriction")
public interface YuckyInterface extends FontSupport {

View File

@ -69,7 +69,6 @@ public class NList implements Collection {
* @see java.util.Collection#iterator()
*/
@Override
@SuppressWarnings("rawtypes")
public Iterator iterator() {
// TODO Auto-generated method stub
return null;

View File

@ -17,6 +17,7 @@ import java.lang.reflect.InvocationTargetException;
* Test of Class.getConstructors().
*/
public class Reflect15 {
@SuppressWarnings("null")
public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException,
IllegalAccessException, InvocationTargetException {
Class<?> c = Class.forName("reflection.Helper");

View File

@ -102,7 +102,7 @@ org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

View File

@ -144,7 +144,7 @@ public class ArrayboundsAnalysisTest {
}
@AfterClass
public static void free() throws IOException, ClassHierarchyException {
public static void free() {
scope = null;
cha = null;
irFactory = null;

View File

@ -130,7 +130,7 @@ public class PruneArrayOutOfBoundExceptionEdge {
}
@Test
public void detectable() throws ClassNotFoundException {
public void detectable() {
IClass iClass = getIClass(DETECTABLE_TESTDATA);
checkRemovedEdges(iClass, DETECTABLE_EXPECTED_COUNT);
}
@ -235,7 +235,7 @@ public class PruneArrayOutOfBoundExceptionEdge {
}
@AfterClass
public static void free() throws IOException, ClassHierarchyException {
public static void free() {
scope = null;
cha = null;
irFactory = null;

View File

@ -13,7 +13,6 @@ package com.ibm.wala.core.tests.callGraph;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.jar.JarFile;
import org.junit.Test;
@ -42,13 +41,13 @@ import com.ibm.wala.util.io.TemporaryFile;
public class Java7CallGraphTest extends DynamicCallGraphTestBase {
@Test public void testOcamlHelloHash() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException, ClassNotFoundException, InvalidClassFileException, FailureException, SecurityException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InterruptedException {
@Test public void testOcamlHelloHash() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException, ClassNotFoundException, InvalidClassFileException, FailureException, SecurityException, InterruptedException {
if (!"True".equals(System.getenv("APPVEYOR"))) {
testOCamlJar("hello_hash.jar");
}
}
private void testOCamlJar(String jarFile, String... args) throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException, ClassNotFoundException, InvalidClassFileException, FailureException, SecurityException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InterruptedException {
private void testOCamlJar(String jarFile, String... args) throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException, ClassNotFoundException, InvalidClassFileException, FailureException, SecurityException, InterruptedException {
File F = TemporaryFile.urlToFile(jarFile.replace('.', '_') + ".jar", getClass().getClassLoader().getResource(jarFile));
F.deleteOnExit();

View File

@ -89,8 +89,7 @@ public class AnnotationTest extends WalaTestCase {
}
private void testClassAnnotations(TypeReference typeUnderTest, Collection<Annotation> expectedRuntimeInvisibleAnnotations,
Collection<Annotation> expectedRuntimeVisibleAnnotations) throws IOException, ClassHierarchyException,
InvalidClassFileException {
Collection<Annotation> expectedRuntimeVisibleAnnotations) throws InvalidClassFileException {
IClass classUnderTest = cha.lookupClass(typeUnderTest);
harness.assertNotNull(typeUnderTest.toString() + " not found", classUnderTest);
harness.assertTrue(classUnderTest + " must be BytecodeClass", classUnderTest instanceof BytecodeClass);

View File

@ -252,8 +252,7 @@ public class TypeAnnotationTest extends WalaTestCase {
}
private void testClassAnnotations(TypeReference typeUnderTest, Collection<TypeAnnotation> expectedRuntimeInvisibleAnnotations,
Collection<TypeAnnotation> expectedRuntimeVisibleAnnotations) throws IOException, ClassHierarchyException,
InvalidClassFileException {
Collection<TypeAnnotation> expectedRuntimeVisibleAnnotations) throws InvalidClassFileException {
IClass classUnderTest = cha.lookupClass(typeUnderTest);
harness.assertNotNull(typeUnderTest.toString() + " not found", classUnderTest);
harness.assertTrue(classUnderTest + " must be BytecodeClass", classUnderTest instanceof ShrikeClass);
@ -267,8 +266,7 @@ public class TypeAnnotationTest extends WalaTestCase {
}
private void testMethodAnnotations(MethodReference methodRefUnderTest, Collection<TypeAnnotation> expectedRuntimeInvisibleAnnotations,
Collection<TypeAnnotation> expectedRuntimeVisibleAnnotations) throws IOException, ClassHierarchyException,
InvalidClassFileException {
Collection<TypeAnnotation> expectedRuntimeVisibleAnnotations) throws InvalidClassFileException {
IMethod methodUnderTest = cha.resolveMethod(methodRefUnderTest);
harness.assertNotNull(methodRefUnderTest.toString() + " not found", methodUnderTest);
harness.assertTrue(methodUnderTest + " must be ShrikeCTMethod", methodUnderTest instanceof ShrikeCTMethod);
@ -286,8 +284,7 @@ public class TypeAnnotationTest extends WalaTestCase {
}
private void testFieldAnnotations(String fieldNameStr, TypeReference typeUnderTest, Collection<TypeAnnotation> expectedAnnotations) throws IOException, ClassHierarchyException,
InvalidClassFileException {
private void testFieldAnnotations(String fieldNameStr, TypeReference typeUnderTest, Collection<TypeAnnotation> expectedAnnotations) {
IClass classUnderTest = cha.lookupClass(typeUnderTest);
harness.assertNotNull(typeUnderTest.toString() + " not found", classUnderTest);
harness.assertTrue(classUnderTest + " must be BytecodeClass", classUnderTest instanceof ShrikeClass);

View File

@ -12,7 +12,6 @@
package com.ibm.wala.core.tests.shrike;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import org.junit.Test;
@ -51,7 +50,7 @@ public class DynamicCallGraphTest extends DynamicCallGraphTestBase {
}
@Test
public void testGraph() throws IOException, ClassNotFoundException, InvalidClassFileException, FailureException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassHierarchyException, CancelException, InterruptedException {
public void testGraph() throws IOException, ClassNotFoundException, InvalidClassFileException, FailureException, SecurityException, IllegalArgumentException, ClassHierarchyException, CancelException, InterruptedException {
instrument(testJarLocation);
run("dynamicCG.MainClass", null);
CallGraph staticCG = staticCG("LdynamicCG/MainClass", null);
@ -59,7 +58,7 @@ public class DynamicCallGraphTest extends DynamicCallGraphTestBase {
}
@Test
public void testCallbacks() throws IOException, ClassNotFoundException, InvalidClassFileException, FailureException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassHierarchyException, CancelException, InterruptedException {
public void testCallbacks() throws IOException, ClassNotFoundException, InvalidClassFileException, FailureException, SecurityException, IllegalArgumentException, ClassHierarchyException, CancelException, InterruptedException {
instrument(testJarLocation);
run("dynamicCG.CallbacksMainClass", null);
CallGraph staticCG = staticCG("LdynamicCG/CallbacksMainClass", null);
@ -67,7 +66,7 @@ public class DynamicCallGraphTest extends DynamicCallGraphTestBase {
}
@Test
public void testExclusions() throws IOException, ClassNotFoundException, InvalidClassFileException, FailureException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassHierarchyException, CancelException, InterruptedException {
public void testExclusions() throws IOException, ClassNotFoundException, InvalidClassFileException, FailureException, SecurityException, IllegalArgumentException, ClassHierarchyException, CancelException, InterruptedException {
instrument(testJarLocation);
run("dynamicCG.MainClass", "ShrikeTestExclusions.txt");
CallGraph staticCG = staticCG("LdynamicCG/MainClass", "ShrikeTestExclusions.txt");

View File

@ -16,7 +16,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -99,7 +98,7 @@ public abstract class DynamicCallGraphTestBase extends WalaTestCase {
}
}
protected void run(String mainClass, String exclusionsFile, String... args) throws IOException, ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, InterruptedException {
protected void run(String mainClass, String exclusionsFile, String... args) throws IOException, SecurityException, IllegalArgumentException, InterruptedException {
Project p = new Project();
p.setBaseDir(new File(System.getProperty("java.io.tmpdir")));
p.init();

View File

@ -835,7 +835,7 @@ public class SlicerTest {
}
@Test
public void testJustThrow() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException, UnsoundGraphException {
public void testJustThrow() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
AnalysisScope scope = findOrCreateAnalysisScope();
IClassHierarchy cha = findOrCreateCHA(scope);

View File

@ -35,7 +35,6 @@ import com.ibm.wala.ipa.callgraph.propagation.HeapModel;
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
import com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis;
import com.ibm.wala.ipa.callgraph.propagation.PointerKey;
import com.ibm.wala.ipa.cha.ClassHierarchyException;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.properties.WalaProperties;
import com.ibm.wala.types.TypeReference;
@ -161,7 +160,7 @@ public class SimpleThreadEscapeAnalysis extends AbstractAnalysisEngine<InstanceK
* @throws CancelException
* @throws IllegalArgumentException
*/
public Set<IClass> gatherThreadEscapingClasses() throws IOException, ClassHierarchyException, IllegalArgumentException,
public Set<IClass> gatherThreadEscapingClasses() throws IOException, IllegalArgumentException,
CancelException {
//
@ -327,7 +326,7 @@ public class SimpleThreadEscapeAnalysis extends AbstractAnalysisEngine<InstanceK
* @throws CancelException
* @throws IllegalArgumentException
*/
public static void main(String[] args) throws IOException, ClassHierarchyException, IllegalArgumentException, CancelException {
public static void main(String[] args) throws IOException, IllegalArgumentException, CancelException {
String mainClassName = args[0];
Set<JarFile> jars = HashSetFactory.make();

View File

@ -53,7 +53,7 @@ public class PDFCallGraph {
return (new File(appJar).isDirectory());
}
public static String findJarFiles(String[] directories) throws WalaException {
public static String findJarFiles(String[] directories) {
Collection<String> result = HashSetFactory.make();
for (int i = 0; i < directories.length; i++) {
for (Iterator<File> it = FileUtil.listFiles(directories[i], ".*\\.jar", true).iterator(); it.hasNext();) {
@ -86,7 +86,7 @@ public class PDFCallGraph {
* @throws CancelException
* @throws IllegalArgumentException
*/
public static void main(String[] args) throws WalaException, IllegalArgumentException, CancelException {
public static void main(String[] args) throws IllegalArgumentException, CancelException {
run(args);
}
@ -97,7 +97,7 @@ public class PDFCallGraph {
* @throws CancelException
* @throws IllegalArgumentException
*/
public static Process run(String[] args) throws WalaException, IllegalArgumentException, CancelException {
public static Process run(String[] args) throws IllegalArgumentException, CancelException {
Properties p = CommandLine.parse(args);
validateCommandLine(p);
return run(p.getProperty("appJar"), p.getProperty("exclusionFile", CallGraphTestUtil.REGRESSION_EXCLUSIONS));
@ -167,7 +167,7 @@ public class PDFCallGraph {
return g;
}
public static Graph<CGNode> pruneForAppLoader(CallGraph g) throws WalaException {
public static Graph<CGNode> pruneForAppLoader(CallGraph g) {
return PDFTypeHierarchy.pruneGraph(g, new ApplicationLoaderFilter());
}

View File

@ -100,7 +100,7 @@ public class PDFSlice {
* -dir argument tells whether to compute a forwards or backwards slice. </ul>
*
*/
public static void main(String[] args) throws WalaException, IllegalArgumentException, CancelException, IOException {
public static void main(String[] args) throws IllegalArgumentException, CancelException, IOException {
run(args);
}
@ -111,7 +111,7 @@ public class PDFSlice {
* @throws IllegalArgumentException
* @throws IOException
*/
public static Process run(String[] args) throws WalaException, IllegalArgumentException, CancelException, IOException {
public static Process run(String[] args) throws IllegalArgumentException, CancelException, IOException {
// parse the command-line into a Properties object
Properties p = CommandLine.parse(args);
// validate that the command-line has the expected format

View File

@ -94,7 +94,7 @@ public class PDFTypeHierarchy {
}
}
public static <T> Graph<T> pruneGraph(Graph<T> g, Predicate<T> f) throws WalaException {
public static <T> Graph<T> pruneGraph(Graph<T> g, Predicate<T> f) {
Collection<T> slice = GraphSlicer.slice(g, f);
return GraphSlicer.prune(g, new CollectionFilter<>(slice));
}
@ -102,7 +102,7 @@ public class PDFTypeHierarchy {
/**
* Restrict g to nodes from the Application loader
*/
public static Graph<IClass> pruneForAppLoader(Graph<IClass> g) throws WalaException {
public static Graph<IClass> pruneForAppLoader(Graph<IClass> g) {
Predicate<IClass> f = new Predicate<IClass>() {
@Override public boolean test(IClass c) {
return (c.getClassLoader().getReference().equals(ClassLoaderReference.Application));
@ -130,7 +130,7 @@ public class PDFTypeHierarchy {
/**
* Return a view of an {@link IClassHierarchy} as a {@link Graph}, with edges from classes to immediate subtypes
*/
public static Graph<IClass> typeHierarchy2Graph(IClassHierarchy cha) throws WalaException {
public static Graph<IClass> typeHierarchy2Graph(IClassHierarchy cha) {
Graph<IClass> result = SlowSparseNumberedGraph.make();
for (IClass c : cha) {
result.addNode(c);

View File

@ -112,12 +112,12 @@ org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=error
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore

View File

@ -641,7 +641,7 @@ public abstract class ShrikeBTMethod implements IMethod, BytecodeConstants {
instructionIndex = i;
}
public int getProgramCounter() throws InvalidClassFileException {
public int getProgramCounter() {
return info.pcMap[instructionIndex];
}
@ -654,12 +654,7 @@ public abstract class ShrikeBTMethod implements IMethod, BytecodeConstants {
public void visitNew(NewInstruction instruction) {
ClassLoaderReference loader = getReference().getDeclaringClass().getClassLoader();
TypeReference t = ShrikeUtil.makeTypeReference(loader, instruction.getType());
try {
newSites.add(NewSiteReference.make(getProgramCounter(), t));
} catch (InvalidClassFileException e) {
e.printStackTrace();
Assertions.UNREACHABLE();
}
newSites.add(NewSiteReference.make(getProgramCounter(), t));
}
@Override
@ -684,12 +679,7 @@ public abstract class ShrikeBTMethod implements IMethod, BytecodeConstants {
MethodReference m = MethodReference.findOrCreate(loader.getLanguage(), loader.getReference(), instruction.getClassType(),
instruction.getMethodName(), instruction.getMethodSignature());
int programCounter = 0;
try {
programCounter = getProgramCounter();
} catch (InvalidClassFileException e) {
e.printStackTrace();
Assertions.UNREACHABLE();
}
programCounter = getProgramCounter();
CallSiteReference site = null;
site = CallSiteReference.make(programCounter, m, instruction.getInvocationCode());
callSites.add(site);

View File

@ -272,7 +272,7 @@ public class CHACallGraph extends BasicCallGraph<CHAContextInterpreter> {
|| cha.getScope().isApplicationLoader(target.getDeclaringClass().getClassLoader()));
}
private CGNode makeNewNode(IMethod method, Context C) throws CancelException {
private CGNode makeNewNode(IMethod method, Context C) {
CGNode n;
Key k = new Key(method, C);
n = new CHANode(method, C);

View File

@ -507,8 +507,7 @@ public class PropagationSystem extends DefaultFixedPointSolver<PointsToSetVariab
return iArrayRef;
}
private void registerArrayInstanceWithAllSuperclassesOfElement(int index, IClass elementClass, int dim)
throws ClassHierarchyException {
private void registerArrayInstanceWithAllSuperclassesOfElement(int index, IClass elementClass, int dim) {
IClass T;
// register the array with each supertype of the element class
T = elementClass.getSuperclass();

View File

@ -760,13 +760,7 @@ public class ClassHierarchy implements IClassHierarchy {
assert n != null : "null n for " + b;
}
Set<IClass> superB;
try {
superB = getSuperclasses(b);
} catch (ClassHierarchyException e1) {
e1.printStackTrace();
Assertions.UNREACHABLE();
superB = null;
}
superB = getSuperclasses(b);
IClass aa = a;
while (aa != null) {
if (b.equals(aa) || superB.contains(aa)) {
@ -775,19 +769,13 @@ public class ClassHierarchy implements IClassHierarchy {
aa = aa.getSuperclass();
}
Set<IClass> superA;
try {
superA = getSuperclasses(a);
} catch (ClassHierarchyException e1) {
e1.printStackTrace();
Assertions.UNREACHABLE();
superA = null;
}
superA = getSuperclasses(a);
Assertions.UNREACHABLE("getLeastCommonSuperclass " + tempA + " " + b + ": " + superA + ", " + superB);
return null;
}
}
private static Set<IClass> getSuperclasses(IClass c) throws ClassHierarchyException {
private static Set<IClass> getSuperclasses(IClass c) {
HashSet<IClass> result = HashSetFactory.make(3);
while (c.getSuperclass() != null) {
result.add(c.getSuperclass());

View File

@ -54,14 +54,14 @@ public class FileProvider {
return getJarFileFromClassLoader(fileName, loader);
}
public URL getResource(String fileName) throws IOException {
public URL getResource(String fileName) {
if (fileName == null) {
throw new IllegalArgumentException("null fileName");
}
return getResource(fileName, FileProvider.class.getClassLoader());
}
public URL getResource(String fileName, ClassLoader loader) throws IOException {
public URL getResource(String fileName, ClassLoader loader) {
if (fileName == null) {
throw new IllegalArgumentException("null fileName");
}

Some files were not shown because too many files have changed in this diff Show More