public StaticImportNode(char[] expr) { try { declaringClass = Class.forName(new String(subset(expr, 0, findLast('.', this.name = expr))), true, currentThread().getContextClassLoader()); methodName = new String(subset(expr, findLast('.', expr) + 1)); if (resolveMethod() == null) { throw new CompileException("can not find method for static import: " + declaringClass.getName() + "." + methodName); } } catch (Exception e) { throw new CompileException("unable to import class", e); } }
public StaticImportNode(char[] expr, int start, int offset, ParserContext pCtx) { super(pCtx); try { this.expr = expr; this.start = start; this.offset = offset; int mark; ClassLoader classLoader = getClassLoader(); declaringClass = Class.forName(new String(expr, start, (mark = findLast('.', start, offset, this.expr = expr)) - start), true, classLoader ); methodName = new String(expr, ++mark, offset - (mark - start)); if (resolveMethod() == null) { throw new CompileException("can not find method for static import: " + declaringClass.getName() + "." + methodName, expr, start); } } catch (Exception e) { throw new CompileException("unable to import class", expr, start, e); } }
public StaticImportNode(char[] expr, int start, int offset, ParserContext pCtx) { super(pCtx); try { this.expr = expr; this.start = start; this.offset = offset; int mark; ClassLoader classLoader = getClassLoader(); declaringClass = Class.forName(new String(expr, start, (mark = findLast('.', start, offset, this.expr = expr)) - start), true, classLoader ); methodName = new String(expr, ++mark, offset - (mark - start)); if (resolveMethod() == null) { throw new CompileException("can not find method for static import: " + declaringClass.getName() + "." + methodName, expr, start); } } catch (Exception e) { throw new CompileException("unable to import class", expr, start, e); } }