Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-561

Configuration.getList signature incorrect and incompatible change

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Duplicate
    • 1.8, 1.9
    • None
    • None
    • Linux 3.12.2, Oracle JDK 7u40

    Description

      In commons-configuration 1.7 Configuration.getList had signature:

      public List getList(String key, List defaultValue)
      

      But it was changed in 1.8 to:

      public List<Object> getList(String key, List<Object> defaultValue)
      

      So something like this:

      Configuration conf = ...; // some configuration
      List<String> defaults = ...; // some default value
      
      List<Object> value = conf.getList("id", defaults);
      

      will fail at compile-time.

      To fix this signature should change to

      public List<Object> getList(String key, List<? extends Object> defaultValue)
      

      in Configuration and all its implementations.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              grossws Konstantin Gribov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 10m
                  10m
                  Remaining:
                  Remaining Estimate - 10m
                  10m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified