public static String literalToString(long lit,ArgType type){
  if (type == null || !type.isTypeKnown()) {
    String n=Long.toString(lit);
    if (Math.abs(lit) > 100) {
      n+="; // 0x" + Long.toHexString(lit) + " float:"+ Float.intBitsToFloat((int)lit)+ " double:"+ Double.longBitsToDouble(lit);
    }
    return n;
  }
switch (type.getPrimitiveType()) {
case BOOLEAN:
    return lit == 0 ? "false" : "true";
case CHAR:
  return StringUtils.unescapeChar((char)lit);
case BYTE:
return formatByte((byte)lit);
case SHORT:
return formatShort((short)lit);
case INT:
return formatInteger((int)lit);
case LONG:
return formatLong(lit);
case FLOAT:
return formatFloat(Float.intBitsToFloat((int)lit));
case DOUBLE:
return formatDouble(Double.longBitsToDouble(lit));
case OBJECT:
case ARRAY:
if (lit != 0) {
LOG.warn("Wrong object literal: {} for type: {}",lit,type);
return Long.toString(lit);
}
return "null";
default :
throw new JadxRuntimeException("Unknown type in literalToString: " + type);
}
}

public static String literalToString ( long lit , ArgType type ) { if ( type == null || ! type . isTypeKnown ( ) ) { String n = Long . toString ( lit ) ; if ( Math . abs ( lit ) > 100 ) { n += "; // 0x" + Long . toHexString ( lit ) + " float:" + Float . intBitsToFloat ( ( int ) lit ) + " double:" + Double . longBitsToDouble ( lit ) ; } return n ; } switch ( type . getPrimitiveType ( ) ) { case BOOLEAN : return lit == 0 ? "false" : "true" ; case CHAR : return StringUtils . unescapeChar ( ( char ) lit ) ; case BYTE : return formatByte ( ( byte ) lit ) ; case SHORT : return formatShort ( ( short ) lit ) ; case INT : return formatInteger ( ( int ) lit ) ; case LONG : return formatLong ( lit ) ; case FLOAT : return formatFloat ( Float . intBitsToFloat ( ( int ) lit ) ) ; case DOUBLE : return formatDouble ( Double . longBitsToDouble ( lit ) ) ; case OBJECT : case ARRAY : if ( lit != 0 ) { LOG . warn ( "Wrong object literal: {} for type: {}" , lit , type ) ; return Long . toString ( lit ) ; } return "null" ; default : throw new JadxRuntimeException ( "Unknown type in literalToString: " + type ) ; } }
convert literal value to string according to value type
