Ejemplo n.º 1
0
 public static Value createValue(VirtualMachineProxyImpl vm, String expectedType, double value) {
   if (PsiType.DOUBLE.getPresentableText().equals(expectedType)) {
     return vm.mirrorOf(value);
   }
   if (PsiType.FLOAT.getPresentableText().equals(expectedType)) {
     return vm.mirrorOf((float) value);
   }
   return createValue(vm, expectedType, (long) value);
 }
Ejemplo n.º 2
0
 public static Value createValue(VirtualMachineProxyImpl vm, String expectedType, long value) {
   if (PsiType.LONG.getPresentableText().equals(expectedType)) {
     return vm.mirrorOf(value);
   }
   if (PsiType.INT.getPresentableText().equals(expectedType)) {
     return vm.mirrorOf((int) value);
   }
   if (PsiType.SHORT.getPresentableText().equals(expectedType)) {
     return vm.mirrorOf((short) value);
   }
   if (PsiType.BYTE.getPresentableText().equals(expectedType)) {
     return vm.mirrorOf((byte) value);
   }
   if (PsiType.CHAR.getPresentableText().equals(expectedType)) {
     return vm.mirrorOf((char) value);
   }
   if (PsiType.DOUBLE.getPresentableText().equals(expectedType)) {
     return vm.mirrorOf((double) value);
   }
   if (PsiType.FLOAT.getPresentableText().equals(expectedType)) {
     return vm.mirrorOf((float) value);
   }
   return null;
 }