mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
原先的写法在运行时没有错,但是在读代码的时候,会发现按住ctrl点击`format(((Long) obj))`时,仍会定位到 `String format(final Object obj)`上,给人一种可能会栈溢出的错觉。 @see https://github.com/apache/commons-lang/blob/master/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
This commit is contained in:
@@ -299,7 +299,7 @@ public class FastDatePrinter extends AbstractDateBasic implements DatePrinter {
|
||||
} else if (obj instanceof Calendar) {
|
||||
return format((Calendar) obj);
|
||||
} else if (obj instanceof Long) {
|
||||
return format(((Long) obj));
|
||||
return format(((Long) obj).longValue());
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown class: " + (obj == null ? "<null>" : obj.getClass().getName()));
|
||||
}
|
||||
|
Reference in New Issue
Block a user