28
28
import org .jboss .jandex .JandexReflection ;
29
29
import org .jboss .jandex .MethodInfo ;
30
30
import org .jboss .jandex .PrimitiveType ;
31
+ import org .jboss .jandex .PrimitiveType .Primitive ;
31
32
import org .jboss .jandex .Type ;
32
33
import org .jboss .jandex .TypeVariable ;
33
34
import org .jboss .logging .Logger ;
@@ -405,7 +406,7 @@ private static void assignWithUnboxingAndWideningConversion(BytecodeCreator byte
405
406
bytecode = ifNotInstanceOf .trueBranch ();
406
407
}
407
408
// widening conversions
408
- for (ClassType possibleSourceType : WIDENING_CONVERSIONS_TO .get (targetType )) {
409
+ for (ClassType possibleSourceType : WIDENING_CONVERSIONS_TO .get (targetType . primitive () )) {
409
410
ResultHandle isInstance = bytecode .instanceOf (value , possibleSourceType .name ().toString ());
410
411
BranchResult ifNotInstanceOf = bytecode .ifFalse (isInstance );
411
412
BytecodeCreator unbox = ifNotInstanceOf .falseBranch ();
@@ -431,18 +432,18 @@ private static void assignWithUnboxingAndWideningConversion(BytecodeCreator byte
431
432
bytecode .throwException (exception );
432
433
}
433
434
434
- private static final Map <PrimitiveType , Set <ClassType >> WIDENING_CONVERSIONS_TO = Map .of (
435
- PrimitiveType .BOOLEAN , Set .of (),
436
- PrimitiveType .BYTE , Set .of (),
437
- PrimitiveType .SHORT , Set .of (ClassType .BYTE_CLASS ),
438
- PrimitiveType .INT , Set .of (ClassType .BYTE_CLASS , ClassType .SHORT_CLASS , ClassType .CHARACTER_CLASS ),
439
- PrimitiveType .LONG , Set .of (ClassType .BYTE_CLASS , ClassType .SHORT_CLASS , ClassType .INTEGER_CLASS ,
435
+ private static final Map <Primitive , Set <ClassType >> WIDENING_CONVERSIONS_TO = Map .of (
436
+ Primitive .BOOLEAN , Set .of (),
437
+ Primitive .BYTE , Set .of (),
438
+ Primitive .SHORT , Set .of (ClassType .BYTE_CLASS ),
439
+ Primitive .INT , Set .of (ClassType .BYTE_CLASS , ClassType .SHORT_CLASS , ClassType .CHARACTER_CLASS ),
440
+ Primitive .LONG , Set .of (ClassType .BYTE_CLASS , ClassType .SHORT_CLASS , ClassType .INTEGER_CLASS ,
440
441
ClassType .CHARACTER_CLASS ),
441
- PrimitiveType .FLOAT , Set .of (ClassType .BYTE_CLASS , ClassType .SHORT_CLASS , ClassType .INTEGER_CLASS ,
442
+ Primitive .FLOAT , Set .of (ClassType .BYTE_CLASS , ClassType .SHORT_CLASS , ClassType .INTEGER_CLASS ,
442
443
ClassType .LONG_CLASS , ClassType .CHARACTER_CLASS ),
443
- PrimitiveType .DOUBLE , Set .of (ClassType .BYTE_CLASS , ClassType .SHORT_CLASS , ClassType .INTEGER_CLASS ,
444
+ Primitive .DOUBLE , Set .of (ClassType .BYTE_CLASS , ClassType .SHORT_CLASS , ClassType .INTEGER_CLASS ,
444
445
ClassType .LONG_CLASS , ClassType .FLOAT_CLASS , ClassType .CHARACTER_CLASS ),
445
- PrimitiveType .CHAR , Set .of ());
446
+ Primitive .CHAR , Set .of ());
446
447
447
448
static class FinisherGenerator {
448
449
private final MethodCreator method ;
0 commit comments