if (context.isAnnotatableType(m.getParameterType(i))) {
paramTypes[i] = context.parseSchemaType(config.getMethodParameterType(m, i, context.getTypeAnnotationForParameter(m, i)), origin);
}
}
// make the method
Method method = new Method(m.getName(), methodentry, methodexit, parameters, returnVar, returnType, paramTypes);
context.setMethod(m, method);
}
for (SootField f : c.getFields()) {
// parse annotations
if (context.isAnnotatableType(f.getType())) {
Origin origin = new Origin(c.getName() + "." + f.getName(), 0, 0);
context.setFieldSchemaType(f, context.parseSchemaType(config.getFieldType(f, context.getTypeAnnotation(f)), origin));
}
}
}
// translate!
for (SootClass c : Scene.v().getApplicationClasses()) {
context.setCurrentClass(c);
for (SootMethod m : c.getMethods()) {
if (!m.isConcrete())
continue;
context.setCurrentSootMethod(m);
CompleteUnitGraph unitgraph = new CompleteUnitGraph(m.retrieveActiveBody());
context.setNullness(new NullnessAnalysis(unitgraph));
context.setStringConstants(new StringConstantAnalysis(unitgraph));
context.setArrayConstants(new ArrayConstantAnalysis(unitgraph));
Method method = context.getMethod(m);
Map<Unit,StatementPair> translated = new HashMap<Unit,StatementPair>();
for (Unit stmt : m.getActiveBody().getUnits()) {
context.setCurrentUnit(stmt);
context.setCurrentLine(getLineNumber(stmt));
translated.put(stmt, translator.translateStmt((Stmt)stmt));
}
for (Map.Entry<Unit, StatementPair> entry : translated.entrySet()) {
Unit stmt = entry.getKey();
StatementPair translation = entry.getValue();
// add successors
for (Unit next : unitgraph.getSuccsOf(stmt)) {
StatementPair nextt = translated.get(next);
graph.addEdge(translation.last, nextt.first, new VariableFilter());
}
// add (exceptional) return edge
graph.addEdge(translation.last, method.getExit(), new VariableFilter());
}
// add entry edges
for (Unit head : unitgraph.getHeads()) {
graph.addEdge(method.getEntry(), translated.get(head).first, new VariableFilter(true, VariableFilter.Kind.ENTRY));
}
}
}
// run string analysis