commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Szlapa" <>
Subject [PATCH][Beanutils] LocaleConvertUtils
Date Sat, 15 Feb 2003 02:26:32 GMT

Just started using LocaleConvertUtils and I must say it is great to have the
converter utils that allow fine tuning of conversion patterns. However I
have found that although individual converters usually work,
LocaleConvertUtils has probably never worked (there is an error during
initialization of static member). Given then fact that the rest of bean
utils is very high quality, IMHO it should not have not been included yet in
the official release version of the Beanutils (1.5/1.6).

Anyway, I have tried my best to fix the problems, and included patch in the
CVS and humane formats. I do not have previous experience in the J-Commons
development but hopefully the patch is useful. Here is the list of changes:

- Create LocaleConvertUtilsTestCase class trying to make it as close as
possible to original ConvertUtilsTestCase

- Where functionality LocaleConvertUtils does not match yet ConvertUtils, I
have left not working test in place by either commenting then or renaming
test methods. Hopefully this will allow  to identify the remaining gaps in
functionality of between both Locale Converters and traditional converters.

- Converters now handle the null patterns more gracefully. As converters
default pattern to null in  constructors, it makes sense to handle it,
rather then throw NullPntrExc.

- Improved parse method for Number related converters so they return
instance of the proper type (Integer, Byte, etc.). this was mainly to pass
the test case.

- Made default format patterns of java.sql.Date, Time, and Timestamp classes
consistent with default behaviour of the valueOf / toString methods.

- I have changed the build file by removing converter specific tests and
adding LocaleConvertUtils test, as it seems to be the case for the
traditional converters. Maybe we should keep all test cases though?

- Added a little logging where code was changed.

Hope it is useful,

Michael Szlapa

View raw message