Skip to content

Commit

Permalink
[refactor] handle deprecations of Double/Float()
Browse files Browse the repository at this point in the history
  • Loading branch information
kares committed Sep 21, 2023
1 parent b72b5fb commit 632b1f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/javasupport/JavaUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ public static IRubyObject primitive_to_java(IRubyObject recv, IRubyObject object
}
break;
case FLOAT:
javaObject = new Double(((RubyFloat) object).getValue());
javaObject = Double.valueOf(((RubyFloat) object).getValue());
break;
case STRING:
ByteList bytes = ((RubyString) object).getByteList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ public Object defaultResult() {
if (returnType == Short.TYPE) return Short.valueOf((short) 0);
if (returnType == Integer.TYPE) return Integer.valueOf(0);
if (returnType == Long.TYPE) return Long.valueOf(0L);
if (returnType == Float.TYPE) return new Float(0.0f);
if (returnType == Double.TYPE) return new Double(0.0);
if (returnType == Float.TYPE) return Float.valueOf(0.0f);
if (returnType == Double.TYPE) return Double.valueOf(0.0);

return null;
}
Expand Down

0 comments on commit 632b1f7

Please sign in to comment.