Commons Configuration
  1. Commons Configuration
  2. CONFIGURATION-125

[configuration] setting non-string values in DatabaseConfiguration always throws ClassCastException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Nightly Builds
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      It would seem that setting any non-string configuration property with a
      DatabaseConfiguration object always throws ClassCastException. I have only
      experienced this issue with Boolean values, but examining the code it would seem
      that the class makes an explicit cast to type String for all set actions. See
      patch for test case.

        Activity

        Hide
        Emmanuel Bourg added a comment -

        Fixed, the property is now serialized using String.valueOf() instead of casting
        it to a String.

        Show
        Emmanuel Bourg added a comment - Fixed, the property is now serialized using String.valueOf() instead of casting it to a String.
        Hide
        Ricardo Gladwell added a comment -

        Created an attachment (id=12432)
        Test case for TestDatabaseConfiguration.

        Show
        Ricardo Gladwell added a comment - Created an attachment (id=12432) Test case for TestDatabaseConfiguration.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ricardo Gladwell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development