public TypeMirror unaryNumericPromotion ( TypeMirror type ) { TypeKind t = type . getKind ( ) ; if ( t == TypeKind . DECLARED ) { type = javacTypes . unboxedType ( type ) ; t = type . getKind ( ) ; } if ( t == TypeKind . BYTE || t == TypeKind . SHORT || t == TypeKind . CHAR ) { return getInt ( ) ; } else { return type ; } }
If type is a byte TypeMirror short TypeMirror or char TypeMirror an int TypeMirror is returned . Otherwise type is returned . See jls - 5 . 6 . 1 .