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

Method getArgumentTypes

src/jvm/clojure/asm/Type.java:275–313  ·  view source on GitHub ↗

Returns the Type values corresponding to the argument types of the given method descriptor. @param methodDescriptor a method descriptor. @return the Type values corresponding to the argument types of the given method descriptor.

(final String methodDescriptor)

Source from the content-addressed store, hash-verified

273 * descriptor.
274 */
275 public static Type[] getArgumentTypes(final String methodDescriptor) {
276 // First step: compute the number of argument types in methodDescriptor.
277 int numArgumentTypes = 0;
278 // Skip the first character, which is always a '('.
279 int currentOffset = 1;
280 // Parse the argument types, one at a each loop iteration.
281 while (methodDescriptor.charAt(currentOffset) != ')') {
282 while (methodDescriptor.charAt(currentOffset) == '[') {
283 currentOffset++;
284 }
285 if (methodDescriptor.charAt(currentOffset++) == 'L') {
286 while (methodDescriptor.charAt(currentOffset++) != ';') {
287 // Skip the argument descriptor content.
288 }
289 }
290 ++numArgumentTypes;
291 }
292
293 // Second step: create a Type instance for each argument type.
294 Type[] argumentTypes = new Type[numArgumentTypes];
295 // Skip the first character, which is always a '('.
296 currentOffset = 1;
297 // Parse and create the argument types, one at each loop iteration.
298 int currentArgumentTypeIndex = 0;
299 while (methodDescriptor.charAt(currentOffset) != ')') {
300 final int currentArgumentTypeOffset = currentOffset;
301 while (methodDescriptor.charAt(currentOffset) == '[') {
302 currentOffset++;
303 }
304 if (methodDescriptor.charAt(currentOffset++) == 'L') {
305 while (methodDescriptor.charAt(currentOffset++) != ';') {
306 // Skip the argument descriptor content.
307 }
308 }
309 argumentTypes[currentArgumentTypeIndex++] =
310 getType(methodDescriptor, currentArgumentTypeOffset, currentOffset);
311 }
312 return argumentTypes;
313 }
314
315 /**
316 * Returns the {@link Type} values corresponding to the argument types of the given method.

Callers 10

emitUnboxedMethod · 0.95
emitMethod · 0.95
emitUnboxedMethod · 0.95
emitMethod · 0.95
emitProtoMethod · 0.95
getArgumentTypesMethod · 0.95
GeneratorAdapterMethod · 0.95
LocalVariablesSorterMethod · 0.95

Calls 2

getTypeMethod · 0.95
getDescriptorMethod · 0.95

Tested by

no test coverage detected