Skip to content

Commit

Permalink
fix: rewrite deprecated calls (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
sverrehu committed Oct 20, 2023
1 parent 9a48a30 commit 4543184
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions utils/src/main/java/no/shhsoft/utils/OptionParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ private static Object convert(final String s, final Class<?> type) {
}
try {
if (type == Byte.TYPE || type == Byte.class) {
return new Byte(s);
return Byte.valueOf(s);
}
if (type == Short.TYPE || type == Short.class) {
return new Short(s);
return Short.valueOf(s);
}
if (type == Integer.TYPE || type == Integer.class) {
return new Integer(s);
return Integer.valueOf(s);
}
if (type == Long.TYPE || type == Long.class) {
return new Long(s);
return Long.valueOf(s);
}
if (type == Float.TYPE || type == Float.class) {
return new Float(s);
return Float.valueOf(s);
}
if (type == Double.TYPE || type == Double.class) {
return new Double(s);
return Double.valueOf(s);
}
if (type == Boolean.TYPE || type == Boolean.class) {
if ("1".equals(s) || "t".equalsIgnoreCase(s) || "true".equalsIgnoreCase(s)
Expand Down

0 comments on commit 4543184

Please sign in to comment.