You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2019/10/24 11:42:36 UTC

[GitHub] [commons-beanutils] melloware commented on a change in pull request #14: [BEANUTILS-515] Java8 Time converters

melloware commented on a change in pull request #14: [BEANUTILS-515] Java8 Time converters
URL: https://github.com/apache/commons-beanutils/pull/14#discussion_r338525475
 
 

 ##########
 File path: src/main/java/org/apache/commons/beanutils2/ConvertUtilsBean.java
 ##########
 @@ -460,23 +499,49 @@ private void registerStandard(final boolean throwException, final boolean defaul
      *     <li><code>URL.class</code> - {@link URLConverter}</li>
      *     <li><code>URI.class</code> - {@link URIConverter}</li>
      *     <li><code>UUID.class</code> - {@link UUIDConverter}</li>
+     *     <li><code>LocalDate.class</code> - {@link LocalDateConverter}</li>
+     *     <li><code>LocalDateTime.class</code> - {@link LocalDateTimeConverter}</li>
+     *     <li><code>LocalTime.class</code> - {@link LocalTimeConverter}</li>
+     *     <li><code>OffsetDateTime.class</code> - {@link OffsetDateTimeConverter}</li>
+     *     <li><code>OffsetTime.class</code> - {@link OffsetTimeConverter}</li>
+     *     <li><code>ZonedDateTime.class</code> - {@link ZonedDateTimeConverter}</li>
+     *     <li><code>Duration.class</code> - {@link DurationConverter}</li>
+     *     <li><code>MonthDay.class</code> - {@link MonthDayConverter}</li>
+     *     <li><code>Period.class</code> - {@link PeriodConverter}</li>
+     *     <li><code>Year.class</code> - {@link YearConverter}</li>
+     *     <li><code>YearMonth.class</code> - {@link YearMonthConverter}</li>
+     *     <li><code>ZoneId.class</code> - {@link ZoneIdConverter}</li>
+     *     <li><code>ZoneOffset.class</code> - {@link ZoneOffsetConverter}</li>
      * </ul>
      * @param throwException <code>true</code> if the converters should
      * throw an exception when a conversion error occurs, otherwise <code>
      * <code>false</code> if a default value should be used.
      */
     private void registerOther(final boolean throwException) {
-        register(Class.class,         throwException ? new ClassConverter()        : new ClassConverter(null));
-        register(java.util.Date.class, throwException ? new DateConverter()        : new DateConverter(null));
-        register(Calendar.class,      throwException ? new CalendarConverter()     : new CalendarConverter(null));
-        register(File.class,          throwException ? new FileConverter()         : new FileConverter(null));
-        register(Path.class,          throwException ? new PathConverter()         : new PathConverter(null));
-        register(java.sql.Date.class, throwException ? new SqlDateConverter()      : new SqlDateConverter(null));
-        register(java.sql.Time.class, throwException ? new SqlTimeConverter()      : new SqlTimeConverter(null));
-        register(Timestamp.class,     throwException ? new SqlTimestampConverter() : new SqlTimestampConverter(null));
-        register(URL.class,           throwException ? new URLConverter()          : new URLConverter(null));
-        register(URI.class,           throwException ? new URIConverter()          : new URIConverter(null));
-        register(UUID.class,          throwException ? new UUIDConverter()         : new UUIDConverter(null));
+        register(Class.class,         throwException ? new ClassConverter()          : new ClassConverter(null));
+        register(java.util.Date.class, throwException ? new DateConverter()          : new DateConverter(null));
 
 Review comment:
   Fixed the spacing of ConvertUtilsBean and added @formatter:on/off

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services