Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest WALA, fix update site URL #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ SAFE static analysis tools

## Eclipse Update Site

https://raw.githubusercontent.com/ponder-lab/safe/master/com.ibm.safe.updatesite
https://raw.githubusercontent.com/tech-srl/safe/master/com.ibm.safe.updatesite
2 changes: 2 additions & 0 deletions com.ibm.safe.core.tests/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.ibm.wala.util"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.ibm.wala.core"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 0 additions & 1 deletion com.ibm.safe.core.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Bundle-SymbolicName: com.ibm.safe.core.tests
Bundle-Version: 1.0.0.qualifier
Export-Package: com.ibm.safe.core.tests
Require-Bundle: com.ibm.safe.core;bundle-version="1.0.0",
com.ibm.wala.core;bundle-version="1.1.3",
org.eclipse.core.runtime;bundle-version="3.6.0",
com.ibm.safe;bundle-version="1.0.0",
org.junit;bundle-version="3.8.2"
3 changes: 3 additions & 0 deletions com.ibm.safe.core/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.ibm.wala.core"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.ibm.wala.shrike"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.ibm.wala.util"/>
<classpathentry kind="output" path="bin"/>
</classpath>
4 changes: 1 addition & 3 deletions com.ibm.safe.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ Export-Package: com.ibm.safe,
com.ibm.safe.runners,
com.ibm.safe.solvers,
com.ibm.safe.utils
Require-Bundle: com.ibm.wala.core;bundle-version="1.1.3",
com.ibm.wala.shrike;bundle-version="1.3.1",
org.eclipse.core.runtime;bundle-version="3.6.0",
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.6.0",
org.eclipse.core.resources;bundle-version="3.6.1",
com.ibm.wala.ide;bundle-version="1.1.3",
org.eclipse.jdt.core;bundle-version="3.8.3",
Expand Down
12 changes: 10 additions & 2 deletions com.ibm.safe.core/src/com/ibm/safe/ICFGSupergraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
import com.ibm.wala.ssa.SSAAbstractInvokeInstruction;
import com.ibm.wala.ssa.SSAInstruction;
import com.ibm.wala.ssa.analysis.IExplodedBasicBlock;
import com.ibm.wala.util.Predicate;
import java.util.function.Predicate;
import java.util.stream.Stream;

import com.ibm.wala.util.collections.EmptyIterator;
import com.ibm.wala.util.collections.FilterIterator;
import com.ibm.wala.util.collections.HashMapFactory;
Expand Down Expand Up @@ -66,7 +68,7 @@ public static ICFGSupergraph make(CallGraph cg, AnalysisCache cache) {
return w;
}

public Graph<? extends CGNode> getProcedureGraph() {
public Graph<CGNode> getProcedureGraph() {
return icfg.getCallGraph();
}

Expand Down Expand Up @@ -292,4 +294,10 @@ public String toString() {
return icfg.toString();
}

@Override
public Stream<BasicBlockInContext<IExplodedBasicBlock>> stream() {
// TODO Auto-generated method stub
Assertions.UNREACHABLE();
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public AllMainEntryPoints(final AnalysisScope analysisScope, final IClassHierarc

for (IClass clazz : classHierarchy) {
if (!clazz.isInterface() && !clazz.isAbstract() && isApplicationClass(analysisScope, clazz)) {
for (Iterator<IMethod> methodIter = clazz.getDeclaredMethods().iterator(); methodIter.hasNext();) {
for (Iterator<? extends IMethod> methodIter = clazz.getDeclaredMethods().iterator(); methodIter.hasNext();) {
final IMethod method = methodIter.next();
if (isMainMethod(method.getReference(), mainMethod, mainDescriptor)) {
addPotentiallyMainClass(classHierarchy, mainClassesSelector, clazz, method);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.ibm.wala.classLoader.CallSiteReference;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.classLoader.Language;
import com.ibm.wala.ipa.callgraph.AnalysisCache;
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
import com.ibm.wala.ipa.callgraph.CGNode;
Expand All @@ -50,7 +51,7 @@ public class CHABasedCallGraph extends ExplicitCallGraph {

public CHABasedCallGraph(IClassHierarchy cha, AnalysisOptions options,
IAnalysisCacheView cache) {
super(cha, options, cache);
super(Language.JAVA.getFakeRootMethod(cha, options, cache), options, cache);
setInterpreter(new ContextInsensitiveSSAInterpreter(options, cache));

// Create nodes for methods in classes found by CHA.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.ibm.safe.perf.PerformanceTracker.Stages;
import com.ibm.safe.utils.Trace;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.Language;
import com.ibm.wala.client.AbstractAnalysisEngine;
import com.ibm.wala.ide.util.ProgressMonitorDelegate;
import com.ibm.wala.ipa.callgraph.AnalysisCache;
Expand Down Expand Up @@ -143,7 +144,7 @@ public CallGraphBuilder getCallGraphBuilder(IClassHierarchy cha, AnalysisOptions
Trace.println("Using RTA Builder");
break;
case ZERO_CFA:
builder = Util.makeZeroCFABuilder(options, cache, cha, getScope());
builder = Util.makeZeroCFABuilder(Language.JAVA, options, cache, cha, getScope());
Trace.println("Using 0-CFA Builder");
break;
case ZERO_ONE_CFA:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*******************************************************************************/
package com.ibm.safe.callgraph;

import com.ibm.wala.classLoader.Language;
import com.ibm.wala.ipa.callgraph.AnalysisCache;
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
import com.ibm.wala.ipa.callgraph.ContextSelector;
Expand Down Expand Up @@ -39,7 +40,7 @@ public class CustomCICFABuilder extends ZeroXCFABuilder {
*/
public CustomCICFABuilder(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache, ContextSelector appContextSelector,
SSAContextInterpreter appContextInterpreter) {
super(cha, options, cache, appContextSelector, appContextInterpreter, ZeroXInstanceKeys.ALLOCATIONS
super(Language.JAVA, cha, options, cache, appContextSelector, appContextInterpreter, ZeroXInstanceKeys.ALLOCATIONS
| ZeroXInstanceKeys.SMUSH_MANY | ZeroXInstanceKeys.SMUSH_PRIMITIVE_HOLDERS | ZeroXInstanceKeys.SMUSH_STRINGS
| ZeroXInstanceKeys.SMUSH_THROWABLES);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public SelectiveEntryPoints(final AnalysisScope analysisScope, final IClassHiera
for (int i = 0; i < entryPointDefs.length; i++) {
if (clazz.getName().toString().equals(entryPointDefs[i].getClassName()) && !clazz.isInterface()
&& isApplicationClass(analysisScope, clazz)) {
for (Iterator<IMethod> methodIter = clazz.getDeclaredMethods().iterator(); methodIter.hasNext();) {
for (Iterator<? extends IMethod> methodIter = clazz.getDeclaredMethods().iterator(); methodIter.hasNext();) {
final IMethod method = methodIter.next();
if (!method.isAbstract() &&
isSameMethod(method.getReference(), entryPointDefs[i].getMethodName(), entryPointDefs[i].getMethodDescriptor())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
*******************************************************************************/
package com.ibm.safe.internal.filtering;

import com.ibm.wala.util.Predicate;
import java.util.function.Predicate;

public final class AlwaysTrueClassFilter<T> extends Predicate<T> {
public final class AlwaysTrueClassFilter<T> implements Predicate<T> {

// --- Interface methods implementation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import java.util.LinkedList;
import java.util.List;

import com.ibm.wala.util.Predicate;
import java.util.function.Predicate;

public final class AndFilter<T> extends Predicate<T> {
public final class AndFilter<T> implements Predicate<T> {

public AndFilter() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import java.util.LinkedList;
import java.util.List;

import com.ibm.wala.util.Predicate;
import java.util.function.Predicate;

public final class OrFilter<T> extends Predicate<T> {
public final class OrFilter<T> implements Predicate<T> {

public OrFilter() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
package com.ibm.safe.internal.filtering;

import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.util.Predicate;
import java.util.function.Predicate;

public final class QualifiedNameFilter<T> extends Predicate<T> {
public final class QualifiedNameFilter<T> implements Predicate<T> {

public QualifiedNameFilter(final String theQualifiedClassName) {
this.qualifiedClassName = 'L' + theQualifiedClassName.replace('.', '/');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import java.util.regex.Pattern;

import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.util.Predicate;
import java.util.function.Predicate;

public final class RegularExpressionFilter<T> extends Predicate<T> {
public final class RegularExpressionFilter<T> implements Predicate<T> {

public RegularExpressionFilter(final String regularExpression) {
this.pattern = Pattern.compile(regularExpression);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.collections.MapIterator;
import com.ibm.wala.util.collections.Pair;
import com.ibm.wala.util.functions.Function;
import java.util.function.Function;

/**
* This maintains a counter for each non-negative integer this is implemented as
Expand Down
1 change: 0 additions & 1 deletion com.ibm.safe.lightweight.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Bundle-Vendor: IBM
Bundle-Localization: plugin
Require-Bundle:
com.ibm.safe.core,
com.ibm.wala.core,
org.eclipse.ui,
org.eclipse.core.runtime,
org.junit,
Expand Down
3 changes: 3 additions & 0 deletions com.ibm.safe.lightweight/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.ibm.wala.shrike"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.ibm.wala.util"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.ibm.wala.core"/>
<classpathentry kind="output" path="bin"/>
</classpath>
4 changes: 1 addition & 3 deletions com.ibm.safe.lightweight/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ Export-Package: com.ibm.safe.intraproc,
com.ibm.safe.structural.xml,
com.ibm.safe.lightweight.controller,
com.ibm.safe.lightweight.options
Require-Bundle: com.ibm.wala.core,
com.ibm.safe.core,
com.ibm.wala.shrike;bundle-version="1.1.3",
Require-Bundle: com.ibm.safe.core,
org.eclipse.core.runtime;bundle-version="3.5.0"
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import com.ibm.wala.ssa.NullTestPiPolicy;
import com.ibm.wala.ssa.SSAPiNodePolicy;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.util.Predicate;
import java.util.function.Predicate;
import com.ibm.wala.util.WalaException;
import com.ibm.wala.util.collections.HashSetFactory;
import com.ibm.wala.util.graph.Graph;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Stream;

import com.ibm.safe.utils.Trace;
import com.ibm.wala.cfg.ControlFlowGraph;
Expand Down Expand Up @@ -1332,4 +1333,10 @@ public IntSet getPredNodeNumbers(ISSABasicBlock node) {
return null;
}

public Stream<ISSABasicBlock> stream() {
// TODO Auto-generated method stub
Assertions.UNREACHABLE();
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.util.CancelException;
import com.ibm.wala.util.Predicate;
import java.util.function.Predicate;

public final class StructuralSolverRunner extends AbstractSolverRunner {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import com.ibm.safe.rules.StructuralRule;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.util.Predicate;
import java.util.function.Predicate;

/**
* Base for all options related to structural analysis.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.ibm.safe.rules.IRule;
import com.ibm.safe.rules.StructuralRule;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.util.Predicate;
import java.util.function.Predicate;

public final class StructuralOptions implements IStructuralOptions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.ibm.safe.secure.accessibility.AccessibilityAnalyzer;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.util.Predicate;
import java.util.function.Predicate;

public class AccessControlProgramProcessor implements ProgramProcessor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void process(IClass klass) throws CancelException {
processor.setup(klass, classHierarchy);
}

for (Iterator<IMethod> methodIterator = klass.getDeclaredMethods().iterator(); methodIterator.hasNext();) {
for (Iterator<? extends IMethod> methodIterator = klass.getDeclaredMethods().iterator(); methodIterator.hasNext();) {
IMethod method = methodIterator.next();

if (!J2SEClassHierarchyEngine.isApplicationClass(method.getDeclaringClass())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.ibm.wala.ipa.callgraph.CallGraph;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.util.CancelException;
import com.ibm.wala.util.Predicate;
import java.util.function.Predicate;

/**
* @author Eran Yahav (yahave)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.FieldReference;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.util.Predicate;
import java.util.function.Predicate;

/**
* Given the set of classes of Application class loader's name space, the
Expand Down Expand Up @@ -381,7 +381,7 @@ private Set<StructuralMessage> computeMemberViolations(Map<AccessibilityTarget,
break;
}
}
Iterator<IMethod> methods = klass.getDeclaredMethods().iterator();
Iterator<? extends IMethod> methods = klass.getDeclaredMethods().iterator();
while (methods.hasNext()) {
IMethod method = (IMethod) methods.next();
AccessibilityTarget target = AccessibilityTarget.getAccessibilityTarget(method);
Expand Down Expand Up @@ -431,7 +431,7 @@ private Map<AccessibilityTarget, ArrayList<Accessor>> computeAccessibility(final
AccessibilityTarget target = AccessibilityTarget.getAccessibilityTarget(field);
targetsToAccessors.put(target, new ArrayList<Accessor>(3));
}
Iterator<IMethod> methodsIter = klass.getAllMethods().iterator();
Iterator<? extends IMethod> methodsIter = klass.getAllMethods().iterator();
while (methodsIter.hasNext()) {
IMethod method = methodsIter.next();
if (method.isAbstract() || !method.getDeclaringClass().getClassLoader().equals(appLoader)
Expand All @@ -450,7 +450,7 @@ private Map<AccessibilityTarget, ArrayList<Accessor>> computeAccessibility(final
if (!J2SEClassHierarchyEngine.isApplicationClass(klass)) {
continue;
}
Iterator<IMethod> methodsIter = klass.getDeclaredMethods().iterator();
Iterator<? extends IMethod> methodsIter = klass.getDeclaredMethods().iterator();
while (methodsIter.hasNext()) {
IMethod method = methodsIter.next();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.util.CancelException;
import com.ibm.wala.util.Predicate;
import java.util.function.Predicate;

/**
* @author Eran Yahav (yahave)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void process(IClass klass) {
}
programStats.incrementEntry(ProgramStatistics.NUM_CLASSES);

for (Iterator<IMethod> it = klass.getDeclaredMethods().iterator(); it.hasNext();) {
for (Iterator<? extends IMethod> it = klass.getDeclaredMethods().iterator(); it.hasNext();) {
IMethod method = (IMethod) it.next();
if (method instanceof ShrikeCTMethod) {
ShrikeCTMethod shrikeMethod = (ShrikeCTMethod) method;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public void addFieldDefinitions(IClass klass, Document doc, Element fieldsRoot)
public void addMethodDefinitions(IClass klass, Document doc, Element methodsRoot) {

try {
for (Iterator<IMethod> methodIterator = klass.getDeclaredMethods().iterator(); methodIterator.hasNext();) {
for (Iterator<? extends IMethod> methodIterator = klass.getDeclaredMethods().iterator(); methodIterator.hasNext();) {
IMethod method = methodIterator.next();
Element methodElement = addMethod(klass, method, doc);
methodsRoot.appendChild(methodElement);
Expand Down
1 change: 0 additions & 1 deletion com.ibm.safe.typestate.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Bundle-Version: 1.0.0
Bundle-Vendor: IBM
Bundle-Localization: plugin
Require-Bundle: com.ibm.safe.core,
com.ibm.wala.core,
org.eclipse.ui,
org.eclipse.core.runtime,
org.junit,
Expand Down
3 changes: 3 additions & 0 deletions com.ibm.safe.typestate/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.ibm.wala.shrike"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.ibm.wala.util"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.ibm.wala.core"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Loading