public static int widenSubword(Object x){
  if (x instanceof Integer)   return (int)x;
 else   if (x instanceof Boolean)   return fromBoolean((boolean)x);
 else   if (x instanceof Character)   return (char)x;
 else   if (x instanceof Short)   return (short)x;
 else   if (x instanceof Byte)   return (byte)x;
 else   return (int)x;
}

public static int widenSubword ( Object x ) { if ( x instanceof Integer ) return ( int ) x ; else if ( x instanceof Boolean ) return fromBoolean ( ( boolean ) x ) ; else if ( x instanceof Character ) return ( char ) x ; else if ( x instanceof Short ) return ( short ) x ; else if ( x instanceof Byte ) return ( byte ) x ; else return ( int ) x ; }
the jvm verifier allows boolean , byte , short , or char to widen to int . support exactly this conversion , from a boxed value type boolean , byte , short , character , or integer .
