Skip to content

Commit

Permalink
Do not use BigDecimal.new to construct
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Oct 9, 2023
1 parent 8743a0b commit 02099a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion java/src/json/ext/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ IRubyObject createCustomDecimal(int p, int new_p) {
Ruby runtime = getRuntime();
ByteList num = absSubSequence(p, new_p);
IRubyObject numString = runtime.newString(num.toString());
return parser.decimalClass.callMethod(context, "new", numString);
return runtime.getKernel().callMethod(context, "BigDecimal", numString);
}


Expand Down
2 changes: 1 addition & 1 deletion java/src/json/ext/Parser.rl
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ public class Parser extends RubyObject {
Ruby runtime = getRuntime();
ByteList num = absSubSequence(p, new_p);
IRubyObject numString = runtime.newString(num.toString());
return parser.decimalClass.callMethod(context, "new", numString);
return runtime.getKernel().callMethod(context, "BigDecimal", numString);
}

%%{
Expand Down

0 comments on commit 02099a8

Please sign in to comment.