Skip to content

Commit

Permalink
Fixed class name determination.
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Apr 18, 2016
1 parent 497037d commit 4bef7c8
Showing 1 changed file with 17 additions and 13 deletions.
Expand Up @@ -203,16 +203,16 @@ private Object wrapSubsystem(MethodInvocation invocation) throws Throwable {
}

private ProfilingDataManager.Subsystem getSubsystem(MethodInvocation invocation) {
String methodName = invocation.getMethod().getName();
if (methodName.startsWith("com.evolveum.midpoint.repo")) {
String className = getFullClassName(invocation);
if (className.startsWith("com.evolveum.midpoint.repo")) {
return ProfilingDataManager.Subsystem.REPOSITORY;
} else if (methodName.startsWith("com.evolveum.midpoint.model")) {
} else if (className.startsWith("com.evolveum.midpoint.model")) {
return ProfilingDataManager.Subsystem.MODEL;
} else if (methodName.startsWith("com.evolveum.midpoint.provisioning")) {
} else if (className.startsWith("com.evolveum.midpoint.provisioning")) {
return ProfilingDataManager.Subsystem.PROVISIONING;
} else if (methodName.startsWith("com.evolveum.midpoint.task")) {
} else if (className.startsWith("com.evolveum.midpoint.task")) {
return ProfilingDataManager.Subsystem.TASK_MANAGER;
} else if (methodName.startsWith("com.evolveum.midpoint.wf")) {
} else if (className.startsWith("com.evolveum.midpoint.wf")) {
return ProfilingDataManager.Subsystem.WORKFLOW;
} else {
return null;
Expand All @@ -224,13 +224,17 @@ private ProfilingDataManager.Subsystem getSubsystem(MethodInvocation invocation)
*
*/
private String getClassName(MethodInvocation invocation) {
String className = null;
if (invocation.getThis() != null) {
className = invocation.getThis().getClass().getName();
className = className.replaceFirst("com.evolveum.midpoint", "..");
}
return className;
}
String className = getFullClassName(invocation);
return className != null ? className.replaceFirst("com.evolveum.midpoint", "..") : null;
}

private String getFullClassName(MethodInvocation invocation) {
String className = null;
if (invocation.getThis() != null) {
className = invocation.getThis().getClass().getName();
}
return className;
}

/*
* Stores current depth value to MDC
Expand Down

0 comments on commit 4bef7c8

Please sign in to comment.