final List<MethodItem> suspiciousStackPrefix = new ArrayList<MethodItem>();
final Matcher matcher = Matcher.getDefault();
Utils.processPersistable(new Persistable.Query() {
public TransactionResult runQuery(EntityManager em) throws Exception {
PrestimeCPUCCTNode node = getBiggestChild(root);
Component componentCandidate = null;
long selfTime;
boolean canContinue = true;
do {
selfTime = getSelfTime(node);
String methodName = getMethodName(node);
suspiciousStackPrefix.add(new MethodItem(methodName, node.getTotalTime0(), selfTime));
Component nodeComponent = matcher.matchMethod(em, node.getNodeName());
if (nodeComponent != null) {
componentCandidate = nodeComponent;// find deepest known component
}
if (isMoreThan(selfTime, PERCENTAGE_OF_SELF_NODE, node.getTotalTime0())) {
if (nodeComponent != null) {
canContinue = false;
}
}
PrestimeCPUCCTNode child = getBiggestChild(node);
if (child == null) {
canContinue = false;
} else if (!isMoreThan(child.getTotalTime0(), PERCENTAGE_OF_BIGGEST_NODE, node.getTotalTime0())) {
if (componentCandidate != null) {
canContinue = false;
}
}
node = child;