32
32
import java .lang .constant .ConstantDescs ;
33
33
34
34
public enum Wrapper {
35
- // wrapperType simple primitiveType simple char emptyArray format numericClass superClass
35
+ // wrapperType simple primitiveType simple char emptyArray format numericClass superClass classDescriptor
36
36
BOOLEAN ( Boolean .class , "Boolean" , boolean .class , "boolean" , 'Z' , new boolean [0 ], Format .unsigned ( 1 ), 0 , 0 , ConstantDescs .CD_boolean ),
37
37
// These must be in the order defined for widening primitive conversions in JLS 5.1.2
38
38
// Avoid boxing integral types here to defer initialization of internal caches
@@ -60,9 +60,18 @@ public enum Wrapper {
60
60
private final int superClasses ;
61
61
private final String wrapperSimpleName ;
62
62
private final String primitiveSimpleName ;
63
- private final ClassDesc primitiveTypeDesc ;
64
-
65
- private Wrapper (Class <?> wtype , String wtypeName , Class <?> ptype , String ptypeName , char tchar , Object emptyArray , int format , int numericClass , int superClasses , ClassDesc primitiveTypeDesc ) {
63
+ private final ClassDesc classDesc ;
64
+
65
+ private Wrapper (Class <?> wtype ,
66
+ String wtypeName ,
67
+ Class <?> ptype ,
68
+ String ptypeName ,
69
+ char tchar ,
70
+ Object emptyArray ,
71
+ int format ,
72
+ int numericClass ,
73
+ int superClasses ,
74
+ ClassDesc classDesc ) {
66
75
this .wrapperType = wtype ;
67
76
this .primitiveType = ptype ;
68
77
this .basicTypeChar = tchar ;
@@ -73,7 +82,7 @@ private Wrapper(Class<?> wtype, String wtypeName, Class<?> ptype, String ptypeNa
73
82
this .superClasses = superClasses ;
74
83
this .wrapperSimpleName = wtypeName ;
75
84
this .primitiveSimpleName = ptypeName ;
76
- this .primitiveTypeDesc = primitiveTypeDesc ;
85
+ this .classDesc = classDesc ;
77
86
}
78
87
79
88
/** For debugging, give the details of this wrapper. */
@@ -380,8 +389,8 @@ public static Wrapper forBasicType(Class<?> type) {
380
389
}
381
390
}
382
391
383
- /** A nominal descriptor of the primitive type */
384
- public ClassDesc primitiveClassDescriptor () { return primitiveTypeDesc ; }
392
+ /** A nominal descriptor of the wrapped type */
393
+ public ClassDesc classDescriptor () { return classDesc ; }
385
394
386
395
/** What is the primitive type wrapped by this wrapper? */
387
396
public Class <?> primitiveType () { return primitiveType ; }
0 commit comments