String classBaseName = Types.getBaseName(className); // for inner classes for (DelayedEvalBshMethod bshmethod : bshmethods) if (bshmethod.getName().equals(classBaseName))
BshMethod constructor = instanceNameSpace.getMethod(Types.getBaseName(className), Types.getTypes(args), true/*declaredOnly*/);
static DelayedEvalBshMethod[] getDeclaredMethods(BSHBlock body, CallStack callstack, Interpreter interpreter, String defaultPackage, Class<?> superClass) throws EvalError { List<DelayedEvalBshMethod> methods = new ArrayList<>(); if ( callstack.top().getName().indexOf("$anon") > -1 ) { // anonymous classes need super constructor String classBaseName = Types.getBaseName(callstack.top().getName()); Invocable con = BshClassManager.memberCache.get(superClass) .findMethod(superClass.getName(), This.CONTEXT_ARGS.get().get(classBaseName)); DelayedEvalBshMethod bm = new DelayedEvalBshMethod(classBaseName, con, callstack.top()); methods.add(bm); } for (int child = 0; child < body.jjtGetNumChildren(); child++) { SimpleNode node = (SimpleNode) body.jjtGetChild(child); if (node instanceof BSHMethodDeclaration) { BSHMethodDeclaration md = (BSHMethodDeclaration) node; md.insureNodesParsed(); Modifiers modifiers = md.modifiers; String name = md.name; String returnType = md.getReturnTypeDescriptor(callstack, interpreter, defaultPackage); BSHReturnType returnTypeNode = md.getReturnTypeNode(); BSHFormalParameters paramTypesNode = md.paramsNode; String[] paramTypes = paramTypesNode.getTypeDescriptors(callstack, interpreter, defaultPackage); DelayedEvalBshMethod bm = new DelayedEvalBshMethod(name, returnType, returnTypeNode, md.paramsNode.getParamNames(), paramTypes, paramTypesNode, md.blockNode, null/*declaringNameSpace*/, modifiers, callstack, interpreter); methods.add(bm); } } return methods.toArray(new DelayedEvalBshMethod[methods.size()]); }