This commit is contained in:
Julian Dolby 2017-07-13 13:02:29 -04:00
commit 004a81deba
154 changed files with 422 additions and 909 deletions

View File

@ -77,7 +77,7 @@ org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariable
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=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

View File

@ -55,7 +55,7 @@ public class ArraysAndSuch {
os1.clone();
if ( os1.equals(os2) ) {
Class x = os1.getClass();
Class<? extends Object[]> x = os1.getClass();
os1.notify();
os1.toString();
try {

View File

@ -77,7 +77,7 @@ org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariable
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
org.eclipse.jdt.core.compiler.problem.potentialNullReference=error
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=error
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error

View File

@ -378,8 +378,8 @@ public abstract class IRTests {
Set<IMethod> unreachable = HashSetFactory.make();
IClassHierarchy cha = cg.getClassHierarchy();
IClassLoader sourceLoader = cha.getLoader(JavaSourceAnalysisScope.SOURCE);
for (Iterator iter = sourceLoader.iterateAllClasses(); iter.hasNext();) {
IClass clazz = (IClass) iter.next();
for (Iterator<IClass> iter = sourceLoader.iterateAllClasses(); iter.hasNext();) {
IClass clazz = iter.next();
System.err.println(clazz);
if (clazz.isInterface())
@ -389,7 +389,7 @@ public abstract class IRTests {
if (m.isAbstract()) {
System.err.println(m);
} else {
Iterator nodeIter = cg.getNodes(m.getReference()).iterator();
Iterator<CGNode> nodeIter = cg.getNodes(m.getReference()).iterator();
if (!nodeIter.hasNext()) {
if (m instanceof AstMethod) {
String fn = ((AstClass)m.getDeclaringClass()).getSourcePosition().getURL().getFile();
@ -400,7 +400,7 @@ public abstract class IRTests {
}
continue;
}
CGNode node = (CGNode) nodeIter.next();
CGNode node = nodeIter.next();
System.err.println(node.getIR());
}
}
@ -450,7 +450,7 @@ public abstract class IRTests {
return null;
}
public static void populateScope(JavaSourceAnalysisEngine engine, Collection<String> sources, List<String> libs) {
public static void populateScope(JavaSourceAnalysisEngine<?> engine, Collection<String> sources, List<String> libs) {
boolean foundLib = false;
for (String lib : libs) {
File libFile = new File(lib);

View File

@ -158,7 +158,7 @@ public class SynchronizedBlockDuplicator extends
}
@Override
protected CAstNode flowOutTo(Map nodeMap, CAstNode oldSource, Object label, CAstNode oldTarget, CAstControlFlowMap orig,
protected CAstNode flowOutTo(Map<Pair<CAstNode, UnwindKey>, CAstNode> nodeMap, CAstNode oldSource, Object label, CAstNode oldTarget, CAstControlFlowMap orig,
CAstSourcePositionMap src) {
assert oldTarget == CAstControlFlowMap.EXCEPTION_TO_EXIT;
return oldTarget;

View File

@ -182,7 +182,7 @@ public class AstJavaSSAPropagationCallGraphBuilder extends AstSSAPropagationCall
system.newSideEffect(new UnaryOperator<PointsToSetVariable>() {
@Override
public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) {
IntSetVariable tv = rhs;
IntSetVariable<?> tv = rhs;
if (tv.getValue() != null) {
tv.getValue().foreach(new IntSetAction() {
@Override

View File

@ -12,7 +12,6 @@ package com.ibm.wala.cast.java.ipa.callgraph;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import com.ibm.wala.cast.ipa.callgraph.ScopeMappingInstanceKeys;
@ -42,8 +41,7 @@ public class JavaScopeMappingInstanceKeys extends ScopeMappingInstanceKeys {
if (isPossiblyLexicalClass(cls)) {
Set<LexicalParent> result = HashSetFactory.make();
for (Iterator MS = cls.getAllMethods().iterator(); MS.hasNext();) {
IMethod m = (IMethod) MS.next();
for (IMethod m : cls.getAllMethods()) {
if ((m instanceof AstMethod) && !m.isStatic()) {
AstMethod M = (AstMethod) m;
LexicalParent[] parents = M.getParents();

View File

@ -100,11 +100,11 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
public class JavaClass extends AstClass {
protected final IClass enclosingClass;
protected final Collection superTypeNames;
protected final Collection<TypeName> superTypeNames;
private final Collection<Annotation> annotations;
public JavaClass(String typeName, Collection superTypeNames, CAstSourcePositionMap.Position position, Collection qualifiers,
public JavaClass(String typeName, Collection<TypeName> superTypeNames, CAstSourcePositionMap.Position position, Collection<CAstQualifier> qualifiers,
JavaSourceLoaderImpl loader, IClass enclosingClass, Collection<Annotation> annotations) {
super(position, TypeName.string2TypeName(typeName), loader, (short) mapToInt(qualifiers), new HashMap<Atom, IField>(), new HashMap<Selector, IMethod>());
this.superTypeNames = superTypeNames;
@ -125,8 +125,8 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
@Override
public IClass getSuperclass() {
boolean excludedSupertype=false;
for (Iterator iter = superTypeNames.iterator(); iter.hasNext();) {
TypeName name = (TypeName) iter.next();
for (Iterator<TypeName> iter = superTypeNames.iterator(); iter.hasNext();) {
TypeName name = iter.next();
IClass domoType = lookupClass(name);
if (domoType != null && !domoType.isInterface()) {
return domoType;
@ -156,8 +156,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
@Override
public Collection<IClass> getDirectInterfaces() {
List<IClass> result = new ArrayList<>();
for (Iterator iter = superTypeNames.iterator(); iter.hasNext();) {
TypeName name = (TypeName) iter.next();
for (TypeName name : superTypeNames) {
IClass domoType = lookupClass(name);
if (domoType != null && domoType.isInterface()) {
result.add(domoType);
@ -170,7 +169,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
return result;
}
private void addMethod(CAstEntity methodEntity, IClass owner, AbstractCFG cfg, SymbolTable symtab, boolean hasCatchBlock,
private void addMethod(CAstEntity methodEntity, IClass owner, AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock,
Map<IBasicBlock<SSAInstruction>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo, DebuggingInformation debugInfo) {
declaredMethods.put(Util.methodEntityToSelector(methodEntity), new ConcreteJavaMethod(methodEntity, owner, cfg, symtab,
hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo, debugInfo));
@ -251,7 +250,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
private final TypeReference[] exceptionTypes;
public JavaEntityMethod(CAstEntity methodEntity, IClass owner, AbstractCFG cfg, SymbolTable symtab, boolean hasCatchBlock,
public JavaEntityMethod(CAstEntity methodEntity, IClass owner, AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock,
Map<IBasicBlock<SSAInstruction>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo, DebuggingInformation debugInfo) {
super(owner, methodEntity.getQualifiers(), cfg, symtab, MethodReference.findOrCreate(owner.getReference(), Util
.methodEntityToSelector(methodEntity)), hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo, debugInfo, JavaSourceLoaderImpl.this.getAnnotations(methodEntity));
@ -310,13 +309,13 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
private TypeReference[] computeExceptionTypes(CAstEntity methodEntity) {
CAstType.Function fType = (Function) methodEntity.getType();
Collection exceptionTypes = fType.getExceptionTypes();
Collection<CAstType> exceptionTypes = fType.getExceptionTypes();
TypeReference[] result = new TypeReference[exceptionTypes.size()];
int i = 0;
for (Iterator iter = exceptionTypes.iterator(); iter.hasNext(); i++) {
CAstType type = (CAstType) iter.next();
for (CAstType type : exceptionTypes) {
result[i] = TypeReference.findOrCreate(JavaSourceLoaderImpl.this.getReference(), type.getName());
++i;
}
return result;
@ -369,7 +368,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
* @author rfuhrer
*/
public class ConcreteJavaMethod extends JavaEntityMethod {
public ConcreteJavaMethod(CAstEntity methodEntity, IClass owner, AbstractCFG cfg, SymbolTable symtab, boolean hasCatchBlock,
public ConcreteJavaMethod(CAstEntity methodEntity, IClass owner, AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock,
Map<IBasicBlock<SSAInstruction>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo, DebuggingInformation debugInfo) {
super(methodEntity, owner, cfg, symtab, hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo, debugInfo);
}
@ -451,11 +450,9 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
}
}
public static int mapToInt(Collection/* <CAstQualifier> */qualifiers) {
public static int mapToInt(Collection<CAstQualifier> qualifiers) {
int result = 0;
for (Iterator iter = qualifiers.iterator(); iter.hasNext();) {
CAstQualifier q = (CAstQualifier) iter.next();
for (CAstQualifier q : qualifiers) {
if (q == CAstQualifier.PUBLIC)
result |= ClassConstants.ACC_PUBLIC;
if (q == CAstQualifier.PROTECTED)
@ -522,7 +519,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
/** END Custom change: Optional deletion of fTypeMap */
}
public void defineFunction(CAstEntity n, IClass owner, AbstractCFG cfg, SymbolTable symtab, boolean hasCatchBlock,
public void defineFunction(CAstEntity n, IClass owner, AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock,
Map<IBasicBlock<SSAInstruction>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo, DebuggingInformation debugInfo) {
((JavaClass) owner).addMethod(n, owner, cfg, symtab, hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo, debugInfo);
}
@ -541,8 +538,8 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
public IClass defineType(CAstEntity type, String typeName, CAstEntity owner) {
Collection<TypeName> superTypeNames = new ArrayList<>();
for (Iterator superTypes = type.getType().getSupertypes().iterator(); superTypes.hasNext();) {
superTypeNames.add(toWALATypeName(((CAstType) superTypes.next())));
for (CAstType superType : type.getType().getSupertypes()) {
superTypeNames.add(toWALATypeName(superType));
}
JavaClass javaClass = new JavaClass(typeName, superTypeNames, type.getPosition(), type.getQualifiers(), this,

View File

@ -11,8 +11,6 @@
package com.ibm.wala.cast.java.loader;
import java.util.Iterator;
import com.ibm.wala.cast.tree.CAstEntity;
import com.ibm.wala.cast.tree.CAstType;
import com.ibm.wala.types.Descriptor;
@ -34,11 +32,9 @@ public class Util {
new TypeName[signature.getArgumentCount()];
int i= 0;
for(Iterator iter= signature.getArgumentTypes().iterator();
iter.hasNext(); i++)
{
CAstType argType= (CAstType) iter.next();
for (CAstType argType : signature.getArgumentTypes()) {
argTypeNames[i]= TypeName.string2TypeName(argType.getName());
++i;
}
Descriptor desc= Descriptor.findOrCreate(argTypeNames, retTypeName);

View File

@ -29,7 +29,7 @@ public class Java2IRTranslator {
protected final JavaSourceLoaderImpl fLoader;
CAstRewriterFactory castRewriterFactory = null;
CAstRewriterFactory<?, ?> castRewriterFactory = null;
public Java2IRTranslator(JavaSourceLoaderImpl srcLoader) {
this(srcLoader, false);
@ -40,12 +40,12 @@ public class Java2IRTranslator {
}
public Java2IRTranslator(JavaSourceLoaderImpl srcLoader,
CAstRewriterFactory castRewriterFactory) {
CAstRewriterFactory<?, ?> castRewriterFactory) {
this(srcLoader, castRewriterFactory, false);
}
public Java2IRTranslator(JavaSourceLoaderImpl srcLoader,
CAstRewriterFactory castRewriterFactory, boolean debug) {
CAstRewriterFactory<?, ?> castRewriterFactory, boolean debug) {
DEBUG = debug;
fLoader = srcLoader;
this.castRewriterFactory = castRewriterFactory;
@ -60,7 +60,7 @@ public class Java2IRTranslator {
if (castRewriterFactory != null) {
CAst cast = new CAstImpl();
CAstRewriter rw = castRewriterFactory.createCAstRewriter(cast);
CAstRewriter<?, ?> rw = castRewriterFactory.createCAstRewriter(cast);
ce = rw.rewrite(ce);
if (DEBUG) {
PrintWriter printWriter = new PrintWriter(System.out);

View File

@ -15,7 +15,6 @@ package com.ibm.wala.cast.java.translator;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import com.ibm.wala.cast.ir.translator.AstTranslator;
@ -171,10 +170,9 @@ public class JavaCAst2IRTranslator extends AstTranslator {
context.cfg().addPreNode(n, context.getUnwindState());
context.cfg().newBlock(true);
Collection labels = context.getControlFlow().getTargetLabels(n);
Collection<Object> labels = context.getControlFlow().getTargetLabels(n);
for (Iterator iter = labels.iterator(); iter.hasNext();) {
Object label = iter.next();
for (Object label : labels) {
CAstNode target = context.getControlFlow().getTarget(n, label);
if (target == CAstControlFlowMap.EXCEPTION_TO_EXIT)
context.cfg().addPreEdgeToExit(n, true);

View File

@ -64,7 +64,7 @@ public class NodejsCallGraphBuilderUtil extends JSCallGraphUtil {
Language language = JavaScriptLoader.JS;
Collection<Language> languages = Collections.singleton(language);
IRFactory<IMethod> irFactory = new AstIRFactory.AstDefaultIRFactory();
IRFactory<IMethod> irFactory = new AstIRFactory.AstDefaultIRFactory<>();
IAnalysisCacheView cache = new AnalysisCacheImpl(irFactory);
JavaScriptLoaderFactory loaders = new JavaScriptLoaderFactory(translatorFactory, null);

View File

@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariable
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=error
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=error
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error

View File

@ -95,7 +95,7 @@ public class JSCallGraphBuilderUtil extends com.ibm.wala.cast.js.ipa.callgraph.J
*/
public static JSCFABuilder makeScriptCGBuilder(String dir, String name, CGBuilderType builderType, ClassLoader loader) throws IOException, WalaException {
URL script = getURLforFile(dir, name, loader);
CAstRewriterFactory preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, script) : null;
CAstRewriterFactory<?, ?> preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, script) : null;
JavaScriptLoaderFactory loaders = JSCallGraphUtil.makeLoaders(preprocessor);
AnalysisScope scope = makeScriptScope(dir, name, loaders, loader);
@ -162,7 +162,7 @@ public class JSCallGraphBuilderUtil extends com.ibm.wala.cast.js.ipa.callgraph.J
public static CallGraph makeScriptCG(SourceModule[] scripts, CGBuilderType builderType, IRFactory<IMethod> irFactory) throws IOException, IllegalArgumentException,
CancelException, WalaException {
CAstRewriterFactory preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, scripts) : null;
CAstRewriterFactory<?, ?> preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, scripts) : null;
PropagationCallGraphBuilder b = makeCGBuilder(makeLoaders(preprocessor), scripts, builderType, irFactory);
CallGraph CG = b.makeCallGraph(b.getOptions());
// dumpCG(b.getPointerAnalysis(), CG);
@ -175,7 +175,7 @@ public class JSCallGraphBuilderUtil extends com.ibm.wala.cast.js.ipa.callgraph.J
public static JSCFABuilder makeHTMLCGBuilder(URL url, CGBuilderType builderType, Function<Void, JSSourceExtractor> fExtractor) throws IOException, WalaException {
IRFactory<IMethod> irFactory = AstIRFactory.makeDefaultFactory();
CAstRewriterFactory preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, url) : null;
CAstRewriterFactory<?, ?> preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, url) : null;
JavaScriptLoaderFactory loaders = new WebPageLoaderFactory(translatorFactory, preprocessor);
SourceModule[] scriptsArray = makeHtmlScope(url, loaders, fExtractor);

View File

@ -23,6 +23,7 @@ import com.ibm.wala.classLoader.CallSiteReference;
import com.ibm.wala.core.tests.slicer.SlicerTest;
import com.ibm.wala.ipa.callgraph.CGNode;
import com.ibm.wala.ipa.callgraph.CallGraph;
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
import com.ibm.wala.ipa.slicer.NormalStatement;
import com.ibm.wala.ipa.slicer.SDG;
import com.ibm.wala.ipa.slicer.Slicer;
@ -75,7 +76,7 @@ public abstract class TestJavaScriptSlicer extends TestJSCallGraphShape {
JSCFABuilder B = JSCallGraphBuilderUtil.makeScriptCGBuilder("tests", file);
CallGraph CG = B.makeCallGraph(B.getOptions());
SDG sdg = new SDG<>(CG, B.getPointerAnalysis(), new JavaScriptModRef<>(), data, ctrl);
SDG<InstanceKey> sdg = new SDG<>(CG, B.getPointerAnalysis(), new JavaScriptModRef<>(), data, ctrl);
final Collection<Statement> ss = findTargetStatement(CG);
Collection<Statement> result = Slicer.computeBackwardSlice(sdg, ss);

View File

@ -16,6 +16,7 @@ import com.ibm.wala.cast.js.ipa.callgraph.JSZeroOrOneXCFABuilder;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.callgraph.CallGraphBuilder;
import com.ibm.wala.ipa.callgraph.IAnalysisCacheView;
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
import com.ibm.wala.ipa.callgraph.propagation.cfa.ZeroXInstanceKeys;
import com.ibm.wala.ipa.cha.IClassHierarchy;
@ -26,7 +27,7 @@ import com.ibm.wala.ipa.cha.IClassHierarchy;
*/
public class OneCFABuilderFactory {
public CallGraphBuilder make(JSAnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, AnalysisScope scope,
public CallGraphBuilder<InstanceKey> make(JSAnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, AnalysisScope scope,
boolean keepPointsTo) {
com.ibm.wala.ipa.callgraph.impl.Util.addDefaultSelectors(options, cha);
options.setSelector(new StandardFunctionTargetSelector(cha, options.getMethodTargetSelector()));

View File

@ -34,7 +34,7 @@ public class WebPageLoaderFactory extends JavaScriptLoaderFactory {
super(factory);
}
public WebPageLoaderFactory(JavaScriptTranslatorFactory factory, CAstRewriterFactory preprocessor) {
public WebPageLoaderFactory(JavaScriptTranslatorFactory factory, CAstRewriterFactory<?, ?> preprocessor) {
super(factory, preprocessor);
}

View File

@ -156,7 +156,7 @@ public class ArgumentSpecialization {
}
public static class ArgumentCountIRFactory extends AstIRFactory.AstDefaultIRFactory {
public static class ArgumentCountIRFactory extends AstIRFactory.AstDefaultIRFactory<IMethod> {
private static final CAstPattern directAccessPattern = CAstPattern.parse("|(ARRAY_REF(VAR(\"arguments\"),<value>*)||OBJECT_REF(VAR(\"arguments\"),<value>*))|");
private static final CAstPattern destructuredAccessPattern = CAstPattern.parse("BLOCK_EXPR(ASSIGN(VAR(/[$][$]destructure[$]rcvr[0-9]+/),VAR(\"arguments\")),ASSIGN(VAR(<name>/[$][$]destructure[$]elt[0-9]+/),<value>*))");

View File

@ -87,7 +87,7 @@ public abstract class JSCFABuilder extends JSSSAPropagationCallGraphBuilder {
}
@Override
protected PointerKey getInstanceFieldPointerKeyForConstant(InstanceKey I, ConstantKey F) {
protected PointerKey getInstanceFieldPointerKeyForConstant(InstanceKey I, ConstantKey<?> F) {
Object v = F.getValue();
String strVal = JSCallGraphUtil.simulateToStringForPropertyNames(v);
// if we know the string representation of the constant, use it...

View File

@ -109,7 +109,7 @@ public class JSCallGraphUtil extends com.ibm.wala.cast.ipa.callgraph.CAstCallGra
* @param preprocessor CAst rewriter to use for preprocessing JavaScript source files; may be null
* @return
*/
public static JavaScriptLoaderFactory makeLoaders(CAstRewriterFactory preprocessor) {
public static JavaScriptLoaderFactory makeLoaders(CAstRewriterFactory<?, ?> preprocessor) {
if (translatorFactory == null) {
throw new IllegalStateException("com.ibm.wala.cast.js.ipa.callgraph.Util.setTranslatorFactory() must be invoked before makeLoaders()");
}

View File

@ -242,7 +242,7 @@ public class JSSSAPropagationCallGraphBuilder extends AstSSAPropagationCallGraph
}
@Override
protected void addAssignmentsForCatchPointerKey(PointerKey exceptionVar, Set catchClasses, PointerKey e) {
protected void addAssignmentsForCatchPointerKey(PointerKey exceptionVar, Set<IClass> catchClasses, PointerKey e) {
system.newConstraint(exceptionVar, assignOperator, e);
}
@ -373,7 +373,7 @@ public class JSSSAPropagationCallGraphBuilder extends AstSSAPropagationCallGraph
InstanceKey globalObj = ((AstSSAPropagationCallGraphBuilder) jsAnalysis.builder).getGlobalObject(JavaScriptTypes.jsName);
PointerKey fkey = analysis.getHeapModel().getPointerKeyForInstanceField(globalObj, f);
if (fkey != null) {
OrdinalSet pointees = analysis.getPointsToSet(fkey);
OrdinalSet<InstanceKey> pointees = analysis.getPointsToSet(fkey);
IntSet set = pointees.getBackingSet();
if (set != null) {
S.addAll(set);
@ -819,8 +819,8 @@ public class JSSSAPropagationCallGraphBuilder extends AstSSAPropagationCallGraph
} catch (CancelException e) {
throw new CancelRuntimeException(e);
}
String v1 = (String) ((ConstantKey) iks1[i]).getValue();
String v2 = (String) ((ConstantKey) iks2[j]).getValue();
String v1 = (String) ((ConstantKey<?>) iks1[i]).getValue();
String v2 = (String) ((ConstantKey<?>) iks2[j]).getValue();
if (v1.indexOf(v2) == -1 && v2.indexOf(v1) == -1) {
InstanceKey lvalKey = getInstanceKeyForConstant(v1 + v2);
if (addKey(lvalKey)) {

View File

@ -59,7 +59,7 @@ public class LoadFileTargetSelector implements MethodTargetSelector {
OrdinalSet<InstanceKey> ptrs = builder.getPointerAnalysis().getPointsToSet(fileNameV);
for(InstanceKey k : ptrs) {
if (k instanceof ConstantKey) {
Object v = ((ConstantKey)k).getValue();
Object v = ((ConstantKey<?>)k).getValue();
if (v instanceof String) {
names.add((String)v);
}

View File

@ -145,7 +145,7 @@ public class JavaScriptLoader extends CAstAbstractModuleLoader {
if (o == null) {
return JavaScriptTypes.Null;
} else {
Class c = o.getClass();
Class<?> c = o.getClass();
if (c == Boolean.class) {
return JavaScriptTypes.Boolean;
} else if (c == String.class) {
@ -676,13 +676,13 @@ public class JavaScriptLoader extends CAstAbstractModuleLoader {
private final JavaScriptTranslatorFactory translatorFactory;
private final CAstRewriterFactory preprocessor;
private final CAstRewriterFactory<?, ?> preprocessor;
public JavaScriptLoader(IClassHierarchy cha, JavaScriptTranslatorFactory translatorFactory) {
this(cha, translatorFactory, null);
}
public JavaScriptLoader(IClassHierarchy cha, JavaScriptTranslatorFactory translatorFactory, CAstRewriterFactory preprocessor) {
public JavaScriptLoader(IClassHierarchy cha, JavaScriptTranslatorFactory translatorFactory, CAstRewriterFactory<?, ?> preprocessor) {
super(cha);
this.translatorFactory = translatorFactory;
this.preprocessor = preprocessor;
@ -800,7 +800,7 @@ public class JavaScriptLoader extends CAstAbstractModuleLoader {
private WalkContext translationContext;
private CAstEntity entity;
JavaScriptMethodObject(IClass cls, AbstractCFG cfg, SymbolTable symtab, boolean hasCatchBlock,
JavaScriptMethodObject(IClass cls, AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock,
Map<IBasicBlock<SSAInstruction>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo, DebuggingInformation debugInfo) {
super(cls, functionQualifiers, cfg, symtab, AstMethodReference.fnReference(cls.getReference()), hasCatchBlock, caughtTypes,
hasMonitorOp, lexicalInfo, debugInfo, null);
@ -914,14 +914,14 @@ public class JavaScriptLoader extends CAstAbstractModuleLoader {
return makeCodeBodyType(name, JavaScriptTypes.Script, pos, entity, context);
}
public IMethod defineCodeBodyCode(String clsName, AbstractCFG cfg, SymbolTable symtab, boolean hasCatchBlock,
public IMethod defineCodeBodyCode(String clsName, AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock,
Map<IBasicBlock<SSAInstruction>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo, DebuggingInformation debugInfo) {
JavaScriptCodeBody C = (JavaScriptCodeBody) lookupClass(clsName, cha);
assert C != null : clsName;
return C.setCodeBody(makeCodeBodyCode(cfg, symtab, hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo, debugInfo, C));
}
public JavaScriptMethodObject makeCodeBodyCode(AbstractCFG cfg, SymbolTable symtab, boolean hasCatchBlock,
public JavaScriptMethodObject makeCodeBodyCode(AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock,
Map<IBasicBlock<SSAInstruction>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo, DebuggingInformation debugInfo,
IClass C) {
return new JavaScriptMethodObject(C, cfg, symtab, hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo,

View File

@ -23,13 +23,13 @@ import com.ibm.wala.types.ClassLoaderReference;
*/
public class JavaScriptLoaderFactory extends SingleClassLoaderFactory {
protected final JavaScriptTranslatorFactory translatorFactory;
protected final CAstRewriterFactory preprocessor;
protected final CAstRewriterFactory<?, ?> preprocessor;
public JavaScriptLoaderFactory(JavaScriptTranslatorFactory factory) {
this(factory, null);
}
public JavaScriptLoaderFactory(JavaScriptTranslatorFactory factory, CAstRewriterFactory preprocessor) {
public JavaScriptLoaderFactory(JavaScriptTranslatorFactory factory, CAstRewriterFactory<?, ?> preprocessor) {
this.translatorFactory = factory;
this.preprocessor = preprocessor;
}

View File

@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariable
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
org.eclipse.jdt.core.compiler.problem.potentialNullReference=error
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=error
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=error
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error

View File

@ -1,5 +1 @@
<<<<<<< HEAD
CAST_TEST_BIN = /Users/dolby/git/WALA/com.ibm.wala.cast.test/target/classes/
=======
CAST_TEST_BIN = /home/vagrant/WALA/com.ibm.wala.cast.test/target/classes/
>>>>>>> 0bbe9970c6c519c192926db909b562b2b9f4b53f

View File

@ -12,7 +12,6 @@ package com.ibm.wala.cast.test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@ -33,24 +32,26 @@ public class TestCAstPattern extends WalaTestCase {
private static final int NAME_ASSERTION_MULTI = 502;
private static class TestingCAstImpl extends CAstImpl {
private final Map testNameMap = new HashMap();
private final Map<String, Object> testNameMap = new HashMap<>();
@Override
@SuppressWarnings("unchecked")
public CAstNode makeNode(int kind, CAstNode children[]) {
if (kind == NAME_ASSERTION_SINGLE || kind == NAME_ASSERTION_MULTI) {
assert children.length == 2;
assert children[0].getValue() instanceof String;
final Object child0Value = children[0].getValue();
assert child0Value instanceof String;
final String name = (String) child0Value;
@SuppressWarnings("unused")
CAstNode result = children[1];
if (kind == NAME_ASSERTION_SINGLE) {
testNameMap.put(children[0].getValue(), children[1]);
testNameMap.put(name, children[1]);
} else {
if (!testNameMap.containsKey(children[0].getValue())) {
testNameMap.put(children[0].getValue(), new ArrayList());
if (!testNameMap.containsKey(name)) {
testNameMap.put(name, new ArrayList<>());
}
((List) testNameMap.get(children[0].getValue())).add(children[1]);
((List<CAstNode>) testNameMap.get(children[0].getValue())).add(children[1]);
}
return children[1];
} else {
@ -60,7 +61,7 @@ public class TestCAstPattern extends WalaTestCase {
}
private static void test(CAstPattern p, CAstNode n, Map names) {
private static void test(CAstPattern p, CAstNode n, Map<String, Object> names) {
System.err.println(("testing pattern " + p));
System.err.println(("testing with input " + CAstPrinter.print(n)));
@ -69,16 +70,15 @@ public class TestCAstPattern extends WalaTestCase {
} else {
Segments s = CAstPattern.match(p, n);
Assert.assertTrue(s != null);
for (Iterator ns = names.keySet().iterator(); ns.hasNext();) {
String nm = (String) ns.next();
for (String nm : names.keySet()) {
Object o = names.get(nm);
if (o instanceof CAstNode) {
System.err.println(("found " + CAstPrinter.print(s.getSingle(nm)) + " for " + nm));
Assert.assertTrue("for name " + nm + ": expected " + names.get(nm) + " but got " + s.getSingle(nm), names.get(nm).equals(
s.getSingle(nm)));
} else {
for (Iterator cs = s.getMultiple(nm).iterator(); cs.hasNext();) {
System.err.println(("found " + CAstPrinter.print((CAstNode) cs.next()) + " for " + nm));
for (CAstNode node : s.getMultiple(nm)) {
System.err.println(("found " + CAstPrinter.print(node) + " for " + nm));
}
Assert.assertTrue("for name " + nm + ": expected " + names.get(nm) + " but got " + s.getMultiple(nm), names.get(nm)
.equals(s.getMultiple(nm)));
@ -91,7 +91,7 @@ public class TestCAstPattern extends WalaTestCase {
private final CAstNode simpleNameAst;
private final Map simpleNameMap;
private final Map<String, Object> simpleNameMap;
{
TestingCAstImpl Ast = new TestingCAstImpl();
@ -111,7 +111,7 @@ public class TestCAstPattern extends WalaTestCase {
private final CAstNode simpleStarNameAst;
private final Map simpleStarNameMap;
private final Map<String, Object> simpleStarNameMap;
{
TestingCAstImpl Ast = new TestingCAstImpl();
@ -131,7 +131,7 @@ public class TestCAstPattern extends WalaTestCase {
private final CAstNode simpleRepeatedAstOne;
private final Map simpleRepeatedMapOne;
private final Map<String, Object> simpleRepeatedMapOne;
{
TestingCAstImpl Ast = new TestingCAstImpl();
@ -149,7 +149,7 @@ public class TestCAstPattern extends WalaTestCase {
private final CAstNode simpleRepeatedAstTwo;
private final Map simpleRepeatedMapTwo;
private final Map<String, Object> simpleRepeatedMapTwo;
{
TestingCAstImpl Ast = new TestingCAstImpl();
@ -168,7 +168,7 @@ public class TestCAstPattern extends WalaTestCase {
private final CAstNode simpleRepeatedAstThree;
private final Map simpleRepeatedMapThree;
private final Map<String, Object> simpleRepeatedMapThree;
{
TestingCAstImpl Ast = new TestingCAstImpl();
@ -190,7 +190,7 @@ public class TestCAstPattern extends WalaTestCase {
private final CAstNode simpleDoubleStarAst;
private final Map simpleDoubleStarMap;
private final Map<String, Object> simpleDoubleStarMap;
{
TestingCAstImpl Ast = new TestingCAstImpl();
@ -212,7 +212,7 @@ public class TestCAstPattern extends WalaTestCase {
private final CAstNode simpleAlternativeAst;
private final Map simpleAlternativeMap;
private final Map<String, Object> simpleAlternativeMap;
{
TestingCAstImpl Ast = new TestingCAstImpl();
@ -233,7 +233,7 @@ public class TestCAstPattern extends WalaTestCase {
private final CAstNode simpleOptionalAstWith;
private final Map simpleOptionalMapWith;
private final Map<String, Object> simpleOptionalMapWith;
{
TestingCAstImpl Ast = new TestingCAstImpl();
@ -251,7 +251,7 @@ public class TestCAstPattern extends WalaTestCase {
private final CAstNode simpleOptionalAstNot;
private final Map simpleOptionalMapNot;
private final Map<String, Object> simpleOptionalMapNot;
{
TestingCAstImpl Ast = new TestingCAstImpl();
@ -273,7 +273,7 @@ public class TestCAstPattern extends WalaTestCase {
private final CAstNode recursiveTreeOneAst;
private final Map recursiveTreeOneMap;
private final Map<String, Object> recursiveTreeOneMap;
{
TestingCAstImpl Ast = new TestingCAstImpl();
@ -291,7 +291,7 @@ public class TestCAstPattern extends WalaTestCase {
private final CAstNode recursiveTreeTwoAst;
private final Map recursiveTreeTwoMap;
private final Map<String, Object> recursiveTreeTwoMap;
{
TestingCAstImpl Ast = new TestingCAstImpl();
@ -311,7 +311,7 @@ public class TestCAstPattern extends WalaTestCase {
private final CAstNode recursiveTreeFiveAst;
private final Map recursiveTreeFiveMap;
private final Map<String, Object> recursiveTreeFiveMap;
{
TestingCAstImpl Ast = new TestingCAstImpl();
@ -367,7 +367,7 @@ public class TestCAstPattern extends WalaTestCase {
private final CAstNode testedTreeOneAst;
private final Map testedTreeOneMap;
private final Map<String, Object> testedTreeOneMap;
{
TestingCAstImpl Ast = new TestingCAstImpl();

View File

@ -100,14 +100,14 @@ public abstract class TestCAstTranslator extends WalaTestCase {
}
}
Pair[] instanceMethods = (Pair[]) entry[4];
Pair<Object, Object>[] instanceMethods = (Pair[]) entry[4];
if (instanceMethods != null) {
for (int i = 0; i < instanceMethods.length; i++) {
this.instanceMethods.put(Pair.make(clsName, instanceMethods[i].fst), instanceMethods[i].snd);
}
}
Pair[] staticMethods = (Pair[]) entry[5];
Pair<Object, Object>[] staticMethods = (Pair[]) entry[5];
if (staticMethods != null) {
for (int i = 0; i < staticMethods.length; i++) {
this.staticMethods.put(Pair.make(clsName, staticMethods[i].fst), staticMethods[i].snd);

View File

@ -101,9 +101,9 @@ public abstract class TestCallGraphShape extends WalaTestCase {
protected void verifyNameAssertions(CallGraph CG, Object[][] assertionData) {
for (int i = 0; i < assertionData.length; i++) {
Iterator NS = getNodes(CG, (String) assertionData[i][0]).iterator();
Iterator<CGNode> NS = getNodes(CG, (String) assertionData[i][0]).iterator();
while (NS.hasNext()) {
CGNode N = (CGNode) NS.next();
CGNode N = NS.next();
IR ir = N.getIR();
Name[] names = (Name[]) assertionData[i][1];
for (int j = 0; j < names.length; j++) {
@ -135,7 +135,7 @@ public abstract class TestCallGraphShape extends WalaTestCase {
for (int i = 0; i < assertionData.length; i++) {
check_target: for (int j = 0; j < ((String[]) assertionData[i][1]).length; j++) {
Iterator srcs = (assertionData[i][0] instanceof String) ? getNodes(CG, (String) assertionData[i][0]).iterator()
Iterator<CGNode> srcs = (assertionData[i][0] instanceof String) ? getNodes(CG, (String) assertionData[i][0]).iterator()
: new NonNullSingletonIterator<>(CG.getFakeRootNode());
Assert.assertTrue("cannot find " + assertionData[i][0], srcs.hasNext());
@ -148,18 +148,18 @@ public abstract class TestCallGraphShape extends WalaTestCase {
}
while (srcs.hasNext()) {
CGNode src = (CGNode) srcs.next();
for (Iterator sites = src.iterateCallSites(); sites.hasNext();) {
CallSiteReference sr = (CallSiteReference) sites.next();
CGNode src = srcs.next();
for (Iterator<CallSiteReference> sites = src.iterateCallSites(); sites.hasNext();) {
CallSiteReference sr = sites.next();
Iterator dsts = getNodes(CG, targetName).iterator();
Iterator<CGNode> dsts = getNodes(CG, targetName).iterator();
if (! checkAbsence) {
Assert.assertTrue("cannot find " + targetName, dsts.hasNext());
}
while (dsts.hasNext()) {
CGNode dst = (CGNode) dsts.next();
for (Iterator tos = CG.getPossibleTargets(src, sr).iterator(); tos.hasNext();) {
CGNode dst = dsts.next();
for (Iterator<CGNode> tos = CG.getPossibleTargets(src, sr).iterator(); tos.hasNext();) {
if (tos.next().equals(dst)) {
if (checkAbsence) {
System.err.println(("found unexpected " + src + " --> " + dst + " at " + sr));
@ -190,8 +190,8 @@ public abstract class TestCallGraphShape extends WalaTestCase {
* @param destDescription
*/
protected void verifyNoEdges(CallGraph CG, String sourceDescription, String destDescription) {
Collection sources = getNodes(CG, sourceDescription);
Collection dests = getNodes(CG, destDescription);
Collection<CGNode> sources = getNodes(CG, sourceDescription);
Collection<CGNode> dests = getNodes(CG, destDescription);
for (Object source : sources) {
for (Object dest : dests) {
for (Iterator<CGNode> i = CG.getSuccNodes((CGNode) source); i.hasNext();) {

View File

@ -1,445 +0,0 @@
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000010b8d0898, pid=26273, tid=0x0000000000000307
#
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V [libjvm.dylib+0x325898]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread (0x00007ff335002000): JavaThread "main" [_thread_in_vm, id=775, stack(0x00007fff53fe4000,0x00007fff547e4000)]
siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000000
Registers:
RAX=0x0000000111c902d0, RBX=0x00007ff335002000, RCX=0x0000000000000028, RDX=0x0000000000000000
RSP=0x00007fff547e0ca0, RBP=0x00007fff547e0ce0, RSI=0x000000010b41cd5c, RDI=0x0000000111c902d0
R8 =0x0000000000009b75, R9 =0x000000000014f890, R10=0x000000010bde2210, R11=0xffffffff00000000
R12=0x0000000000000000, R13=0x0000000111c8e790, R14=0x0000000111c902d0, R15=0x000000010b41cd60
RIP=0x000000010b8d0898, EFLAGS=0x0000000000010202, ERR=0x0000000000000004
TRAPNO=0x000000000000000e
Top of Stack: (sp=0x00007fff547e0ca0)
0x00007fff547e0ca0: 00007fff547e0cd0 00000007956c5450
0x00007fff547e0cb0: 00009b756c5e0272 000000010b41cd5c
0x00007fff547e0cc0: 00007ff3350021f8 00007ff335002000
0x00007fff547e0cd0: 000000010b41cd60 0000000000000000
0x00007fff547e0ce0: 00007fff547e0d50 000000010b8c065b
0x00007fff547e0cf0: 00007ff3350021f8 00007ff335002000
0x00007fff547e0d00: 00007ff3337007e0 00007ff3000000c7
0x00007fff547e0d10: 000000010bbc4852 00007ff335002000
0x00007fff547e0d20: 00007ff335002000 0000000000000000
0x00007fff547e0d30: 000000000000130b 0000000000000000
0x00007fff547e0d40: 000000000000130b 0000000000000000
0x00007fff547e0d50: 00007fff547e0d80 000000010b41ca78
0x00007fff547e0d60: 000000010b41cd5c 000000010b41cd60
0x00007fff547e0d70: 0000000000000000 00007ff3350021f8
0x00007fff547e0d80: 00007fff547e2140 000000010b41c7b2
0x00007fff547e0d90: 642f73726573552f 7469672f79626c6f
0x00007fff547e0da0: 6f632f414c41572f 61772e6d62692e6d
0x00007fff547e0db0: 2e747361632e616c 7261742f74736574
0x00007fff547e0dc0: 73616c632f746567 6573552f3a736573
0x00007fff547e0dd0: 79626c6f642f7372 7065722f326d2e2f
0x00007fff547e0de0: 2f79726f7469736f 65646f632f67726f
0x00007fff547e0df0: 6a6f6d2f73756168 6d2d636578652f6f
0x00007fff547e0e00: 756c702d6e657661 2e362e312f6e6967
0x00007fff547e0e10: 6d2d636578652f30 756c702d6e657661
0x00007fff547e0e20: 2e362e312d6e6967 552f3a72616a2e30
0x00007fff547e0e30: 6c6f642f73726573 722f326d2e2f7962
0x00007fff547e0e40: 726f7469736f7065 70612f67726f2f79
0x00007fff547e0e50: 76616d2f65686361 6e6576616d2f6e65
0x00007fff547e0e60: 6168636c6f6f742d 312e322e322f6e69
0x00007fff547e0e70: 742d6e6576616d2f 6e696168636c6f6f
0x00007fff547e0e80: 6a2e312e322e322d 726573552f3a7261
0x00007fff547e0e90: 2f79626c6f642f73 6f7065722f326d2e
Instructions: (pc=0x000000010b8d0898)
0x000000010b8d0878: 8d 55 d4 4c 89 f7 e8 6f fc 20 00 4d 85 ed 49 89
0x000000010b8d0888: c6 0f 84 38 01 00 00 4d 85 f6 0f 84 2f 01 00 00
0x000000010b8d0898: 49 8b 3c 24 e8 33 9c fc ff 84 c0 74 20 4c 8d 25
0x000000010b8d08a8: d4 2f 5e 00 49 8b 8c 24 48 04 00 00 48 8d 35 6d
Register to memory mapping:
RAX=0x0000000111c902d0 is an unknown value
RBX=0x00007ff335002000 is a thread
RCX=0x0000000000000028 is an unknown value
RDX=0x0000000000000000 is an unknown value
RSP=0x00007fff547e0ca0 is pointing into the stack for thread: 0x00007ff335002000
RBP=0x00007fff547e0ce0 is pointing into the stack for thread: 0x00007ff335002000
RSI=0x000000010b41cd5c: _ZN7JNIEnv_14ExceptionCheckEv+0xf8 in /Users/dolby/git/WALA/com.ibm.wala.cast.test/target/classes/smoke_main at 0x000000010b41c000
RDI=0x0000000111c902d0 is an unknown value
R8 =0x0000000000009b75 is an unknown value
R9 =0x000000000014f890 is an unknown value
R10=0x000000010bde2210: _ZL8tc_mutex+0x20 in /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/server/libjvm.dylib at 0x000000010b5ab000
R11=0xffffffff00000000 is an unknown value
R12=0x0000000000000000 is an unknown value
R13=0x0000000111c8e790 is an unknown value
R14=0x0000000111c902d0 is an unknown value
R15=0x000000010b41cd60: _ZN7JNIEnv_14ExceptionCheckEv+0xfc in /Users/dolby/git/WALA/com.ibm.wala.cast.test/target/classes/smoke_main at 0x000000010b41c000
Stack: [0x00007fff53fe4000,0x00007fff547e4000], sp=0x00007fff547e0ca0, free space=8179k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.dylib+0x325898]
V [libjvm.dylib+0x31565b]
C [smoke_main+0xa78] _ZN7JNIEnv_11GetMethodIDEP7_jclassPKcS3_+0x38
C [smoke_main+0x7b2] main+0xf4
C [libdyld.dylib+0x5235] start+0x1
C 0x0000000000000002
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x00007ff334022800 JavaThread "Service Thread" daemon [_thread_blocked, id=18691, stack(0x000070000c7d2000,0x000070000c8d2000)]
0x00007ff33401f800 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=18179, stack(0x000070000c6cf000,0x000070000c7cf000)]
0x00007ff333845800 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=17667, stack(0x000070000c5cc000,0x000070000c6cc000)]
0x00007ff333820800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=17155, stack(0x000070000c4c9000,0x000070000c5c9000)]
0x00007ff335053800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=16643, stack(0x000070000c3c6000,0x000070000c4c6000)]
0x00007ff335032000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=16131, stack(0x000070000c2c3000,0x000070000c3c3000)]
0x00007ff33381a800 JavaThread "Finalizer" daemon [_thread_blocked, id=10499, stack(0x000070000c037000,0x000070000c137000)]
0x00007ff333817800 JavaThread "Reference Handler" daemon [_thread_blocked, id=9987, stack(0x000070000bf34000,0x000070000c034000)]
=>0x00007ff335002000 JavaThread "main" [_thread_in_vm, id=775, stack(0x00007fff53fe4000,0x00007fff547e4000)]
Other Threads:
0x00007ff333817000 VMThread [stack: 0x000070000be31000,0x000070000bf31000] [id=9475]
0x00007ff33480e000 WatcherThread [stack: 0x000070000c8d5000,0x000070000c9d5000] [id=19203]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap:
PSYoungGen total 76288K, used 2621K [0x0000000795580000, 0x000000079aa80000, 0x00000007c0000000)
eden space 65536K, 4% used [0x0000000795580000,0x000000079580f5e8,0x0000000799580000)
from space 10752K, 0% used [0x000000079a000000,0x000000079a000000,0x000000079aa80000)
to space 10752K, 0% used [0x0000000799580000,0x0000000799580000,0x000000079a000000)
ParOldGen total 175104K, used 0K [0x0000000740000000, 0x000000074ab00000, 0x0000000795580000)
object space 175104K, 0% used [0x0000000740000000,0x0000000740000000,0x000000074ab00000)
Metaspace used 2662K, capacity 4486K, committed 4864K, reserved 1056768K
class space used 285K, capacity 386K, committed 512K, reserved 1048576K
Card table byte_map: [0x000000010c990000,0x000000010cd91000] byte_map_base: 0x0000000108f90000
Marking Bits: (ParMarkBitMap*) 0x000000010be9cea0
Begin Bits: [0x000000010d03c000, 0x000000010f03c000)
End Bits: [0x000000010f03c000, 0x000000011103c000)
Polling page: 0x000000010b595000
CodeCache: size=245760Kb used=1184Kb max_used=1192Kb free=244575Kb
bounds [0x00000001152b4000, 0x0000000115524000, 0x00000001242b4000]
total_blobs=310 nmethods=81 adapters=143
compilation: enabled
Compilation events (10 events):
Event: 0.098 Thread 0x00007ff33401f800 77 3 java.io.File::<init> (47 bytes)
Event: 0.099 Thread 0x00007ff33401f800 nmethod 77 0x00000001153d9e50 code [0x00000001153da020, 0x00000001153da728]
Event: 0.099 Thread 0x00007ff33401f800 78 3 java.util.zip.ZStreamRef::address (5 bytes)
Event: 0.099 Thread 0x00007ff33401f800 nmethod 78 0x00000001153daa50 code [0x00000001153daba0, 0x00000001153dacf0]
Event: 0.099 Thread 0x00007ff33401f800 79 1 java.nio.charset.Charset::name (5 bytes)
Event: 0.099 Thread 0x00007ff33401f800 nmethod 79 0x00000001153dad50 code [0x00000001153daea0, 0x00000001153dafb0]
Event: 0.099 Thread 0x00007ff333820800 nmethod 74% 0x00000001153dde90 code [0x00000001153ddfe0, 0x00000001153de238]
Event: 0.099 Thread 0x00007ff33401f800 80 3 java.lang.StringCoding::access$300 (8 bytes)
Event: 0.099 Thread 0x00007ff33401f800 nmethod 80 0x00000001153dd550 code [0x00000001153dd700, 0x00000001153ddc28]
Event: 0.099 Thread 0x00007ff33401f800 81 3 java.lang.StringCoding::safeTrim (24 bytes)
GC Heap History (0 events):
No events
Deoptimization events (1 events):
Event: 0.089 Thread 0x00007ff335002000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000001153cdc68 method=java.lang.String.hashCode()I @ 14
Internal exceptions (10 events):
Event: 0.087 Thread 0x00007ff335002000 Exception <a 'java/util/zip/ZipException'> (0x0000000795652828) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u131/8869/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 0.087 Thread 0x00007ff335002000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795652a30) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u131/8869/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
Event: 0.087 Thread 0x00007ff335002000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795652c40) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u131/8869/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
Event: 0.087 Thread 0x00007ff335002000 Exception <a 'java/util/zip/ZipException'> (0x00000007956539c8) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u131/8869/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 0.087 Thread 0x00007ff335002000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795653bd0) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u131/8869/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
Event: 0.087 Thread 0x00007ff335002000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795653de0) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u131/8869/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
Event: 0.089 Thread 0x00007ff335002000 Exception <a 'java/util/zip/ZipException'> (0x0000000795665928) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u131/8869/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 0.089 Thread 0x00007ff335002000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795665b30) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u131/8869/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
Event: 0.089 Thread 0x00007ff335002000 Exception <a 'java/security/PrivilegedActionException'> (0x0000000795665d40) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u131/8869/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
Event: 0.099 Thread 0x00007ff335002000 Exception <a 'java/lang/NoClassDefFoundError': com/ibm/wala/cast/tree/CAst> (0x00000007956c5450) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u131/8869/hotspot/src/share/vm/classfile/systemDictionary.cpp, line 199]
Events (10 events):
Event: 0.090 loading class java/io/FilePermissionCollection
Event: 0.090 loading class java/io/FilePermissionCollection done
Event: 0.090 loading class java/security/AllPermission
Event: 0.090 loading class java/security/AllPermission done
Event: 0.090 loading class java/security/UnresolvedPermission
Event: 0.091 loading class java/security/UnresolvedPermission done
Event: 0.091 loading class java/security/BasicPermissionCollection
Event: 0.091 loading class java/security/BasicPermissionCollection done
Event: 0.091 loading class com/ibm/wala/cast/tree/CAst
Event: 0.091 loading class com/ibm/wala/cast/tree/CAst done
Dynamic libraries:
0x000000010b41f000 /Users/dolby/git/WALA/com.ibm.wala.cast/target/classes/libcast.jnilib
0x000000010b43b000 /opt/local/lib/libgcc/libstdc++.6.dylib
0x000000001057f000 /usr/lib/libSystem.B.dylib
0x000000010b598000 /opt/local/lib/libgcc/libgcc_s.1.dylib
0x000000010b5ab000 /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/server/libjvm.dylib
0x000000001057f000 /usr/lib/libstdc++.6.dylib
0x000000001057f000 /usr/lib/system/libcache.dylib
0x000000001057f000 /usr/lib/system/libcommonCrypto.dylib
0x000000001057f000 /usr/lib/system/libcompiler_rt.dylib
0x000000001057f000 /usr/lib/system/libcopyfile.dylib
0x000000001057f000 /usr/lib/system/libcorecrypto.dylib
0x000000001057f000 /usr/lib/system/libdispatch.dylib
0x000000001057f000 /usr/lib/system/libdyld.dylib
0x000000001057f000 /usr/lib/system/libkeymgr.dylib
0x000000001057f000 /usr/lib/system/liblaunch.dylib
0x000000001057f000 /usr/lib/system/libmacho.dylib
0x000000001057f000 /usr/lib/system/libquarantine.dylib
0x000000001057f000 /usr/lib/system/libremovefile.dylib
0x000000001057f000 /usr/lib/system/libsystem_asl.dylib
0x000000001057f000 /usr/lib/system/libsystem_blocks.dylib
0x000000001057f000 /usr/lib/system/libsystem_c.dylib
0x000000001057f000 /usr/lib/system/libsystem_configuration.dylib
0x000000001057f000 /usr/lib/system/libsystem_coreservices.dylib
0x000000001057f000 /usr/lib/system/libsystem_coretls.dylib
0x000000001057f000 /usr/lib/system/libsystem_dnssd.dylib
0x000000001057f000 /usr/lib/system/libsystem_info.dylib
0x000000001057f000 /usr/lib/system/libsystem_kernel.dylib
0x000000001057f000 /usr/lib/system/libsystem_m.dylib
0x000000001057f000 /usr/lib/system/libsystem_malloc.dylib
0x000000001057f000 /usr/lib/system/libsystem_network.dylib
0x000000001057f000 /usr/lib/system/libsystem_networkextension.dylib
0x000000001057f000 /usr/lib/system/libsystem_notify.dylib
0x000000001057f000 /usr/lib/system/libsystem_platform.dylib
0x000000001057f000 /usr/lib/system/libsystem_pthread.dylib
0x000000001057f000 /usr/lib/system/libsystem_sandbox.dylib
0x000000001057f000 /usr/lib/system/libsystem_secinit.dylib
0x000000001057f000 /usr/lib/system/libsystem_symptoms.dylib
0x000000001057f000 /usr/lib/system/libsystem_trace.dylib
0x000000001057f000 /usr/lib/system/libunwind.dylib
0x000000001057f000 /usr/lib/system/libxpc.dylib
0x000000001057f000 /usr/lib/libobjc.A.dylib
0x000000001057f000 /usr/lib/libc++abi.dylib
0x000000001057f000 /usr/lib/libc++.1.dylib
0x000000010c57c000 /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/libverify.dylib
0x000000010c58a000 /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/libjava.dylib
0x000000001057f000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x000000001057f000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x000000001057f000 /System/Library/Frameworks/Security.framework/Versions/A/Security
0x000000001057f000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x000000001057f000 /usr/lib/libDiagnosticMessagesClient.dylib
0x000000001057f000 /usr/lib/libicucore.A.dylib
0x000000001057f000 /usr/lib/libz.1.dylib
0x000000001057f000 /usr/lib/libauto.dylib
0x000000001057f000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
0x000000001057f000 /usr/lib/libarchive.2.dylib
0x000000001057f000 /usr/lib/libxml2.2.dylib
0x000000001057f000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
0x000000001057f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
0x000000001057f000 /usr/lib/liblangid.dylib
0x000000001057f000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x000000001057f000 /usr/lib/libCRFSuite.dylib
0x000000001057f000 /usr/lib/libenergytrace.dylib
0x000000001057f000 /usr/lib/libbsm.0.dylib
0x000000001057f000 /usr/lib/system/libkxld.dylib
0x000000001057f000 /usr/lib/libcoretls.dylib
0x000000001057f000 /usr/lib/libcoretls_cfhelpers.dylib
0x000000001057f000 /usr/lib/libOpenScriptingUtil.dylib
0x000000001057f000 /usr/lib/libpam.2.dylib
0x000000001057f000 /usr/lib/libsqlite3.dylib
0x000000001057f000 /usr/lib/libxar.1.dylib
0x000000001057f000 /usr/lib/libbz2.1.0.dylib
0x000000001057f000 /usr/lib/liblzma.5.dylib
0x000000001057f000 /usr/lib/libnetwork.dylib
0x000000001057f000 /usr/lib/libpcap.A.dylib
0x000000001057f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents
0x000000001057f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
0x000000001057f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
0x000000001057f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
0x000000001057f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
0x000000001057f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
0x000000001057f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
0x000000001057f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
0x000000001057f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList
0x000000001057f000 /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
0x000000001057f000 /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth
0x000000001057f000 /System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport
0x000000001057f000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC
0x000000001057f000 /usr/lib/libmecabra.dylib
0x000000001057f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
0x000000001057f000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
0x000000001057f000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText
0x000000001057f000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
0x000000001057f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
0x000000001057f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync
0x000000001057f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
0x000000001057f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
0x000000001057f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
0x000000001057f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
0x000000001057f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
0x000000001057f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
0x000000001057f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
0x000000001057f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
0x000000001057f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
0x000000001057f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib
0x000000001057f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib
0x000000001057f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
0x000000001057f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
0x000000001057f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
0x000000001057f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib
0x000000001057f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib
0x000000001057f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib
0x000000001057f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib
0x000000001057f000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
0x000000001057f000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
0x000000001057f000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
0x000000001057f000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
0x000000001057f000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib
0x000000001057f000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
0x000000001057f000 /usr/lib/libcompression.dylib
0x000000001057f000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG
0x000000001057f000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface
0x000000001057f000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport
0x000000001057f000 /usr/lib/libcups.2.dylib
0x000000001057f000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
0x000000001057f000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS
0x000000001057f000 /usr/lib/libresolv.9.dylib
0x000000001057f000 /usr/lib/libiconv.2.dylib
0x000000001057f000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal
0x000000001057f000 /usr/lib/libheimdal-asn1.dylib
0x000000001057f000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory
0x000000001057f000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth
0x000000001057f000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory
0x000000001057f000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation
0x000000001057f000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x000000001057f000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
0x000000001057f000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling
0x000000001057f000 /usr/lib/libmarisa.dylib
0x000000001057f000 /usr/lib/libChineseTokenizer.dylib
0x000000001057f000 /usr/lib/libcmph.dylib
0x000000001057f000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
0x000000001057f000 /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji
0x000000001057f000 /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement
0x000000001057f000 /usr/lib/libxslt.1.dylib
0x000000010c5c7000 /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/libzip.dylib
0x0000000113bb3000 /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/JavaRuntimeSupport
0x000000001057f000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
0x0000000113bcd000 /System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework/Versions/A/JavaNativeFoundation
0x0000000113be2000 /System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM
0x000000001057f000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI
0x000000001057f000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
0x000000001057f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
0x000000001057f000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication
0x000000001057f000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
0x000000001057f000 /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage
0x000000001057f000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
0x000000001057f000 /System/Library/Frameworks/Metal.framework/Versions/A/Metal
0x000000001057f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
0x000000001057f000 /usr/lib/libFosl_dynamic.dylib
0x000000001057f000 /System/Library/PrivateFrameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders
0x000000001057f000 /System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/FaceCore
0x000000001057f000 /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL
0x000000001057f000 /System/Library/PrivateFrameworks/GPUCompiler.framework/libmetal_timestamp.dylib
0x000000001057f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib
0x000000001057f000 /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator
0x000000001057f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
0x000000001057f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib
0x000000001057f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
0x000000001057f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib
0x000000001057f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib
0x000000001057f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib
0x000000001057f000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices
0x000000001057f000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation
0x000000001057f000 /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation
0x000000001057f000 /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight
0x000000001057f000 /usr/lib/libScreenReader.dylib
0x000000001057f000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
0x000000001057f000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore
0x000000001057f000 /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
0x000000001057f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
0x000000001057f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
0x000000001057f000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis
0x000000001057f000 /System/Library/PrivateFrameworks/GenerationalStorage.framework/Versions/A/GenerationalStorage
0x000000001057f000 /System/Library/PrivateFrameworks/Backup.framework/Versions/A/Backup
0x000000001057f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink
0x000000001057f000 /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO
0x000000001057f000 /usr/lib/libate.dylib
0x000000001057f000 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport
0x000000001057f000 /System/Library/PrivateFrameworks/Sharing.framework/Versions/A/Sharing
0x000000001057f000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices
0x000000001057f000 /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer
0x000000001057f000 /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Apple80211
0x000000001057f000 /System/Library/Frameworks/CoreWLAN.framework/Versions/A/CoreWLAN
0x000000001057f000 /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils
0x000000001057f000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth
0x000000001057f000 /System/Library/PrivateFrameworks/CoreWiFi.framework/Versions/A/CoreWiFi
0x000000001057f000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth
0x000000001057f000 /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay
0x000000001057f000 /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment
0x000000001057f000 /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay
0x000000001057f000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols
0x000000001057f000 /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication
0x000000001057f000 /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression
0x000000001057f000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore
0x000000001057f000 /System/Library/PrivateFrameworks/ChunkingLibrary.framework/Versions/A/ChunkingLibrary
0x0000000113bef000 /System/Library/PrivateFrameworks/JavaLaunching.framework/Versions/A/JavaLaunching
0x000000001057f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels
0x000000001057f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help
0x000000001057f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture
0x000000001057f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting
0x000000001057f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print
0x000000001057f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI
VM Arguments:
jvm_args: -Djava.library.path=/Users/dolby/git/WALA/com.ibm.wala.cast.test/target/classes:/Users/dolby/.m2/repository/org/codehaus/mojo/exec-maven-plugin/1.6.0/exec-maven-plugin-1.6.0.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-toolchain/2.2.1/maven-toolchain-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-project/2.2.1/maven-project-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-settings/2.2.1/maven-settings-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-profile/2.2.1/maven-profile-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar:/Users/dolby/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar:/Users/dolby/.m2/repository/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-model/2.2.1/maven-model-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-artifact/2.2.1/maven-artifact-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-artifact-manager/2.2.1/maven-artifact-manager-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-repository-metadata/2.2.1/maven-repository-metadata-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/wagon/wagon-provider-api/1.0-beta-6/wagon-provider-api-1.0-beta-6.jar:/Users/dolby/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-core/2.2.1/maven-core-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/wagon/wagon-file/1.0-beta-6/wagon-file-1.0-beta-6.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/wagon/wagon-http-lightweight/1.0-beta-6/wagon-http-lightweight-1.0-beta-6.jar:/Users/dolby/.m2/repository/org/apache/maven/w-Xmx2048M
java_command: <unknown>
java_class_path (initial): /Users/dolby/git/WALA/com.ibm.wala.cast.test/target/classes:/Users/dolby/.m2/repository/org/codehaus/mojo/exec-maven-plugin/1.6.0/exec-maven-plugin-1.6.0.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-toolchain/2.2.1/maven-toolchain-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-project/2.2.1/maven-project-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-settings/2.2.1/maven-settings-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-profile/2.2.1/maven-profile-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar:/Users/dolby/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar:/Users/dolby/.m2/repository/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-model/2.2.1/maven-model-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-artifact/2.2.1/maven-artifact-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-artifact-manager/2.2.1/maven-artifact-manager-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-repository-metadata/2.2.1/maven-repository-metadata-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/wagon/wagon-provider-api/1.0-beta-6/wagon-provider-api-1.0-beta-6.jar:/Users/dolby/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-core/2.2.1/maven-core-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/wagon/wagon-file/1.0-beta-6/wagon-file-1.0-beta-6.jar:/Users/dolby/.m2/repository/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.jar:/Users/dolby/.m2/repository/org/apache/maven/wagon/wagon-http-lightweight/1.0-beta-6/wagon-http-lightweight-1.0-beta-6.jar:/Users/dolby/.m2/repository/org/apache
Launcher Type: generic
Environment Variables:
_JAVA_OPTIONS=-Xmx2048M
PATH=/Users/dolby/.rvm/gems/ruby-2.4.1/bin:/Users/dolby/.rvm/gems/ruby-2.4.1@global/bin:/Users/dolby/.rvm/rubies/ruby-2.4.1/bin:/opt/local/bin:/opt/local/sbin:/Users/dolby/.opam/4.04.0/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/dolby/.rvm/bin:/opt/X11/bin:/Users/dolby/.rvm/bin:/Users/dolby/.rvm/bin:/Users/dolby/.rvm/bin
SHELL=/bin/bash
DISPLAY=/private/tmp/com.apple.launchd.WKCo28Xjtf/org.macosforge.xquartz:0
Signal Handlers:
SIGSEGV: [libjvm.dylib+0x5b1eb1], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO
SIGBUS: [libjvm.dylib+0x5b1eb1], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGFPE: [libjvm.dylib+0x488988], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGPIPE: [libjvm.dylib+0x488988], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGXFSZ: [libjvm.dylib+0x488988], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: [libjvm.dylib+0x488988], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGUSR1: SIG_DFL, sa_mask[0]=11011111011111100000000111000110, sa_flags=none
SIGUSR2: [libjvm.dylib+0x4884a6], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: [libjvm.dylib+0x486a7d], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGINT: [libjvm.dylib+0x486a7d], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGTERM: [libjvm.dylib+0x486a7d], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGQUIT: [libjvm.dylib+0x486a7d], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
--------------- S Y S T E M ---------------
OS:Bsduname:Darwin 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
rlimit: STACK 8192k, CORE 0k, NPROC 709, NOFILE 10240, AS infinity
load average:3.56 5.06 4.20
CPU:total 8 (initial active 8) (4 cores per cpu, 2 threads per core) family 6 model 70 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2
Memory: 4k page, physical 16777216k(2236788k free)
/proc/meminfo:
vm_info: Java HotSpot(TM) 64-Bit Server VM (25.131-b11) for bsd-amd64 JRE (1.8.0_131-b11), built on Mar 15 2017 01:32:22 by "java_re" with gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
time: Wed Jun 28 11:42:56 2017
elapsed time: 0 seconds (0d 0h 0m 0s)

View File

@ -32,16 +32,9 @@
<id>test-native</id>
<phase>test</phase>
<configuration>
<<<<<<< HEAD
<executable>${project.build.outputDirectory}/smoke_main</executable>
<arguments>
<argument>${project.build.outputDirectory}:${basedir}/../com.ibm.wala.cast/target/classes:${basedir}/../com.ibm.wala.core/target/classes:${basedir}/../com.ibm.wala.util/target/classes</argument>
=======
<workingDirectory>${basedir}</workingDirectory>
<executable>${project.build.outputDirectory}/smoke_main</executable>
<arguments>
<argument>target/classes:../com.ibm.wala.cast/target/classes:../com.ibm.wala.core/target/classes:../com.ibm.wala.util/target/classes</argument>
>>>>>>> 0bbe9970c6c519c192926db909b562b2b9f4b53f
</arguments>
</configuration>
<goals>

View File

@ -78,7 +78,7 @@ org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariable
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=error
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=error
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error

View File

@ -1,11 +1,5 @@
<<<<<<< HEAD
JAVA_SDK = /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/
DOMO_AST_BIN = /Users/dolby/git/WALA/com.ibm.wala.cast/target/classes/
JAVAH_CLASS_PATH = :/Users/dolby/git/WALA/com.ibm.wala.cast/target/classes/
=======
JAVA_SDK = /usr/lib/jvm/jdk1.8.0_111/
DOMO_AST_BIN = /home/vagrant/WALA/com.ibm.wala.cast/target/classes/
JAVAH_CLASS_PATH = :/home/vagrant/WALA/com.ibm.wala.cast/target/classes/
>>>>>>> 0bbe9970c6c519c192926db909b562b2b9f4b53f
TRACE =
JNI_MD_DIR = linux
JNI_MD_DIR = darwin

View File

@ -123,6 +123,8 @@ public:
CAstWrapper(JNIEnv *env, Exceptions &ex, jobject Ast);
virtual ~CAstWrapper() { }
void assertIsCAstNode(jobject, int);
jobject makeNode(int);

View File

@ -37,7 +37,14 @@ extern "C" {
#define CATCH() \
} \
} \
}
#define START_CATCH_BLOCK() \
} else {
#define END_CATCH_BLOCK() \
} \
}
#define THROW(CPP_EXP_NAME, MESSAGE) \
(CPP_EXP_NAME).throwException(__FILE__, __LINE__, MESSAGE)

View File

@ -15,6 +15,9 @@
#define __CTN "com/ibm/wala/cast/tree/CAst"
#define __CTS __SIG( __CTN )
#define __CTI "com/ibm/wala/cast/tree/impl/CAstImpl"
#define __CII __SIG( __CTI )
#define __CEN "com/ibm/wala/cast/tree/CAstEntity"
#define __CES __SIG( __CEN )

View File

@ -118,7 +118,7 @@ public class AstCallGraph extends ExplicitCallGraph {
callbacks.add(callback);
for (Iterator ps = getCallGraph().getPredNodes(this); ps.hasNext();) {
for (Iterator<CGNode> ps = getCallGraph().getPredNodes(this); ps.hasNext();) {
((AstCGNode) ps.next()).addCallback(callback);
}
}
@ -132,7 +132,7 @@ public class AstCallGraph extends ExplicitCallGraph {
callbacks.addAll(callback);
for (Iterator ps = getCallGraph().getPredNodes(this); ps.hasNext();) {
for (Iterator<CGNode> ps = getCallGraph().getPredNodes(this); ps.hasNext();) {
((AstCGNode) ps.next()).addAllCallbacks(callback);
}
}

View File

@ -22,7 +22,7 @@ import com.ibm.wala.cast.ir.ssa.AstAssertInstruction;
import com.ibm.wala.cast.ir.ssa.AstEchoInstruction;
import com.ibm.wala.cast.ir.ssa.AstGlobalRead;
import com.ibm.wala.cast.ir.ssa.AstGlobalWrite;
import com.ibm.wala.cast.ir.ssa.AstIRFactory.AstIR;
import com.ibm.wala.cast.ir.ssa.AstIRFactory;
import com.ibm.wala.cast.ir.ssa.AstInstructionVisitor;
import com.ibm.wala.cast.ir.ssa.AstIsDefinedInstruction;
import com.ibm.wala.cast.ir.ssa.AstLexicalAccess;
@ -314,7 +314,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
public boolean hasNoInterestingUses(CGNode node, int vn, DefUse du) {
if (node.getMethod() instanceof AstMethod) {
// uses in nested functions are interesting
IntSet uses = ((AstIR) node.getIR()).lexicalInfo().getAllExposedUses();
IntSet uses = ((AstIRFactory<?>.AstIR) node.getIR()).lexicalInfo().getAllExposedUses();
if (uses.contains(vn)) {
return false;
}
@ -471,7 +471,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
system.newSideEffect(new UnaryOperator<PointsToSetVariable>() {
@Override
public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) {
final IntSetVariable objects = rhs;
final IntSetVariable<?> objects = rhs;
if (objects.getValue() != null) {
objects.getValue().foreach(new IntSetAction() {
@Override
@ -537,7 +537,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
system.newSideEffect(new UnaryOperator<PointsToSetVariable>() {
@Override
public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) {
final IntSetVariable objects = rhs;
final IntSetVariable<?> objects = rhs;
if (objects.getValue() != null) {
objects.getValue().foreach(new IntSetAction() {
@Override
@ -749,8 +749,8 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
private void addUpwardFunargConstraints(PointerKey lhs, String name, String definer, CGNode definingNode) {
discoveredUpwardFunargs.add(lhs);
LexicalInformation LI = ((AstIR) definingNode.getIR()).lexicalInfo();
Pair[] names = LI.getExposedNames();
LexicalInformation LI = ((AstIRFactory<?>.AstIR) definingNode.getIR()).lexicalInfo();
Pair<String, String>[] names = LI.getExposedNames();
for (int i = 0; i < names.length; i++) {
if (name.equals(names[i].fst) && definer.equals(names[i].snd)) {
int vn = LI.getExitExposedUses()[i];
@ -954,8 +954,8 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
@Override
public byte evaluate(PointsToSetVariable lhs, final PointsToSetVariable[] rhs) {
final IntSetVariable receivers = rhs[0];
final IntSetVariable fields = rhs[1];
final IntSetVariable<?> receivers = rhs[0];
final IntSetVariable<?> fields = rhs[1];
if (receivers.getValue() != null && fields.getValue() != null) {
receivers.getValue().foreach(new IntSetAction() {
@Override
@ -974,7 +974,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
public void act(int fptr) {
if (!doneField.contains(fptr) || !doneReceiver.contains(rptr)) {
InstanceKey field = system.getInstanceKey(fptr);
for (Iterator keys = isLoadOperation ? getPointerKeysForReflectedFieldRead(receiver, field)
for (Iterator<PointerKey> keys = isLoadOperation ? getPointerKeysForReflectedFieldRead(receiver, field)
: getPointerKeysForReflectedFieldWrite(receiver, field); keys.hasNext();) {
AbstractFieldPointerKey key = (AbstractFieldPointerKey) keys.next();
if (DEBUG_PROPERTIES)
@ -1015,7 +1015,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
system.newSideEffect(new UnaryOperator<PointsToSetVariable>() {
@Override
public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) {
final IntSetVariable objects = rhs;
final IntSetVariable<?> objects = rhs;
if (objects.getValue() != null) {
objects.getValue().foreach(new IntSetAction() {
@Override
@ -1024,7 +1024,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
PointerKey objCatalog = getPointerKeyForObjectCatalog(object);
for (int f = 0; f < fieldsKeys.length; f++) {
if (isLoadOperation) {
for (Iterator keys = getPointerKeysForReflectedFieldRead(object, fieldsKeys[f]); keys.hasNext();) {
for (Iterator<PointerKey> keys = getPointerKeysForReflectedFieldRead(object, fieldsKeys[f]); keys.hasNext();) {
AbstractFieldPointerKey key = (AbstractFieldPointerKey) keys.next();
if (DEBUG_PROPERTIES)
action.dump(key, true, false);
@ -1034,7 +1034,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
if (objCatalog != null) {
system.newConstraint(objCatalog, fieldsKeys[f]);
}
for (Iterator keys = getPointerKeysForReflectedFieldWrite(object, fieldsKeys[f]); keys.hasNext();) {
for (Iterator<PointerKey> keys = getPointerKeysForReflectedFieldWrite(object, fieldsKeys[f]); keys.hasNext();) {
AbstractFieldPointerKey key = (AbstractFieldPointerKey) keys.next();
if (DEBUG_PROPERTIES)
action.dump(key, true, false);
@ -1079,14 +1079,14 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
system.newSideEffect(new UnaryOperator<PointsToSetVariable>() {
@Override
public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) {
final IntSetVariable fields = rhs;
final IntSetVariable<?> fields = rhs;
if (fields.getValue() != null) {
fields.getValue().foreach(new IntSetAction() {
@Override
public void act(int fptr) {
InstanceKey field = system.getInstanceKey(fptr);
for (int o = 0; o < objKeys.length; o++) {
for (Iterator keys = isLoadOperation ? getPointerKeysForReflectedFieldRead(objKeys[o], field)
for (Iterator<PointerKey> keys = isLoadOperation ? getPointerKeysForReflectedFieldRead(objKeys[o], field)
: getPointerKeysForReflectedFieldWrite(objKeys[o], field); keys.hasNext();) {
AbstractFieldPointerKey key = (AbstractFieldPointerKey) keys.next();
if (DEBUG_PROPERTIES)
@ -1123,7 +1123,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
PointerKey objCatalog = getPointerKeyForObjectCatalog(objKeys[o]);
for (int f = 0; f < fieldsKeys.length; f++) {
if (isLoadOperation) {
for (Iterator keys = getPointerKeysForReflectedFieldRead(objKeys[o], fieldsKeys[f]); keys.hasNext();) {
for (Iterator<PointerKey> keys = getPointerKeysForReflectedFieldRead(objKeys[o], fieldsKeys[f]); keys.hasNext();) {
AbstractFieldPointerKey key = (AbstractFieldPointerKey) keys.next();
if (DEBUG_PROPERTIES)
action.dump(key, true, true);
@ -1133,7 +1133,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
if (objCatalog != null) {
system.newConstraint(objCatalog, fieldsKeys[f]);
}
for (Iterator keys = getPointerKeysForReflectedFieldWrite(objKeys[o], fieldsKeys[f]); keys.hasNext();) {
for (Iterator<PointerKey> keys = getPointerKeysForReflectedFieldWrite(objKeys[o], fieldsKeys[f]); keys.hasNext();) {
AbstractFieldPointerKey key = (AbstractFieldPointerKey) keys.next();
if (DEBUG_PROPERTIES)
action.dump(key, true, true);

View File

@ -124,8 +124,7 @@ public class CAstCallGraphUtil {
public static void dumpCG(SSAContextInterpreter interp, PointerAnalysis<InstanceKey> PA, CallGraph CG) {
if (AVOID_DUMP)
return;
for (Iterator x = CG.iterator(); x.hasNext();) {
CGNode N = (CGNode) x.next();
for (CGNode N : CG) {
System.err.print("callees of node " + getShortName(N) + " : [");
boolean fst = true;
for (Iterator<? extends CGNode> ns = CG.getSuccNodes(N); ns.hasNext();) {
@ -146,8 +145,7 @@ public class CAstCallGraphUtil {
}
System.err.println("pointer analysis");
for (Iterator x = PA.getPointerKeys().iterator(); x.hasNext();) {
PointerKey n = (PointerKey) x.next();
for (PointerKey n : PA.getPointerKeys()) {
try {
System.err.println((n + " --> " + PA.getPointsToSet(n)));
} catch (Throwable e) {

View File

@ -165,7 +165,7 @@ public class CrossLanguageCallGraph extends AstCallGraph {
}
}
Iterator getLanguageRoots() {
Iterator<CGNode> getLanguageRoots() {
return languageRootNodes.iterator();
}

View File

@ -29,9 +29,9 @@ import com.ibm.wala.util.strings.Atom;
*/
public class CrossLanguageClassTargetSelector implements ClassTargetSelector {
private final Map languageSelectors;
private final Map<Atom, ClassTargetSelector> languageSelectors;
public CrossLanguageClassTargetSelector(Map languageSelectors) {
public CrossLanguageClassTargetSelector(Map<Atom, ClassTargetSelector> languageSelectors) {
this.languageSelectors = languageSelectors;
}
@ -43,7 +43,7 @@ public class CrossLanguageClassTargetSelector implements ClassTargetSelector {
}
private ClassTargetSelector getSelector(NewSiteReference site) {
return (ClassTargetSelector)languageSelectors.get(getLanguage(site));
return languageSelectors.get(getLanguage(site));
}
@Override

View File

@ -35,9 +35,9 @@ import com.ibm.wala.util.strings.Atom;
*/
public class CrossLanguageContextSelector implements ContextSelector {
private final Map languageSelectors;
private final Map<Atom, ContextSelector> languageSelectors;
public CrossLanguageContextSelector(Map languageSelectors) {
public CrossLanguageContextSelector(Map<Atom, ContextSelector> languageSelectors) {
this.languageSelectors = languageSelectors;
}
@ -50,7 +50,7 @@ public class CrossLanguageContextSelector implements ContextSelector {
}
private ContextSelector getSelector(CallSiteReference site) {
return (ContextSelector)languageSelectors.get(getLanguage(site));
return languageSelectors.get(getLanguage(site));
}
@Override

View File

@ -10,8 +10,6 @@
*******************************************************************************/
package com.ibm.wala.cast.ipa.callgraph;
import java.util.Iterator;
import com.ibm.wala.cast.ipa.callgraph.AstSSAPropagationCallGraphBuilder.AstPointerAnalysisImpl.AstImplicitPointsToSetVisitor;
import com.ibm.wala.cast.util.TargetLanguageSelector;
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
@ -103,8 +101,8 @@ public abstract class CrossLanguageSSAPropagationCallGraphBuilder extends AstSSA
@Override
protected void customInit() {
for (Iterator roots = ((CrossLanguageCallGraph) callGraph).getLanguageRoots(); roots.hasNext();) {
markDiscovered((CGNode) roots.next());
for (CGNode root : callGraph) {
markDiscovered(root);
}
}

View File

@ -79,7 +79,7 @@ public class DelegatingAstPointerKeys implements AstPointerKeyFactory {
List<PointerKey> result = new LinkedList<>();
if (F instanceof ConstantKey) {
PointerKey ifk = getInstanceFieldPointerKeyForConstant(I, (ConstantKey) F);
PointerKey ifk = getInstanceFieldPointerKeyForConstant(I, (ConstantKey<?>) F);
if (ifk != null) {
result.add(ifk);
}
@ -105,7 +105,7 @@ public class DelegatingAstPointerKeys implements AstPointerKeyFactory {
* @param F
* @return
*/
protected PointerKey getInstanceFieldPointerKeyForConstant(InstanceKey I, ConstantKey F) {
protected PointerKey getInstanceFieldPointerKeyForConstant(InstanceKey I, ConstantKey<?> F) {
Object v = F.getValue();
// FIXME: current only constant string are handled
if (v instanceof String) {
@ -118,7 +118,7 @@ public class DelegatingAstPointerKeys implements AstPointerKeyFactory {
@Override
public Iterator<PointerKey> getPointerKeysForReflectedFieldRead(InstanceKey I, InstanceKey F) {
if (F instanceof ConstantKey) {
PointerKey ifk = getInstanceFieldPointerKeyForConstant(I, (ConstantKey) F);
PointerKey ifk = getInstanceFieldPointerKeyForConstant(I, (ConstantKey<?>) F);
if (ifk != null) {
return new NonNullSingletonIterator<>(ifk);
}

View File

@ -10,7 +10,6 @@
*****************************************************************************/
package com.ibm.wala.cast.ipa.callgraph;
import java.util.Iterator;
import java.util.Set;
import com.ibm.wala.classLoader.CallSiteReference;
@ -82,8 +81,8 @@ public class MiscellaneousHacksContextSelector implements ContextSelector {
IClass klass = cha.lookupClass(TypeReference.findOrCreate(new ClassLoaderReference(Atom.findOrCreateUnicodeAtom(descr[0]),
ClassLoaderReference.Java, null), TypeName.string2TypeName(descr[1])));
for (Iterator M = klass.getDeclaredMethods().iterator(); M.hasNext();) {
methodsToSpecialize.add(((IMethod) M.next()).getReference());
for (IMethod M : klass.getDeclaredMethods()) {
methodsToSpecialize.add(M.getReference());
}
break;
@ -93,8 +92,8 @@ public class MiscellaneousHacksContextSelector implements ContextSelector {
case 1: {
IClass klass = cha.lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application, TypeName.string2TypeName(descr[0])));
for (Iterator M = klass.getDeclaredMethods().iterator(); M.hasNext();) {
methodsToSpecialize.add(((IMethod) M.next()).getReference());
for (IMethod M : klass.getDeclaredMethods()) {
methodsToSpecialize.add(M.getReference());
}
break;

View File

@ -101,8 +101,8 @@ public class CrossLanguageClassHierarchy implements IClassHierarchy {
@Override
public IClassLoader[] getLoaders() {
Set<IClassLoader> loaders = HashSetFactory.make();
for (Iterator ldrs = analysisScope.getLoaders().iterator(); ldrs.hasNext();) {
loaders.add(getLoader((ClassLoaderReference) ldrs.next()));
for (ClassLoaderReference loaderReference : analysisScope.getLoaders()) {
loaders.add(getLoader(loaderReference));
}
return loaders.toArray(new IClassLoader[loaders.size()]);
@ -121,8 +121,8 @@ public class CrossLanguageClassHierarchy implements IClassHierarchy {
@Override
public int getNumberOfClasses() {
int total = 0;
for (Iterator ldrs = analysisScope.getLoaders().iterator(); ldrs.hasNext();) {
total += getLoader((ClassLoaderReference) ldrs.next()).getNumberOfClasses();
for (ClassLoaderReference loaderReference : analysisScope.getLoaders()) {
total += getLoader(loaderReference).getNumberOfClasses();
}
return total;
@ -264,8 +264,7 @@ public class CrossLanguageClassHierarchy implements IClassHierarchy {
throws ClassHierarchyException {
Set<Language> languages = scope.getBaseLanguages();
Map<Atom, IClassHierarchy> hierarchies = HashMapFactory.make();
for (Iterator ls = languages.iterator(); ls.hasNext();) {
Language L = (Language) ls.next();
for (Language L : languages) {
Set<Language> ll = HashSetFactory.make(L.getDerivedLanguages());
ll.add(L);
hierarchies.put(L.getName(), ClassHierarchyFactory.make(scope, factory, ll));

View File

@ -33,7 +33,7 @@ import com.ibm.wala.ipa.modref.ModRef;
public class AstModRef<T extends InstanceKey> extends ModRef<T> {
@Override
public ExtendedHeapModel makeHeapModel(PointerAnalysis pa) {
public ExtendedHeapModel makeHeapModel(PointerAnalysis<T> pa) {
return (AstHeapModel)pa.getHeapModel();
}

View File

@ -155,11 +155,10 @@ public abstract class AbstractSSAConversion {
@SuppressWarnings("unchecked")
private void makeAssignmentMap() {
this.assignmentMap = new Set[getMaxValueNumber() + 1];
for (Iterator BBs = CFG.iterator(); BBs.hasNext();) {
SSACFG.BasicBlock BB = (SSACFG.BasicBlock) BBs.next();
for (ISSABasicBlock issaBasicBlock : CFG) {
SSACFG.BasicBlock BB = (SSACFG.BasicBlock) issaBasicBlock;
if (BB.getFirstInstructionIndex() >= 0) {
for (Iterator IS = BB.iterator(); IS.hasNext();) {
SSAInstruction inst = (SSAInstruction) IS.next();
for (SSAInstruction inst : BB) {
if (inst != null) {
for (int j = 0; j < getNumberOfDefs(inst); j++) {
addDefiningBlock(assignmentMap, BB, getDef(inst, j));
@ -185,8 +184,8 @@ public abstract class AbstractSSAConversion {
protected void placePhiNodes() {
int IterCount = 0;
for (Iterator Xs = CFG.iterator(); Xs.hasNext();) {
SSACFG.BasicBlock X = (SSACFG.BasicBlock) Xs.next();
for (ISSABasicBlock issaBasicBlock : CFG) {
SSACFG.BasicBlock X = (SSACFG.BasicBlock) issaBasicBlock;
setHasAlready(X, 0);
setWork(X, 0);
}
@ -204,8 +203,7 @@ public abstract class AbstractSSAConversion {
IterCount++;
for (Iterator XS = assignmentMap[V].iterator(); XS.hasNext();) {
SSACFG.BasicBlock X = (SSACFG.BasicBlock) XS.next();
for (BasicBlock X : assignmentMap[V]) {
setWork(X, IterCount);
W.add(X);
}
@ -213,7 +211,7 @@ public abstract class AbstractSSAConversion {
while (!W.isEmpty()) {
SSACFG.BasicBlock X = W.iterator().next();
W.remove(X);
for (Iterator YS = DF.getDominanceFrontier(X); YS.hasNext();) {
for (Iterator<ISSABasicBlock> YS = DF.getDominanceFrontier(X); YS.hasNext();) {
SSACFG.BasicBlock Y = (SSACFG.BasicBlock) YS.next();
if (getHasAlready(Y) < IterCount) {
if (isLive(Y, V)) {
@ -355,7 +353,7 @@ public abstract class AbstractSSAConversion {
repairExit();
}
for (Iterator YS = CFG.getSuccNodes(X); YS.hasNext();) {
for (Iterator<ISSABasicBlock> YS = CFG.getSuccNodes(X); YS.hasNext();) {
SSACFG.BasicBlock Y = (SSACFG.BasicBlock) YS.next();
int Y_id = Y.getGraphNodeId();
int j = com.ibm.wala.cast.ir.cfg.Util.whichPred(CFG, Y, X);

View File

@ -36,18 +36,18 @@ import com.ibm.wala.types.TypeReference;
public class AstIRFactory<T extends IMethod> implements IRFactory<T> {
public ControlFlowGraph makeCFG(final IMethod method, final Context context) {
public ControlFlowGraph<?, ?> makeCFG(final IMethod method, final Context context) {
return ((AstMethod) method).getControlFlowGraph();
}
public static class AstDefaultIRFactory extends DefaultIRFactory {
private final AstIRFactory astFactory;
public static class AstDefaultIRFactory<T extends IMethod> extends DefaultIRFactory {
private final AstIRFactory<T> astFactory;
public AstDefaultIRFactory() {
this(new AstIRFactory());
this(new AstIRFactory<T>());
}
public AstDefaultIRFactory(AstIRFactory astFactory) {
public AstDefaultIRFactory(AstIRFactory<T> astFactory) {
this.astFactory = astFactory;
}
@ -79,7 +79,7 @@ public class AstIRFactory<T extends IMethod> implements IRFactory<T> {
return lexicalInfo;
}
private void setCatchInstructions(SSACFG ssacfg, AbstractCFG oldcfg) {
private void setCatchInstructions(SSACFG ssacfg, AbstractCFG<?, ?> oldcfg) {
for (int i = 0; i < oldcfg.getNumberOfNodes(); i++)
if (oldcfg.isCatchBlock(i)) {
ExceptionHandlerBasicBlock B = (ExceptionHandlerBasicBlock) ssacfg.getNode(i);
@ -144,7 +144,7 @@ public class AstIRFactory<T extends IMethod> implements IRFactory<T> {
public IR makeIR(final IMethod method, final Context context, final SSAOptions options) {
assert method instanceof AstMethod : method.toString();
AbstractCFG oldCfg = ((AstMethod) method).cfg();
AbstractCFG<?, ?> oldCfg = ((AstMethod) method).cfg();
SSAInstruction[] oldInstrs = (SSAInstruction[]) oldCfg.getInstructions();
SSAInstruction[] instrs = new SSAInstruction[ oldInstrs.length ];
System.arraycopy(oldInstrs, 0, instrs, 0, instrs.length);
@ -156,7 +156,7 @@ public class AstIRFactory<T extends IMethod> implements IRFactory<T> {
}
public static IRFactory<IMethod> makeDefaultFactory() {
return new AstDefaultIRFactory();
return new AstDefaultIRFactory<>();
}
@Override

View File

@ -17,7 +17,7 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import com.ibm.wala.cast.ir.ssa.AstIRFactory.AstIR;
import com.ibm.wala.cast.ir.ssa.AstIRFactory;
import com.ibm.wala.cast.ir.ssa.analysis.LiveAnalysis;
import com.ibm.wala.cast.loader.AstMethod;
import com.ibm.wala.cast.loader.AstMethod.DebuggingInformation;
@ -51,7 +51,7 @@ public class SSAConversion extends AbstractSSAConversion {
public static boolean DUMP = false;
private final AstIR ir;
private final AstIRFactory<?>.AstIR ir;
private int nextSSAValue;
@ -247,12 +247,12 @@ public class SSAConversion extends AbstractSSAConversion {
}
}
public static void undoCopyPropagation(AstIR ir, int instruction, int use) {
public static void undoCopyPropagation(AstIRFactory<?>.AstIR ir, int instruction, int use) {
SSAInformation info = (SSAInformation) ir.getLocalMap();
info.undoCopyPropagation(instruction, use);
}
public static void copyUse(AstIR ir, int fromInst, int fromUse, int toInst, int toUse) {
public static void copyUse(AstIRFactory<?>.AstIR ir, int fromInst, int fromUse, int toInst, int toUse) {
SSAInformation info = (SSAInformation) ir.getLocalMap();
info.copyUse(fromInst, fromUse, toInst, toUse);
}
@ -519,7 +519,7 @@ public class SSAConversion extends AbstractSSAConversion {
* @param options
*/
@SuppressWarnings("unchecked")
private SSAConversion(AstMethod M, AstIR ir, SSAOptions options) {
private SSAConversion(AstMethod M, AstIRFactory<?>.AstIR ir, SSAOptions options) {
super(ir, options);
HashMap<Object, CopyPropagationRecord> m = HashMapFactory.make();
this.copyPropagationMap = (ir.getLocalMap() instanceof SSAInformation) ? ((SSAInformation) ir.getLocalMap()).getCopyHistory()
@ -535,7 +535,7 @@ public class SSAConversion extends AbstractSSAConversion {
SSACFG.BasicBlock bb = CFG.getNode(i);
if (bb.hasPhi()) {
int n = 0;
for (Iterator X = bb.iteratePhis(); X.hasNext(); n++)
for (Iterator<SSAPhiInstruction> X = bb.iteratePhis(); X.hasNext(); n++)
X.next();
phiCounts[i] = n;
}
@ -637,7 +637,7 @@ public class SSAConversion extends AbstractSSAConversion {
computedLocalMap = new SSAInformation();
}
private static IntSet valuesToConvert(AstIR ir) {
private static IntSet valuesToConvert(AstIRFactory<?>.AstIR ir) {
SSAInstruction[] insts = ir.getInstructions();
MutableIntSet foundOne = new BitVectorIntSet();
MutableIntSet foundTwo = new BitVectorIntSet();
@ -661,11 +661,11 @@ public class SSAConversion extends AbstractSSAConversion {
return foundTwo;
}
public static SSA2LocalMap convert(AstMethod M, AstIR ir, SSAOptions options) {
public static SSA2LocalMap convert(AstMethod M, AstIRFactory<?>.AstIR ir, SSAOptions options) {
return convert(M, ir, options, valuesToConvert(ir));
}
public static SSA2LocalMap convert(AstMethod M, final AstIR ir, SSAOptions options, final IntSet values) {
public static SSA2LocalMap convert(AstMethod M, final AstIRFactory<?>.AstIR ir, SSAOptions options, final IntSet values) {
try {
if (DEBUG) {
System.err.println(("starting conversion for " + values));

View File

@ -469,18 +469,18 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
* for handling languages that let you include other source files named
* statically (e.g., ABAP)
*/
protected final Map namedEntityResolver;
protected final Map<Object, CAstEntity> namedEntityResolver;
protected final SSAInstructionFactory insts;
protected AstTranslator(IClassLoader loader, Map namedEntityResolver, ArrayOpHandler arrayOpHandler) {
protected AstTranslator(IClassLoader loader, Map<Object, CAstEntity> namedEntityResolver, ArrayOpHandler arrayOpHandler) {
this.loader = loader;
this.namedEntityResolver = namedEntityResolver;
this.arrayOpHandler = arrayOpHandler!=null? arrayOpHandler: this;
this.insts = loader.getInstructionFactory();
}
protected AstTranslator(IClassLoader loader, Map namedEntityResolver) {
protected AstTranslator(IClassLoader loader, Map<Object, CAstEntity> namedEntityResolver) {
this(loader, namedEntityResolver, null);
}
@ -1145,8 +1145,8 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
EdgeOperation normal,
EdgeOperation except) {
for (PreBasicBlock src : blocks) {
for (Iterator j = icfg.getSuccNodes(src); j.hasNext();) {
PreBasicBlock dst = (PreBasicBlock) j.next();
for (Iterator<PreBasicBlock> j = icfg.getSuccNodes(src); j.hasNext();) {
PreBasicBlock dst = j.next();
if (isCatchBlock(dst.getNumber()) || (dst.isExitBlock() && icfg.exceptionalToExit.contains(src))) {
except.act(src, dst);
}
@ -1370,7 +1370,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
PreBasicBlock bb = getNode(i);
s.append(bb).append("\n");
for (Iterator ss = getSuccNodes(bb); ss.hasNext();)
for (Iterator<PreBasicBlock> ss = getSuccNodes(bb); ss.hasNext();)
s.append(" -->" + ss.next() + "\n");
for (int j = bb.getFirstInstructionIndex(); j <= bb.getLastInstructionIndex(); j++)
@ -2326,7 +2326,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
UnwindState getUnwindState();
void setCatchType(IBasicBlock bb, TypeReference catchType);
void setCatchType(IBasicBlock<SSAInstruction> bb, TypeReference catchType);
void setCatchType(CAstNode catchNode, TypeReference catchType);
@ -2413,7 +2413,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
}
@Override
public void setCatchType(IBasicBlock bb, TypeReference catchType) {
public void setCatchType(IBasicBlock<SSAInstruction> bb, TypeReference catchType) {
parent.setCatchType(bb, catchType);
}
@ -2615,7 +2615,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
}
@Override
public void setCatchType(IBasicBlock bb, TypeReference catchType) {
public void setCatchType(IBasicBlock<SSAInstruction> bb, TypeReference catchType) {
if (! catchTypes.containsKey(bb)) {
catchTypes.put(bb, new TypeReference[] { catchType });
} else {
@ -3627,14 +3627,13 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
private static boolean handleBinaryOpThrow(CAstNode n, CAstNode op, WalkContext context) {
// currently, only integer / and % throw exceptions
boolean mayBeInteger = false;
Collection labels = context.getControlFlow().getTargetLabels(n);
Collection<Object> labels = context.getControlFlow().getTargetLabels(n);
if (!labels.isEmpty()) {
context.cfg().addPreNode(n, context.getUnwindState());
mayBeInteger = true;
assert op == CAstOperator.OP_DIV || op == CAstOperator.OP_MOD : CAstPrinter.print(n);
for (Iterator iter = labels.iterator(); iter.hasNext();) {
Object label = iter.next();
for (Object label : labels) {
CAstNode target = context.getControlFlow().getTarget(n, label);
if (target == CAstControlFlowMap.EXCEPTION_TO_EXIT)
context.cfg().addPreEdgeToExit(n, true);
@ -4177,10 +4176,8 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
private static boolean isSimpleSwitch(CAstNode n, WalkContext context, CAstVisitor<WalkContext> visitor) {
CAstControlFlowMap ctrl = context.getControlFlow();
Collection caseLabels = ctrl.getTargetLabels(n);
for (Iterator kases = caseLabels.iterator(); kases.hasNext();) {
Object x = kases.next();
Collection<Object> caseLabels = ctrl.getTargetLabels(n);
for (Object x : caseLabels) {
if (x == CAstControlFlowMap.SWITCH_DEFAULT)
continue;
@ -4216,7 +4213,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
boolean hasExplicitDefault = ctrl.getTarget(n, CAstControlFlowMap.SWITCH_DEFAULT) != null;
Collection caseLabels = ctrl.getTargetLabels(n);
Collection<Object> caseLabels = ctrl.getTargetLabels(n);
int cases = caseLabels.size();
if (hasExplicitDefault)
cases--;
@ -4242,8 +4239,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
}
int cn = 0;
for (Iterator kases = caseLabels.iterator(); kases.hasNext();) {
Object x = kases.next();
for (Object x : caseLabels) {
CAstNode target = ctrl.getTarget(n, x);
if (x == CAstControlFlowMap.SWITCH_DEFAULT) {
context.cfg().addEdge(defaultHackBlock, context.cfg().getBlock(target));
@ -4268,8 +4264,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
Collection<Object> caseLabels = ctrl.getTargetLabels(n);
Map<Object, PreBasicBlock> labelToBlock = new LinkedHashMap<>();
for (Iterator kases = caseLabels.iterator(); kases.hasNext();) {
Object x = kases.next();
for (Object x : caseLabels) {
if (x != CAstControlFlowMap.SWITCH_DEFAULT) {
visitor.visit((CAstNode) x, context, visitor);
context.cfg().addInstruction(
@ -4287,8 +4282,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
visitor.visit(switchBody, context, visitor);
context.cfg().newBlock(true);
for (Iterator kases = caseLabels.iterator(); kases.hasNext();) {
Object x = kases.next();
for (Object x : caseLabels) {
if (x != CAstControlFlowMap.SWITCH_DEFAULT) {
CAstNode target = ctrl.getTarget(n, x);
context.cfg().addEdge(labelToBlock.get(x), context.cfg().getBlock(target));
@ -4336,9 +4330,8 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
context.cfg().addPreNode(n, context.getUnwindState());
context.cfg().newBlock(false);
Collection labels = context.getControlFlow().getTargetLabels(n);
for (Iterator iter = labels.iterator(); iter.hasNext();) {
Object label = iter.next();
Collection<Object> labels = context.getControlFlow().getTargetLabels(n);
for (Object label : labels) {
CAstNode target = context.getControlFlow().getTarget(n, label);
if (target == CAstControlFlowMap.EXCEPTION_TO_EXIT)
context.cfg().addPreEdgeToExit(n, true);
@ -4587,7 +4580,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
public CAstEntity getIncludedEntity(CAstNode n) {
if (n.getChild(0).getKind() == CAstNode.NAMED_ENTITY_REF) {
assert namedEntityResolver != null;
return (CAstEntity) namedEntityResolver.get(n.getChild(0).getChild(0).getValue());
return namedEntityResolver.get(n.getChild(0).getChild(0).getValue());
} else {
return (CAstEntity) n.getChild(0).getValue();
}
@ -4729,7 +4722,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
}
@Override
public void setCatchType(IBasicBlock bb, TypeReference catchType) {
public void setCatchType(IBasicBlock<SSAInstruction> bb, TypeReference catchType) {
}
@Override

View File

@ -12,7 +12,7 @@ import com.ibm.wala.cast.tree.rewrite.CAstRewriterFactory;
import com.ibm.wala.classLoader.ModuleEntry;
public class RewritingTranslatorToCAst implements TranslatorToCAst {
private final List<CAstRewriterFactory> rewriters = new LinkedList<>();
private final List<CAstRewriterFactory<?, ?>> rewriters = new LinkedList<>();
protected final ModuleEntry M;
private final TranslatorToCAst base;
@ -33,7 +33,7 @@ private final TranslatorToCAst base;
public CAstEntity translateToCAst() throws IOException, Error {
CAstImpl Ast = new CAstImpl();
CAstEntity entity = base.translateToCAst();
for(CAstRewriterFactory rwf : rewriters)
for(CAstRewriterFactory<?, ?> rwf : rewriters)
entity = rwf.createCAstRewriter(Ast).rewrite(entity);
return entity;
}

View File

@ -23,14 +23,14 @@ import com.ibm.wala.types.annotations.Annotation;
import com.ibm.wala.util.strings.Atom;
public class AstField implements IField {
private final Collection qualifiers;
private final Collection<CAstQualifier> qualifiers;
private final FieldReference ref;
private final IClass declaringClass;
private final IClassHierarchy cha;
private final Collection<Annotation> annotations;
public AstField(FieldReference ref,
Collection qualifiers,
Collection<CAstQualifier> qualifiers,
IClass declaringClass,
IClassHierarchy cha,
Collection<Annotation> annotations)

View File

@ -103,8 +103,8 @@ public abstract class AstMethod implements IMethod {
}
protected final IClass cls;
private final Collection qualifiers;
private final AbstractCFG cfg;
private final Collection<CAstQualifier> qualifiers;
private final AbstractCFG<?, ?> cfg;
private final SymbolTable symtab;
private final MethodReference ref;
private final boolean hasCatchBlock;
@ -114,7 +114,7 @@ public abstract class AstMethod implements IMethod {
private final DebuggingInformation debugInfo;
private final Collection<Annotation> annotations;
protected AstMethod(IClass cls, Collection qualifiers, AbstractCFG cfg, SymbolTable symtab, MethodReference ref,
protected AstMethod(IClass cls, Collection<CAstQualifier> qualifiers, AbstractCFG<?, ?> cfg, SymbolTable symtab, MethodReference ref,
boolean hasCatchBlock, Map<IBasicBlock<SSAInstruction>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo,
DebuggingInformation debugInfo, Collection<Annotation> annotations) {
this.cls = cls;
@ -130,7 +130,7 @@ public abstract class AstMethod implements IMethod {
this.annotations = annotations;
}
protected AstMethod(IClass cls, Collection qualifiers, MethodReference ref, Collection<Annotation> annotations) {
protected AstMethod(IClass cls, Collection<CAstQualifier> qualifiers, MethodReference ref, Collection<Annotation> annotations) {
this.cls = cls;
this.qualifiers = qualifiers;
this.ref = ref;
@ -147,7 +147,7 @@ public abstract class AstMethod implements IMethod {
assert isAbstract();
}
public AbstractCFG cfg() {
public AbstractCFG<?, ?> cfg() {
return cfg;
}
@ -298,7 +298,7 @@ public abstract class AstMethod implements IMethod {
return qualifiers.contains(CAstQualifier.VOLATILE);
}
public ControlFlowGraph getControlFlowGraph() {
public ControlFlowGraph<?, ?> getControlFlowGraph() {
return cfg;
}

View File

@ -144,13 +144,8 @@ public abstract class CAstAbstractLoader implements IClassLoader {
@Override
public int getNumberOfMethods() {
int i = 0;
for (Iterator cls = types.values().iterator(); cls.hasNext();) {
for (Iterator ms = ((IClass) cls.next()).getDeclaredMethods().iterator();
ms.hasNext(); )
{
i++;
ms.next();
}
for (IClass cls : types.values()) {
i += cls.getDeclaredMethods().size();
}
return i;
@ -208,8 +203,8 @@ public abstract class CAstAbstractLoader implements IClassLoader {
}
}
for (Iterator KK = keys.iterator(); KK.hasNext();) {
types.remove(KK.next());
for (TypeName key : keys) {
types.remove(key);
}
}

View File

@ -111,8 +111,7 @@ public abstract class CAstAbstractModuleLoader extends CAstAbstractLoader {
}
if (DEBUG) {
for (Iterator ts = types.keySet().iterator(); ts.hasNext();) {
TypeName tn = (TypeName) ts.next();
for (TypeName tn : types.keySet()) {
try {
System.err.println(("found type " + tn + " : " + types.get(tn) + " < " + types.get(tn).getSuperclass()));
} catch (Exception e) {

View File

@ -92,7 +92,7 @@ public interface CAstControlFlowMap {
* Return a collection of control-flow ast nodes that have this one as a
* possible target.
*/
Collection getSourceNodes(CAstNode to);
Collection<Object> getSourceNodes(CAstNode to);
/**
* Returns an iterator of all CAstNodes for which this map contains control

View File

@ -15,13 +15,13 @@ package com.ibm.wala.cast.tree;
import java.util.Iterator;
public interface CAstTypeDictionary/*<ASTType>*/ extends Iterable {
public interface CAstTypeDictionary/*<ASTType>*/ extends Iterable<CAstType> {
CAstType getCAstTypeFor(Object/*ASTType*/ type);
CAstReference resolveReference(CAstReference ref);
@Override
Iterator iterator();
Iterator<CAstType> iterator();
}

View File

@ -114,7 +114,7 @@ public class CAstControlFlowRecorder implements CAstControlFlowMap {
}
@Override
public Collection getSourceNodes(CAstNode to) {
public Set<Object> getSourceNodes(CAstNode to) {
if (sourceMap.containsKey(CAstToNode.get(to))) {
return sourceMap.get(CAstToNode.get(to));
} else {
@ -202,8 +202,7 @@ public class CAstControlFlowRecorder implements CAstControlFlowMap {
@Override
public String toString() {
StringBuffer sb = new StringBuffer("control flow map\n");
for (Iterator keys = table.keySet().iterator(); keys.hasNext();) {
Key key = (Key) keys.next();
for (Key key : table.keySet()) {
sb.append(key.from);
if (src != null && nodeToCAst.get(key.from) != null && src.getPosition(nodeToCAst.get(key.from)) != null) {
sb.append(" (").append(src.getPosition(nodeToCAst.get(key.from))).append(") ");

View File

@ -22,20 +22,19 @@ import com.ibm.wala.cast.tree.CAstTypeDictionary;
import com.ibm.wala.util.collections.HashMapFactory;
public class CAstTypeDictionaryImpl implements CAstTypeDictionary {
protected final Map fMap = HashMapFactory.make();
protected final Map<Object, CAstType> fMap = HashMapFactory.make();
@Override
public CAstType getCAstTypeFor(Object/*ASTType*/ astType) {
return (CAstType) fMap.get(astType);
return fMap.get(astType);
}
@SuppressWarnings("unchecked")
public void map(Object/*ASTType*/ astType, CAstType castType) {
fMap.put(astType, castType);
}
@Override
public Iterator iterator() {
public Iterator<CAstType> iterator() {
return fMap.values().iterator();
}

View File

@ -98,7 +98,7 @@ public class AstLoopUnwinder
}
@Override
protected CAstNode flowOutTo(Map nodeMap,
protected CAstNode flowOutTo(Map<Pair<CAstNode, UnwindKey>, CAstNode> nodeMap,
CAstNode oldSource,
Object label,
CAstNode oldTarget,

View File

@ -32,9 +32,9 @@ public abstract class CAstBasicRewriter
* context indicating that no cloning is being performed
*/
public static class NonCopyingContext implements CAstRewriter.RewriteContext<NoKey> {
private final Map nodeMap = new HashMap();
private final Map<Object, Object> nodeMap = new HashMap<>();
public Map nodeMap() {
public Map<Object, Object> nodeMap() {
return nodeMap;
}

View File

@ -57,7 +57,7 @@ public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K e
* interface to be implemented by keys used for cloning sub-trees during the
* rewrite
*/
public interface CopyKey<Self extends CopyKey> {
public interface CopyKey<Self extends CopyKey<Self>> {
@Override
int hashCode();
@ -76,7 +76,7 @@ public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K e
/**
* interface to be implemented by contexts used while traversing the AST
*/
public interface RewriteContext<K extends CopyKey> {
public interface RewriteContext<K extends CopyKey<K>> {
/**
* get the cloning key for this context
@ -190,8 +190,8 @@ public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K e
// try to find a k in key's parent chain such that (oldTarget, k) is
// in nodeMap's key set
Pair targetKey;
CopyKey k = key;
Pair<CAstNode,CopyKey<K>> targetKey;
CopyKey<K> k = key;
do {
targetKey = Pair.make(oldTarget, k);
if (k != null) {
@ -321,8 +321,8 @@ public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K e
if (children.containsKey(oldNode)) {
Set<CAstEntity> newEntities = new LinkedHashSet<>();
newChildren.put(newNode, newEntities);
for (Iterator oldEntities = ((Collection) children.get(oldNode)).iterator(); oldEntities.hasNext();) {
newEntities.add(rewrite((CAstEntity) oldEntities.next()));
for (Iterator<CAstEntity> oldEntities = children.get(oldNode).iterator(); oldEntities.hasNext();) {
newEntities.add(rewrite(oldEntities.next()));
}
}
}
@ -333,8 +333,8 @@ public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K e
if (key == null) {
Set<CAstEntity> newEntities = new LinkedHashSet<>();
newChildren.put(key, newEntities);
for (Iterator oldEntities = ((Collection) entry.getValue()).iterator(); oldEntities.hasNext();) {
newEntities.add(rewrite((CAstEntity) oldEntities.next()));
for (CAstEntity oldEntity : entry.getValue()) {
newEntities.add(rewrite(oldEntity));
}
}
}
@ -454,8 +454,8 @@ public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K e
CAstNode key = entry.getKey();
Set<CAstEntity> newValues = new LinkedHashSet<>();
newChildren.put(key, newValues);
for (Iterator es = entry.getValue().iterator(); es.hasNext();) {
newValues.add(rewrite((CAstEntity) es.next()));
for (CAstEntity entity : entry.getValue()) {
newValues.add(rewrite(entity));
}
}

View File

@ -125,15 +125,15 @@ public abstract class CAstVisitor<C extends CAstVisitor.Context> {
* @param n the parent entity of the entities to process
* @param context a visitor-specific context
*/
public final void visitScopedEntities(CAstEntity n, Map allScopedEntities, C context, CAstVisitor<C> visitor) {
for(Iterator i = allScopedEntities.values().iterator(); i.hasNext(); ) {
visitScopedEntities(n, ((Collection)i.next()).iterator(), context, visitor);
public final void visitScopedEntities(CAstEntity n, Map<CAstNode,Collection<CAstEntity>> allScopedEntities, C context, CAstVisitor<C> visitor) {
for (Collection<CAstEntity> collection : allScopedEntities.values()) {
visitScopedEntities(n, collection.iterator(), context, visitor);
}
}
public final void visitScopedEntities(CAstEntity n, Iterator i, C context, CAstVisitor<C> visitor) {
public final void visitScopedEntities(CAstEntity n, Iterator<CAstEntity> i, C context, CAstVisitor<C> visitor) {
while (i.hasNext()) {
CAstEntity child = (CAstEntity) i.next();
CAstEntity child = i.next();
setParent(child, n);
visitor.visitEntities(child, context, visitor);
}

View File

@ -14,7 +14,6 @@ import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
@ -81,14 +80,15 @@ public class CAstPattern {
}
private void addAll(Segments other) {
for (Iterator xs = other.entrySet().iterator(); xs.hasNext();) {
Map.Entry e = (Map.Entry) xs.next();
String name = (String) e.getKey();
for (Map.Entry<String, Object> e : other.entrySet()) {
String name = e.getKey();
if (e.getValue() instanceof CAstNode) {
add(name, (CAstNode) e.getValue());
} else {
for (Iterator vs = ((List) e.getValue()).iterator(); vs.hasNext();) {
add(name, (CAstNode) vs.next());
@SuppressWarnings("unchecked")
final List<CAstNode> nodes = (List<CAstNode>) e.getValue();
for (CAstNode v : nodes) {
add(name, v);
}
}
}
@ -395,7 +395,7 @@ public class CAstPattern {
private final Collection<Segments> result = HashSetFactory.make();
@Override
public void leaveNode(CAstNode n, Context c, CAstVisitor visitor) {
public void leaveNode(CAstNode n, Context c, CAstVisitor<Context> visitor) {
Segments s = match(CAstPattern.this, n);
if (s != null) {
result.add(s);

View File

@ -13,7 +13,6 @@ package com.ibm.wala.cast.util;
import java.io.IOException;
import java.io.Writer;
import java.util.Collection;
import java.util.Iterator;
import com.ibm.wala.cast.tree.CAstEntity;
import com.ibm.wala.cast.tree.CAstNode;
@ -304,11 +303,9 @@ public class CAstPrinter {
doPrintTo(e.getAST(), e.getSourceMap(), w);
w.write('\n');
}
for(Iterator i= e.getAllScopedEntities().values().iterator();
i.hasNext(); )
{
for(Iterator j = ((Collection) i.next()).iterator(); j.hasNext(); ) {
doPrintTo((CAstEntity) j.next(), w);
for (Collection<CAstEntity> collection : e.getAllScopedEntities().values()) {
for (CAstEntity entity : collection) {
doPrintTo(entity, w);
}
}
w.flush();

View File

@ -81,7 +81,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=error
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=error
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
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=warning

View File

@ -14,7 +14,7 @@ public @interface AnnotationWithParams {
String strParam() default "strdef";
int intParam() default 0;
Class klassParam() default Object.class;
Class<?> klassParam() default Object.class;
AnnotationEnum enumParam() default AnnotationEnum.VAL2;
String[] strArrParam() default {"foo","baz"};
int[] intArrParam() default {3,4};

View File

@ -13,7 +13,7 @@ package classConstant;
class ClassConstant {
public static void main(String args[]) {
Class x = ClassConstant.class;
Class<ClassConstant> x = ClassConstant.class;
x.hashCode();
}

View File

@ -44,10 +44,9 @@ public class TestArrayList {
/**
* @param args
*/
@SuppressWarnings("unchecked")
public static void main(String[] args) {
ArrayList l1 = new ArrayList();
ArrayList l2 = new ArrayList();
ArrayList<Object> l1 = new ArrayList<Object>();
ArrayList<Object> l2 = new ArrayList<Object>();
l1.add(new Object());
l2.add(new Object());
Object o1 = l1.get(0);

View File

@ -18,6 +18,7 @@ import java.util.Iterator;
*
* A simple exercise in recursive data structures.
*/
@SuppressWarnings("rawtypes")
public class NList implements Collection {
final int value;
@ -68,6 +69,7 @@ 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

@ -13,7 +13,7 @@ package reflection;
public class Reflect1 {
public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
Class c = Class.forName("java.lang.Integer");
Class<?> c = Class.forName("java.lang.Integer");
Integer i = (Integer)c.newInstance();
System.err.println(i);
}

View File

@ -19,7 +19,7 @@ import java.lang.reflect.Method;
public class Reflect10 {
public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException,
IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException {
Class c = Class.forName("java.lang.Integer");
Class<?> c = Class.forName("java.lang.Integer");
Method[] m = c.getMethods();
m[0].invoke(new Integer(2), new Object[] {});
}

View File

@ -19,7 +19,7 @@ import java.lang.reflect.Method;
public class Reflect11 {
public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException,
IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException {
Class c = Class.forName("java.lang.Integer");
Class<?> c = Class.forName("java.lang.Integer");
Method[] m = c.getMethods();
m[0].invoke(new Integer(2), (Object[]) args);
}

View File

@ -19,7 +19,7 @@ import java.lang.reflect.Method;
public class Reflect12 {
public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException,
IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException {
Class c = Class.forName("reflection.Helper");
Class<?> c = Class.forName("reflection.Helper");
Method[] m = c.getMethods();
m[0].invoke(new Helper(), new Object[3]);
}

View File

@ -19,7 +19,7 @@ import java.lang.reflect.Method;
public class Reflect13 {
public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException,
IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException {
Class c = Class.forName("reflection.Helper");
Class<?> c = Class.forName("reflection.Helper");
Method[] m = c.getMethods();
int length = new Integer(args[0]).intValue();
m[0].invoke(new Helper(), new Object[length]);

View File

@ -20,7 +20,7 @@ import java.lang.reflect.Modifier;
public class Reflect14 {
public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException,
IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException {
Class c = Class.forName("reflection.Helper");
Class<?> c = Class.forName("reflection.Helper");
Method[] ms = c.getMethods();
for (Method m : ms) {
int mods = m.getModifiers();

View File

@ -19,10 +19,10 @@ import java.lang.reflect.InvocationTargetException;
public class Reflect15 {
public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException,
IllegalAccessException, InvocationTargetException {
Class c = Class.forName("reflection.Helper");
Constructor[] ctors = c.getConstructors();
Class<?> c = Class.forName("reflection.Helper");
Constructor<?>[] ctors = c.getConstructors();
Helper h = null;
for (Constructor ctor : ctors) {
for (Constructor<?> ctor : ctors) {
if (ctor.getParameterTypes().length == 2) {
h = (Helper) ctor.newInstance(new Object[] {new Object(), new Object()});
}

View File

@ -20,7 +20,7 @@ public class Reflect19 {
public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException,
IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException {
Class<?> c = Class.forName("reflection.Helper");
Constructor m = c.getConstructor(new Class[] { Integer.class });
Constructor<?> m = c.getConstructor(new Class<?>[] { Integer.class });
Integer i = Integer.valueOf(0);
m.newInstance(new Object[] { i });
}

View File

@ -22,8 +22,8 @@ public class Reflect20 {
NoSuchMethodException, IllegalAccessException, InstantiationException,
IllegalArgumentException, InvocationTargetException {
Class<?> helperClass = Class.forName("reflection.Helper");
Class objectClass = Class.forName("java.lang.Object");
Class[] paramArrayTypes = new Class[]{objectClass, objectClass};
Class<?> objectClass = Class.forName("java.lang.Object");
Class<?>[] paramArrayTypes = new Class[]{objectClass, objectClass};
Method m = helperClass.getMethod("o", paramArrayTypes);
Object helperObject = helperClass.newInstance();
Object[] paramArrayObjects = new Object[]{new Object(), new Object()};

View File

@ -22,9 +22,9 @@ public class Reflect21 {
NoSuchMethodException, IllegalAccessException, InstantiationException,
IllegalArgumentException, InvocationTargetException {
Class<?> helperClass = Class.forName("reflection.Helper");
Class objectClass = Class.forName("java.lang.Object");
Class[] paramArrayTypes = new Class[]{objectClass, objectClass};
Constructor constr = helperClass.getDeclaredConstructor(paramArrayTypes);
Class<?> objectClass = Class.forName("java.lang.Object");
Class<?>[] paramArrayTypes = new Class[]{objectClass, objectClass};
Constructor<?> constr = helperClass.getDeclaredConstructor(paramArrayTypes);
Object[] paramArrayObjects = new Object[]{new Object(), new Object()};
constr.newInstance(paramArrayObjects);
}

View File

@ -21,11 +21,11 @@ public class Reflect22 {
public static void main(String[] args) throws ClassNotFoundException, SecurityException,
NoSuchMethodException, IllegalAccessException, InstantiationException,
IllegalArgumentException, InvocationTargetException {
Class helperClass = Class.forName("reflection.Helper");
Constructor[] constrs = helperClass.getDeclaredConstructors();
for (Constructor constr : constrs) {
Class<?> helperClass = Class.forName("reflection.Helper");
Constructor<?>[] constrs = helperClass.getDeclaredConstructors();
for (Constructor<?> constr : constrs) {
if (constr.getParameterTypes().length == 1) {
Class paramType = constr.getParameterTypes()[0];
Class<?> paramType = constr.getParameterTypes()[0];
if (paramType.getName().equals("java.lang.Integer")) {
Integer i = new Integer(1);
Object[] initArgs = new Object[]{i};

View File

@ -22,12 +22,12 @@ public class Reflect23 {
public static void main(String[] args) throws ClassNotFoundException, SecurityException,
NoSuchMethodException, IllegalAccessException, InstantiationException,
IllegalArgumentException, InvocationTargetException {
Class helperClass = Class.forName("reflection.Helper");
Class<?> helperClass = Class.forName("reflection.Helper");
Object helperObject = helperClass.newInstance();
Method[] methods = helperClass.getDeclaredMethods();
for (Method m : methods) {
if (m.getParameterTypes().length == 1) {
Class paramType = m.getParameterTypes()[0];
Class<?> paramType = m.getParameterTypes()[0];
if (! Modifier.isStatic(m.getModifiers()) && paramType.getName().equals("java.lang.Integer")) {
Integer i = new Integer(1);
Object[] initArgs = new Object[]{i};

View File

@ -15,13 +15,14 @@ import java.util.Hashtable;
public class Reflect3 {
public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
Class c = Class.forName("java.util.Properties");
Hashtable h = (Hashtable) c.newInstance();
Class<?> c = Class.forName("java.util.Properties");
@SuppressWarnings("unchecked")
Hashtable<Object, Object> h = (Hashtable<Object, Object>) c.newInstance();
System.out.println(h.toString());
}
@SuppressWarnings("unused")
private static class Hash extends Hashtable {
private static class Hash extends Hashtable<Object, Object> {
}
}

View File

@ -15,7 +15,7 @@ import java.io.FilePermission;
public class Reflect4 {
public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
Class c = Class.forName("java.io.FilePermission");
Class<?> c = Class.forName("java.io.FilePermission");
FilePermission h = (FilePermission) c.newInstance();
System.out.println(h.toString());
}

View File

@ -14,7 +14,7 @@ package reflection;
public class Reflect5 {
public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
Class c = Class.forName("reflection.Reflect5$A");
Class<?> c = Class.forName("reflection.Reflect5$A");
A h = (A) c.newInstance();
System.out.println(h.toString());
}

View File

@ -14,7 +14,7 @@ package reflection;
public class Reflect6 {
public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
Class c = Class.forName("reflection.Reflect6$A");
Class<?> c = Class.forName("reflection.Reflect6$A");
A h = (A) c.newInstance();
System.out.println(h.toString());
}

View File

@ -23,8 +23,8 @@ public class Reflect7 {
@SuppressWarnings("unchecked")
public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException,
IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {
Class c = Class.forName("java.io.FilePermission");
Class[] paramTypes = new Class[] { "".getClass(), "".getClass() };
Class<FilePermission> c = (Class<FilePermission>) Class.forName("java.io.FilePermission");
Class<?>[] paramTypes = new Class[] { "".getClass(), "".getClass() };
Constructor<FilePermission> constr = c.getConstructor(paramTypes);
Object[] params = new String[] { "log.txt", "read" };
FilePermission fp = constr.newInstance(params);

View File

@ -19,8 +19,8 @@ import java.lang.reflect.InvocationTargetException;
public class Reflect8 {
public static void main(String[] args) throws ClassNotFoundException, IllegalArgumentException, InstantiationException,
IllegalAccessException, InvocationTargetException {
Class c = Class.forName("java.lang.Integer");
Constructor[] ctors = c.getConstructors();
Class<?> c = Class.forName("java.lang.Integer");
Constructor<?>[] ctors = c.getConstructors();
Integer i = (Integer) ctors[0].newInstance(new Integer(1));
i.toString();
}

View File

@ -15,6 +15,6 @@ import java.util.Hashtable;
public class Slice7 {
public static void main(String args[]) {
@SuppressWarnings("unused")
Hashtable abc = new Hashtable(3, 0.75f);
Hashtable<Object, Object> abc = new Hashtable<Object, Object>(3, 0.75f);
}
}

View File

@ -77,7 +77,7 @@ org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariable
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=error
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error

View File

@ -64,7 +64,7 @@ public class PrimitivesTest extends WalaTestCase {
/**
* Test the MutableSparseIntSet implementation
*/
private static void doMutableIntSet(MutableIntSetFactory factory) {
private static void doMutableIntSet(MutableIntSetFactory<?> factory) {
MutableIntSet v = factory.parse("{9,17}");
MutableIntSet w = factory.make(new int[] {});
MutableIntSet x = factory.make(new int[] { 7, 4, 2, 4, 2, 2 });
@ -891,7 +891,7 @@ public class PrimitivesTest extends WalaTestCase {
testSingleBitVector(new OffsetBitVector(100, 10));
}
private static void testSingleBitVector(BitVectorBase bv) {
private static void testSingleBitVector(BitVectorBase<?> bv) {
// does the following not automatically scale the bitvector to
// a reasonable size?
bv.set(55);
@ -959,8 +959,7 @@ public class PrimitivesTest extends WalaTestCase {
testBitVectors(new OffsetBitVector(35, 20), new OffsetBitVector(25, 10));
}
@SuppressWarnings("unchecked")
private static <T extends BitVectorBase> void testBitVectors(T v1, T v2) {
private static <T extends BitVectorBase<T>> void testBitVectors(T v1, T v2) {
v1.set(100);
v1.set(101);
v1.set(102);

View File

@ -276,7 +276,7 @@ public class CallGraphTest extends WalaTestCase {
Iterable<Entrypoint> entrypoints = Util.makeMainEntrypoints(scope, cha, "Ldemandpa/TestArraysCopyOf");
AnalysisOptions options = CallGraphTestUtil.makeAnalysisOptions(scope, entrypoints);
IAnalysisCacheView cache = new AnalysisCacheImpl();
CallGraphBuilder builder = Util.makeZeroOneContainerCFABuilder(options, cache, cha, scope);
CallGraphBuilder<InstanceKey> builder = Util.makeZeroOneContainerCFABuilder(options, cache, cha, scope);
CallGraph cg = builder.makeCallGraph(options, null);
PointerAnalysis<InstanceKey> pa = builder.getPointerAnalysis();
CGNode mainMethod = AbstractPtrTest.findMainMethod(cg);

View File

@ -19,6 +19,7 @@ import com.ibm.wala.ipa.callgraph.CallGraphBuilder;
import com.ibm.wala.ipa.callgraph.Entrypoint;
import com.ibm.wala.ipa.callgraph.IAnalysisCacheView;
import com.ibm.wala.ipa.callgraph.impl.Util;
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
import com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.util.CancelException;
@ -62,7 +63,7 @@ public class CallGraphTestUtil {
S.start();
}
CallGraphBuilder builder = Util.makeRTABuilder(options, cache, cha, scope);
CallGraphBuilder<InstanceKey> builder = Util.makeRTABuilder(options, cache, cha, scope);
CallGraph cg = builder.makeCallGraph(options, null);
if (CHECK_FOOTPRINT) {
@ -101,7 +102,7 @@ public class CallGraphTestUtil {
S.start();
}
CallGraphBuilder builder = Util.makeVanillaZeroOneCFABuilder(options, cache, cha, scope);
CallGraphBuilder<InstanceKey> builder = Util.makeVanillaZeroOneCFABuilder(options, cache, cha, scope);
CallGraph cg = builder.makeCallGraph(options, null);
if (CHECK_FOOTPRINT) {
@ -119,7 +120,7 @@ public class CallGraphTestUtil {
S.start();
}
CallGraphBuilder builder = Util.makeZeroOneCFABuilder(options, cache, cha, scope);
CallGraphBuilder<InstanceKey> builder = Util.makeZeroOneCFABuilder(options, cache, cha, scope);
CallGraph cg = builder.makeCallGraph(options, null);
if (testPAtoString) {
builder.getPointerAnalysis().toString();
@ -140,7 +141,7 @@ public class CallGraphTestUtil {
S.start();
}
CallGraphBuilder builder = Util.makeZeroContainerCFABuilder(options, cache, cha, scope);
CallGraphBuilder<InstanceKey> builder = Util.makeZeroContainerCFABuilder(options, cache, cha, scope);
CallGraph cg = builder.makeCallGraph(options, null);
if (CHECK_FOOTPRINT) {
@ -158,7 +159,7 @@ public class CallGraphTestUtil {
S.start();
}
CallGraphBuilder builder = Util.makeZeroOneContainerCFABuilder(options, cache, cha, scope);
CallGraphBuilder<InstanceKey> builder = Util.makeZeroOneContainerCFABuilder(options, cache, cha, scope);
CallGraph cg = builder.makeCallGraph(options, null);
if (CHECK_FOOTPRINT) {

View File

@ -41,8 +41,8 @@ public class DebuggingBitsetCallGraphTest extends WalaTestCase {
graphTest = new CallGraphTest();
}
private void runBitsetTest(MutableIntSetFactory p, MutableIntSetFactory s) throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
MutableIntSetFactory save = IntSetUtil.getDefaultIntSetFactory();
private void runBitsetTest(MutableIntSetFactory<?> p, MutableIntSetFactory<?> s) throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
MutableIntSetFactory<?> save = IntSetUtil.getDefaultIntSetFactory();
try {
IntSetUtil.setDefaultIntSetFactory(new DebuggingMutableIntSetFactory(p, s));
graphTest.testJLex();

View File

@ -34,6 +34,7 @@ import com.ibm.wala.ipa.callgraph.CallGraphBuilder;
import com.ibm.wala.ipa.callgraph.Entrypoint;
import com.ibm.wala.ipa.callgraph.IAnalysisCacheView;
import com.ibm.wala.ipa.callgraph.impl.Util;
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
import com.ibm.wala.ipa.cha.ClassHierarchy;
import com.ibm.wala.ipa.cha.ClassHierarchyException;
import com.ibm.wala.ipa.cha.ClassHierarchyFactory;
@ -74,7 +75,7 @@ public class NullPointerExceptionInterTest extends WalaTestCase {
Iterable<Entrypoint> entrypoints = com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope, cha, "Lcfg/exc/inter/CallFieldAccess");
AnalysisOptions options = new AnalysisOptions(scope, entrypoints);
CallGraphBuilder builder = Util.makeNCFABuilder(1, options, cache, cha, scope);
CallGraphBuilder<InstanceKey> builder = Util.makeNCFABuilder(1, options, cache, cha, scope);
cg = builder.makeCallGraph(options, null);
} catch (ClassHierarchyException e) {
throw new Exception(e);

View File

@ -63,7 +63,7 @@ public class SourceMapTest extends WalaTestCase {
String sourceFile = klass.getSourceFileName();
Assert.assertTrue(sourceFile != null);
System.err.println("Source file: " + sourceFile);
Module container = ((BytecodeClass)klass).getContainer();
Module container = ((BytecodeClass<?>)klass).getContainer();
Assert.assertTrue(container != null);
System.err.println("container: " + container);
}

View File

@ -236,7 +236,7 @@ public abstract class AbstractPtrTest {
AnalysisOptions options = CallGraphTestUtil.makeAnalysisOptions(scope, entrypoints);
final IAnalysisCacheView analysisCache = new AnalysisCacheImpl();
CallGraphBuilder cgBuilder = Util.makeZeroCFABuilder(options, analysisCache, cha, scope);
CallGraphBuilder<InstanceKey> cgBuilder = Util.makeZeroCFABuilder(options, analysisCache, cha, scope);
final CallGraph cg = cgBuilder.makeCallGraph(options, null);
// System.err.println(cg.toString());

View File

@ -83,7 +83,7 @@ public class ExceptionAnalysis2EdgeFilterTest {
ReferenceCleanser.registerClassHierarchy(cha);
IAnalysisCacheView cache = new AnalysisCacheImpl();
ReferenceCleanser.registerCache(cache);
CallGraphBuilder builder = Util.makeZeroCFABuilder(options, cache, cha, scope);
CallGraphBuilder<InstanceKey> builder = Util.makeZeroCFABuilder(options, cache, cha, scope);
cg = builder.makeCallGraph(options, null);
pointerAnalysis = builder.getPointerAnalysis();

View File

@ -77,7 +77,7 @@ public class ExceptionAnalysisTest {
ReferenceCleanser.registerClassHierarchy(cha);
IAnalysisCacheView cache = new AnalysisCacheImpl();
ReferenceCleanser.registerCache(cache);
CallGraphBuilder builder = Util.makeZeroCFABuilder(options, cache, cha, scope);
CallGraphBuilder<InstanceKey> builder = Util.makeZeroCFABuilder(options, cache, cha, scope);
cg = builder.makeCallGraph(options, null);
pointerAnalysis = builder.getPointerAnalysis();

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