We are getting a NoSuchMethodError in the runtime. I just want to know do we get this error because the parent class is not found in the classpath in the server or the class is found but outdated.
The reason that I am asking this question is , does JRE checks for the presence of the class JEP during the instantiation of ExpressionEvaluator or it only checks only when a method is invoked which in turn calls the superclass method?
import org.nfunk.jep.JEP;
/** TODO Explain this class */
public class ExpressionEvaluator extends JEP {
public ExpressionEvaluator() {
}
...
...
client code
public static boolean checkExpressionValidity(String ruleExpression) {
ExpressionEvaluator evaluator = new ExpressionEvaluator(); // instantiation
if (!(ruleExpression.contains(">") || ruleExpression.contains("<")
|| ruleExpression.contains("==") || ruleExpression.contains("!="))) {
return false;
}
String ruleExpressionForValidation = ruleExpression.replaceAll(
REGEX_FUNCTION_FINDER, "1");
evaluator.parseExpression(ruleExpressionForValidation); // super class method.
Sure, because when JVM create instance of ExpressionEvaluator, it executes parent constructor