1 13 package org.ejbca.core.model.approval; 14 15 import org.apache.log4j.Logger; 16 17 26 public class ApprovalOveradableClassName { 27 28 private static final Logger log = Logger.getLogger(ApprovalOveradableClassName.class); 29 30 String className = null; 31 String methodName = null; 32 33 38 public ApprovalOveradableClassName(String className, String methodName) { 39 super(); 40 this.className = className; 41 this.methodName = methodName; 42 } 43 44 47 48 public String getClassName() { 49 return className; 50 } 51 52 public String getMethodName() { 53 return methodName; 54 } 55 56 61 public boolean isInStackTrace(StackTraceElement [] traces){ 62 63 boolean retval = false; 64 for(int i=0;i<traces.length;i++){ 65 if (log.isDebugEnabled()) { 66 log.debug("Compare " + className + "." + methodName + " with " + traces[i].getClassName() + "." +traces[i].getMethodName() ); 67 } 68 if(traces[i].getClassName().equals(className)){ 69 if(methodName != null){ 70 retval = traces[i].getMethodName().equals(methodName); 71 if(retval == true){ 72 break; 73 } 74 }else{ 75 retval = true; 76 break; 77 } 78 } 79 } 80 81 82 if (log.isDebugEnabled()) { 83 log.debug("Result " + retval); 84 } 85 86 return retval; 87 } 88 89 } 90 | Popular Tags |