Element instrumentation = (Element)instrumentationsList.item(i);
StringBuilder sb = new StringBuilder();
String methodName = getNodeValue(instrumentation, "method");
String classType = getNodeValue(instrumentation, "classType");
ClassInstrumentationInfo cii = new ClassInstrumentationInfo(getNodeValue(instrumentation, "package"),
getNodeValue(instrumentation, "class"),
methodName,
classType,
getNodeValue(instrumentation, "path"),
getNodeValue(instrumentation, "extends"),
getNodeValue(instrumentation, "implements"));
if (cii.getPackageName().endsWith("*")) { //Wildcard No need for classname
sb.append(cii.getPackageName());
} else {
sb.append(cii.getPackageName()).append(".").append(cii.getClassName());
}
if (cii.isDoesImplement() || cii.isDoesExtend()) {
ClassInstrumentationInfo oldCii = subtypeInstrumentationHash.get(sb.toString());
if (oldCii != null) { //Add method to existing instrumentation
oldCii.getMethodNameHash().put(methodName, new MethodInstrumentation(methodName, classType));
} else { //Add new ClassInstrumentationInfo
subtypeInstrumentationHash.put(sb.toString(), cii);
}
} else {
ClassInstrumentationInfo oldCii = instrumentationHash.get(sb.toString());
if (oldCii != null) { //Add method to existing instrumentation
oldCii.getMethodNameHash().put(methodName, new MethodInstrumentation(methodName, classType));
} else { //Add new ClassInstrumentationInfo
instrumentationHash.put(sb.toString(), cii);
}
}