예제 #1
0
 @NotNull
 private static String explicitConvertIfNeeded(
     @NotNull final Type type, @NotNull final Expression i) {
   Set<String> doubleOrFloatTypes =
       new HashSet<String>(
           Arrays.asList("double", "float", "java.lang.double", "java.lang.float"));
   String afterReplace = innerTypeStr(type).replace(">", "").replace("<", "").replace("?", "");
   if (doubleOrFloatTypes.contains(afterReplace)) {
     if (i.getKind() == Kind.LITERAL) {
       if (i.toKotlin().contains(".")) {
         return i.toKotlin();
       }
       return i.toKotlin() + DOT + ZERO;
     }
     return "(" + i.toKotlin() + ")" + getConversion(afterReplace);
   }
   return i.toKotlin();
 }