class org.jruby.util.SafeDecimalParser
minor version: 0
major version: 59
flags: flags: (0x0020) ACC_SUPER
this_class: org.jruby.util.SafeDecimalParser
super_class: java.lang.Object
{
protected static final java.math.BigDecimal TWO;
descriptor: Ljava/math/BigDecimal;
flags: (0x001c) ACC_PROTECTED, ACC_STATIC, ACC_FINAL
protected static final java.math.BigDecimal LOWER;
descriptor: Ljava/math/BigDecimal;
flags: (0x001c) ACC_PROTECTED, ACC_STATIC, ACC_FINAL
protected static final java.math.BigDecimal UPPER;
descriptor: Ljava/math/BigDecimal;
flags: (0x001c) ACC_PROTECTED, ACC_STATIC, ACC_FINAL
protected static final java.math.BigDecimal MIDDLE;
descriptor: Ljava/math/BigDecimal;
flags: (0x001c) ACC_PROTECTED, ACC_STATIC, ACC_FINAL
private static final java.lang.Double UPPER_DOUBLE;
descriptor: Ljava/lang/Double;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final java.lang.Double LOWER_DOUBLE;
descriptor: Ljava/lang/Double;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final java.lang.String SUSPICIOUS_DIGITS;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "22250738585072"
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=3, locals=0, args_size=0
0: new java.math.BigDecimal
dup
iconst_2
invokespecial java.math.BigDecimal.<init>:(I)V
putstatic org.jruby.util.SafeDecimalParser.TWO:Ljava/math/BigDecimal;
1: new java.math.BigDecimal
dup
ldc "2.22507385850720113605e-308"
invokespecial java.math.BigDecimal.<init>:(Ljava/lang/String;)V
putstatic org.jruby.util.SafeDecimalParser.LOWER:Ljava/math/BigDecimal;
2: new java.math.BigDecimal
dup
ldc "2.22507385850720125958e-308"
invokespecial java.math.BigDecimal.<init>:(Ljava/lang/String;)V
putstatic org.jruby.util.SafeDecimalParser.UPPER:Ljava/math/BigDecimal;
3: getstatic org.jruby.util.SafeDecimalParser.LOWER:Ljava/math/BigDecimal;
getstatic org.jruby.util.SafeDecimalParser.UPPER:Ljava/math/BigDecimal;
invokevirtual java.math.BigDecimal.add:(Ljava/math/BigDecimal;)Ljava/math/BigDecimal;
getstatic org.jruby.util.SafeDecimalParser.TWO:Ljava/math/BigDecimal;
invokevirtual java.math.BigDecimal.divide:(Ljava/math/BigDecimal;)Ljava/math/BigDecimal;
putstatic org.jruby.util.SafeDecimalParser.MIDDLE:Ljava/math/BigDecimal;
4: getstatic org.jruby.util.SafeDecimalParser.UPPER:Ljava/math/BigDecimal;
invokevirtual java.math.BigDecimal.doubleValue:()D
invokestatic java.lang.Double.valueOf:(D)Ljava/lang/Double;
putstatic org.jruby.util.SafeDecimalParser.UPPER_DOUBLE:Ljava/lang/Double;
5: getstatic org.jruby.util.SafeDecimalParser.LOWER:Ljava/math/BigDecimal;
invokevirtual java.math.BigDecimal.doubleValue:()D
invokestatic java.lang.Double.valueOf:(D)Ljava/lang/Double;
putstatic org.jruby.util.SafeDecimalParser.LOWER_DOUBLE:Ljava/lang/Double;
6: return
LocalVariableTable:
Start End Slot Name Signature
void <init>();
descriptor: ()V
flags: (0x0000)
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/jruby/util/SafeDecimalParser;
protected static final boolean isSuspicious(java.lang.String);
descriptor: (Ljava/lang/String;)Z
flags: (0x001c) ACC_PROTECTED, ACC_STATIC, ACC_FINAL
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
invokestatic org.jruby.util.SafeDecimalParser.digits:(Ljava/lang/String;)Ljava/lang/String;
ldc "22250738585072"
invokevirtual java.lang.String.indexOf:(Ljava/lang/String;)I
iflt 1
iconst_1
ireturn
StackMap locals:
StackMap stack:
1: iconst_0
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 s Ljava/lang/String;
MethodParameters:
Name Flags
s
protected static final java.lang.Double decimalValueOf(java.lang.String);
descriptor: (Ljava/lang/String;)Ljava/lang/Double;
flags: (0x001c) ACC_PROTECTED, ACC_STATIC, ACC_FINAL
Code:
stack=1, locals=2, args_size=1
start local 0 0: aconst_null
astore 1
start local 1 1: aload 0
ifnull 6
2: aload 0
invokestatic org.jruby.util.SafeDecimalParser.isSuspicious:(Ljava/lang/String;)Z
ifeq 5
3: aload 0
invokestatic org.jruby.util.SafeDecimalParser.parseSafely:(Ljava/lang/String;)Ljava/lang/Double;
astore 1
4: goto 6
5: StackMap locals: java.lang.Double
StackMap stack:
aload 0
invokestatic java.lang.Double.valueOf:(Ljava/lang/String;)Ljava/lang/Double;
astore 1
6: StackMap locals:
StackMap stack:
aload 1
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 s Ljava/lang/String;
1 7 1 result Ljava/lang/Double;
MethodParameters:
Name Flags
s
protected static final double decimalValue(java.lang.Number);
descriptor: (Ljava/lang/Number;)D
flags: (0x001c) ACC_PROTECTED, ACC_STATIC, ACC_FINAL
Code:
stack=2, locals=3, args_size=1
start local 0 0: dconst_0
dstore 1
start local 1 1: aload 0
ifnull 6
2: aload 0
instanceof java.math.BigDecimal
ifeq 5
3: aload 0
checkcast java.math.BigDecimal
invokestatic org.jruby.util.SafeDecimalParser.decimalValue:(Ljava/math/BigDecimal;)D
dstore 1
4: goto 6
5: StackMap locals: double
StackMap stack:
aload 0
invokevirtual java.lang.Number.doubleValue:()D
dstore 1
6: StackMap locals:
StackMap stack:
dload 1
dreturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 number Ljava/lang/Number;
1 7 1 result D
MethodParameters:
Name Flags
number
protected static final double decimalValue(java.math.BigDecimal);
descriptor: (Ljava/math/BigDecimal;)D
flags: (0x001c) ACC_PROTECTED, ACC_STATIC, ACC_FINAL
Code:
stack=2, locals=3, args_size=1
start local 0 0: dconst_0
dstore 1
start local 1 1: aload 0
ifnull 6
2: aload 0
invokestatic org.jruby.util.SafeDecimalParser.isDangerous:(Ljava/math/BigDecimal;)Z
ifeq 5
3: aload 0
invokevirtual java.math.BigDecimal.toString:()Ljava/lang/String;
invokestatic org.jruby.util.SafeDecimalParser.decimalValueOf:(Ljava/lang/String;)Ljava/lang/Double;
invokevirtual java.lang.Double.doubleValue:()D
dstore 1
4: goto 6
5: StackMap locals: double
StackMap stack:
aload 0
invokevirtual java.math.BigDecimal.doubleValue:()D
dstore 1
6: StackMap locals:
StackMap stack:
dload 1
dreturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 bigDecimal Ljava/math/BigDecimal;
1 7 1 result D
MethodParameters:
Name Flags
bigDecimal
private static final java.lang.Double parseSafely(java.lang.String);
descriptor: (Ljava/lang/String;)Ljava/lang/Double;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
Code:
stack=3, locals=3, args_size=1
start local 0 0: new java.math.BigDecimal
dup
aload 0
invokespecial java.math.BigDecimal.<init>:(Ljava/lang/String;)V
astore 2
start local 2 1: aload 2
invokestatic org.jruby.util.SafeDecimalParser.isDangerous:(Ljava/math/BigDecimal;)Z
ifeq 7
2: aload 2
getstatic org.jruby.util.SafeDecimalParser.MIDDLE:Ljava/math/BigDecimal;
invokevirtual java.math.BigDecimal.compareTo:(Ljava/math/BigDecimal;)I
iflt 5
3: getstatic org.jruby.util.SafeDecimalParser.UPPER_DOUBLE:Ljava/lang/Double;
astore 1
start local 1 4: goto 8
end local 1 5: StackMap locals: java.lang.String top java.math.BigDecimal
StackMap stack:
getstatic org.jruby.util.SafeDecimalParser.LOWER_DOUBLE:Ljava/lang/Double;
astore 1
start local 1 6: goto 8
end local 1 7: StackMap locals:
StackMap stack:
aload 0
invokestatic java.lang.Double.valueOf:(Ljava/lang/String;)Ljava/lang/Double;
astore 1
start local 1 8: StackMap locals: java.lang.String java.lang.Double java.math.BigDecimal
StackMap stack:
aload 1
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 s Ljava/lang/String;
4 5 1 result Ljava/lang/Double;
6 7 1 result Ljava/lang/Double;
8 9 1 result Ljava/lang/Double;
1 9 2 bd Ljava/math/BigDecimal;
MethodParameters:
Name Flags
s
private static final java.lang.String digits(java.lang.String);
descriptor: (Ljava/lang/String;)Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
Code:
stack=3, locals=6, args_size=1
start local 0 0: aload 0
invokevirtual java.lang.String.toCharArray:()[C
astore 1
start local 1 1: aload 1
arraylength
istore 2
start local 2 2: new java.lang.StringBuilder
dup
iload 2
invokespecial java.lang.StringBuilder.<init>:(I)V
astore 3
start local 3 3: iconst_0
istore 4
start local 4 4: goto 9
5: StackMap locals: java.lang.String char[] int java.lang.StringBuilder int
StackMap stack:
aload 1
iload 4
caload
istore 5
start local 5 6: iload 5
bipush 48
if_icmplt 8
iload 5
bipush 57
if_icmpgt 8
7: aload 3
iload 5
invokevirtual java.lang.StringBuilder.append:(C)Ljava/lang/StringBuilder;
pop
end local 5 8: StackMap locals:
StackMap stack:
iinc 4 1
StackMap locals:
StackMap stack:
9: iload 4
iload 2
if_icmplt 5
end local 4 10: aload 3
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 11 0 s Ljava/lang/String;
1 11 1 ca [C
2 11 2 len I
3 11 3 b Ljava/lang/StringBuilder;
4 10 4 i I
6 8 5 c C
MethodParameters:
Name Flags
s
private static final boolean isDangerous(java.math.BigDecimal);
descriptor: (Ljava/math/BigDecimal;)Z
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getstatic org.jruby.util.SafeDecimalParser.UPPER:Ljava/math/BigDecimal;
invokevirtual java.math.BigDecimal.compareTo:(Ljava/math/BigDecimal;)I
ifge 1
aload 0
getstatic org.jruby.util.SafeDecimalParser.LOWER:Ljava/math/BigDecimal;
invokevirtual java.math.BigDecimal.compareTo:(Ljava/math/BigDecimal;)I
ifle 1
iconst_1
ireturn
StackMap locals:
StackMap stack:
1: iconst_0
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 bd Ljava/math/BigDecimal;
MethodParameters:
Name Flags
bd
}
SourceFile: "SafeDecimalParser.java"