优化代码

dev
ZhouXY108 2024-07-13 20:23:04 +08:00
parent b86bb6c15b
commit c7ed383382
1 changed files with 3 additions and 4 deletions

View File

@ -13,7 +13,6 @@ import java.util.Date;
import java.util.TimeZone; import java.util.TimeZone;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTimeZone;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
@ -104,7 +103,7 @@ public class DateTimeTools {
* @deprecated 使 {@link ZonedDateTime#toInstant()} * @deprecated 使 {@link ZonedDateTime#toInstant()}
*/ */
@Deprecated @Deprecated
public static Instant toInstant(ZonedDateTime zonedDateTime) { public static Instant toInstant(ZonedDateTime zonedDateTime) { // NOSONAR
return zonedDateTime.toInstant(); return zonedDateTime.toInstant();
} }
@ -177,7 +176,7 @@ public class DateTimeTools {
* @deprecated 使 {@link ZonedDateTime#of(LocalDateTime, ZoneId)} * @deprecated 使 {@link ZonedDateTime#of(LocalDateTime, ZoneId)}
*/ */
@Deprecated @Deprecated
public static ZonedDateTime toZonedDateTime(LocalDateTime localDateTime, ZoneId zone) { public static ZonedDateTime toZonedDateTime(LocalDateTime localDateTime, ZoneId zone) { // NOSONAR
return ZonedDateTime.of(localDateTime, zone); return ZonedDateTime.of(localDateTime, zone);
} }
@ -322,7 +321,7 @@ public class DateTimeTools {
return jodaZone.toTimeZone().toZoneId(); return jodaZone.toTimeZone().toZoneId();
} }
public static DateTimeZone toJodaTime(java.time.ZoneId zone) { public static org.joda.time.DateTimeZone toJodaTime(java.time.ZoneId zone) {
return org.joda.time.DateTimeZone.forID(zone.getId()); return org.joda.time.DateTimeZone.forID(zone.getId());
} }