You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2019/10/22 21:01:12 UTC
[commons-beanutils] 02/03: Use final.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-beanutils.git
commit 0d02186d76f6e7a49b24eec57c1f7ec36570449f
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Oct 22 16:58:20 2019 -0400
Use final.
---
.../apache/commons/beanutils2/converters/DateTimeConverter.java | 8 ++++----
.../commons/beanutils2/converters/PathConverterTestCase.java | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/commons/beanutils2/converters/DateTimeConverter.java b/src/main/java/org/apache/commons/beanutils2/converters/DateTimeConverter.java
index a3e362c..9b2e1cf 100644
--- a/src/main/java/org/apache/commons/beanutils2/converters/DateTimeConverter.java
+++ b/src/main/java/org/apache/commons/beanutils2/converters/DateTimeConverter.java
@@ -442,25 +442,25 @@ public abstract class DateTimeConverter extends AbstractConverter {
// java.time.LocalDateTime
if (type.equals(LocalDate.class)) {
- LocalDate localDate = Instant.ofEpochMilli(value).atZone(getZoneId()).toLocalDate();
+ final LocalDate localDate = Instant.ofEpochMilli(value).atZone(getZoneId()).toLocalDate();
return type.cast(localDate);
}
// java.time.LocalDateTime
if (type.equals(LocalDateTime.class)) {
- LocalDateTime localDateTime = Instant.ofEpochMilli(value).atZone(getZoneId()).toLocalDateTime();
+ final LocalDateTime localDateTime = Instant.ofEpochMilli(value).atZone(getZoneId()).toLocalDateTime();
return type.cast(localDateTime);
}
// java.time.ZonedDateTime
if (type.equals(ZonedDateTime.class)) {
- ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(value), getZoneId());
+ final ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(value), getZoneId());
return type.cast(zonedDateTime);
}
// java.time.OffsetDateTime
if (type.equals(OffsetDateTime.class)) {
- OffsetDateTime offsetDateTime = OffsetDateTime.ofInstant(Instant.ofEpochMilli(value), getZoneId());
+ final OffsetDateTime offsetDateTime = OffsetDateTime.ofInstant(Instant.ofEpochMilli(value), getZoneId());
return type.cast(offsetDateTime);
}
diff --git a/src/test/java/org/apache/commons/beanutils2/converters/PathConverterTestCase.java b/src/test/java/org/apache/commons/beanutils2/converters/PathConverterTestCase.java
index adb8dd9..c169381 100644
--- a/src/test/java/org/apache/commons/beanutils2/converters/PathConverterTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/converters/PathConverterTestCase.java
@@ -85,7 +85,7 @@ public class PathConverterTestCase extends TestCase {
};
// get the separator so test works on Windows or *nix
- String separator = File.pathSeparator;
+ final String separator = File.pathSeparator;
final Object[] input = {
separator + "foo"+separator+"bar"+separator+"baz",