@Override Type copyType(AnnotationInstance[] newAnnotations) { return new ArrayType(component, dimensions, newAnnotations); }
/** * Create a new mock array type instance with the specified component * and dimensions. * * @param component the array component * @param dimensions the number of dimensions of this array * @return the new mock array type instance * @since 2.1 */ public static ArrayType create(Type component, int dimensions) { return new ArrayType(component, dimensions); }
Type copyType(Type component, int dimensions) { return new ArrayType(component, dimensions, annotationArray()); } }
private Type parseArrayType() { int mark = this.pos; int last = advanceNot('['); return new ArrayType(parseJavaType(), last - mark); }
private Type parseType(String descriptor, IntegerHolder pos) { int start = pos.i; char c = descriptor.charAt(start); Type type = PrimitiveType.decode(c); if (type != null) { return type; } DotName name; switch (c) { case 'V': return VoidType.VOID; case 'L': { int end = start; while (descriptor.charAt(++end) != ';'); name = names.convertToName(descriptor.substring(start + 1, end), '/'); pos.i = end; return names.intern(new ClassType(name)); } case '[': { int end = start; while (descriptor.charAt(++end) == '['); int depth = end - start; pos.i = end; type = parseType(descriptor, pos); return names.intern(new ArrayType(type, depth)); } default: throw new IllegalArgumentException("Invalid descriptor: " + descriptor + " pos " + start); } }
Type nested = dimensions > 0 ? new ArrayType(arrayType.component(), dimensions) : arrayType.component(); nested = resolveTypePath(nested, typeAnnotationState);
Type component = typeTable[stream.readPackedU32()]; AnnotationInstance[] annotations = readAnnotations(stream, null); return new ArrayType(component, dimensions, annotations);