MCPcopy Index your code
hub / github.com/clojure/clojure / StaticMethodExpr

Class StaticMethodExpr

src/jvm/clojure/lang/Compiler.java:2127–2367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2125
2126
2127static class StaticMethodExpr extends MethodExpr{
2128 //final String className;
2129 public final Class c;
2130 public final String methodName;
2131 public final IPersistentVector args;
2132 public final String source;
2133 public final int line;
2134 public final int column;
2135 public final java.lang.reflect.Method method;
2136 public final Symbol tag;
2137 public final boolean tailPosition;
2138 final static Method forNameMethod = Method.getMethod("Class classForName(String)");
2139 final static Method invokeStaticMethodMethod =
2140 Method.getMethod("Object invokeStaticMethod(Class,String,Object[])");
2141 final static Keyword warnOnBoxedKeyword = Keyword.intern("warn-on-boxed");
2142 Class jc;
2143
2144 public StaticMethodExpr(String source, int line, int column, Symbol tag, Class c,
2145 String methodName, java.lang.reflect.Method preferredMethod, IPersistentVector args, boolean tailPosition)
2146 {
2147 checkMethodArity(preferredMethod, RT.count(args));
2148
2149 this.c = c;
2150 this.methodName = methodName;
2151 this.args = args;
2152 this.source = source;
2153 this.line = line;
2154 this.column = column;
2155 this.tag = tag;
2156 this.tailPosition = tailPosition;
2157 this.method = preferredMethod;
2158
2159 if(method != null && warnOnBoxedKeyword.equals(RT.UNCHECKED_MATH.deref()) && isBoxedMath(method))
2160 {
2161 RT.errPrintWriter()
2162 .format("Boxed math warning, %s:%d:%d - call: %s.\n",
2163 SOURCE_PATH.deref(), line, column, method.toString());
2164 }
2165 }
2166
2167 public StaticMethodExpr(String source, int line, int column, Symbol tag, Class c,
2168 String methodName, IPersistentVector args, boolean tailPosition)
2169 {
2170 this.c = c;
2171 this.methodName = methodName;
2172 this.args = args;
2173 this.source = source;
2174 this.line = line;
2175 this.column = column;
2176 this.tag = tag;
2177 this.tailPosition = tailPosition;
2178
2179 List methods = Reflector.getMethods(c, args.count(), methodName, true);
2180 if(methods.isEmpty())
2181 throw new IllegalArgumentException("No matching method " + methodName + " found taking "
2182 + args.count() + " args for " + c);
2183
2184 int methodidx = 0;

Callers

nothing calls this directly

Calls 2

getMethodMethod · 0.95
internMethod · 0.95

Tested by

no test coverage detected