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 13, 2023
1 parent 7214b7f commit d4bd84b
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 d4bd84b

Please sign in to comment.