1
2
3
4
5
6 package mockit.asm.types;
7
8 import edu.umd.cs.findbugs.annotations.NonNull;
9
10 import org.checkerframework.checker.index.qual.NonNegative;
11
12 public final class ObjectType extends ReferenceType {
13 @NonNull
14 public static ObjectType create(@NonNull String internalName) {
15 return new ObjectType(internalName.toCharArray());
16 }
17
18
19
20
21
22
23
24
25
26 @NonNull
27 static ObjectType create(@NonNull char[] typeDesc, @NonNegative int off) {
28 int len = findTypeNameLength(typeDesc, off, 0);
29 return new ObjectType(typeDesc, off + 1, len - 1);
30 }
31
32 private ObjectType(@NonNull char[] typeDesc, @NonNegative int off, @NonNegative int len) {
33 super(typeDesc, off, len);
34 }
35
36 ObjectType(@NonNull char[] internalName) {
37 super(internalName);
38 }
39
40 @Override
41 void getDescriptor(@NonNull StringBuilder typeDesc) {
42 typeDesc.append('L');
43 super.getDescriptor(typeDesc);
44 typeDesc.append(';');
45 }
46
47 @NonNull
48 @Override
49 public String getClassName() {
50 return getInternalName().replace('/', '.');
51 }
52 }