private void generateCallingsRecursive(int level, long methodIdCallee,
JBPMethod rootMethod, JBPMethodCount consolidacao,
HashMap hashMethods, HashMap hashCallings,
GraphReference referenceKey, java.util.Stack path) {
GraphMethod keyMethod = new GraphMethod();
Iterator iterValues = consolidacao.getCountCalleds().values()
.iterator();
while (iterValues.hasNext()) {
JBPMethodCount subConsolidacao = (JBPMethodCount) iterValues.next();
double percenptual = ((double) subConsolidacao
.getTotalElapsedClock() / (double) rootMethod
.getTotalElapsedClock())
* (double) 100;
if (percenptual < 1.00)
continue;
keyMethod.setMethodId(subConsolidacao.getSpyMethod().getMethodID());
keyMethod.setLevel(level);
if (hashMethods.get(keyMethod) == null) {
GraphMethod newMethod = new GraphMethod(subConsolidacao
.getSpyMethod(), level, createURL(rootMethod, path,
subConsolidacao.getSpyMethod()));
hashMethods.put(newMethod, newMethod);
}
}
iterValues = consolidacao.getCountCalleds().values().iterator();
while (iterValues.hasNext()) {
JBPMethodCount subConsolidacao = (JBPMethodCount) iterValues.next();
keyMethod.setMethodId(subConsolidacao.getSpyMethod().getMethodID());
keyMethod.setLevel(level);
GraphMethod graphMethod = (GraphMethod) hashMethods.get(keyMethod);
double percenptual = ((double) subConsolidacao
.getTotalElapsedClock() / (double) rootMethod
.getTotalElapsedClock())
* (double) 100;
if (percenptual < 1.00)
continue;
if (graphMethod == null) {
throw new RuntimeException("Unexpected null method");
}
referenceKey.setMethodCallee(methodIdCallee);
referenceKey.setLevelCallee(level - 1);
referenceKey.setLevelCalled(level);
referenceKey.setMethodCalled(subConsolidacao.getSpyMethod()
.getMethodID());
if (hashCallings.get(referenceKey) == null) {
GraphReference ref = new GraphReference(level - 1,
methodIdCallee, level, subConsolidacao.getSpyMethod()
.getMethodID(), ((double) subConsolidacao
.getTotalElapsedClock() / (double) rootMethod
.getTotalElapsedClock())
* (double) 100, (double) subConsolidacao
.getTotalClocks()
/ (double) rootMethod.getTotalClock()
* (double) 100);
graphMethod.setWeight(graphMethod.getWeight() + percenptual);
hashCallings.put(ref, ref);
}
path.push(subConsolidacao.getSpyMethod());
generateCallingsRecursive(level + 1, subConsolidacao.getSpyMethod()