Commons DbUtils
  1. Commons DbUtils
  2. DBUTILS-61

Backwards binary compatibility broken in KeyedHandler

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3
    • Labels:
      None

      Description

      In revision r832220 KeyedHandler's API was modified. KeyedHandler#createRow used to be able to return any object, but now can only return a Map (and a map of Strings to Objects, at that).

      clirr reports this as a binary backwards compatibility error; even "correct" subclasses of KeyedHandler that attempt to override createRow will find that we ignore the subclass implementation and simply invoke KeyedHandler#createRow instead.

        Activity

        Dan Fabulich created issue -
        Hide
        Dan Fabulich added a comment -

        It seems that KeyedHandler was only a map of maps by convention; it was really a KeyedHandler<K,V> implements ResultSetHandler<Map<K,V>>.

        But there's no way to implement that API concretely! So I think the best thing is just to create an explicit AbstractKeyedHandler<K,V> implements ResultSetHandler<Map<K,V>>, so KeyedHandler extends AbstractKeyedHandler<Object, Map<String, Object>>. This will also fix binary compatibility, as the compiler will append a #createRow method that returns Object.

        Show
        Dan Fabulich added a comment - It seems that KeyedHandler was only a map of maps by convention; it was really a KeyedHandler<K,V> implements ResultSetHandler<Map<K,V>>. But there's no way to implement that API concretely! So I think the best thing is just to create an explicit AbstractKeyedHandler<K,V> implements ResultSetHandler<Map<K,V>>, so KeyedHandler extends AbstractKeyedHandler<Object, Map<String, Object>>. This will also fix binary compatibility, as the compiler will append a #createRow method that returns Object.
        Hide
        Dan Fabulich added a comment -

        Fixed revision 832529.

        Show
        Dan Fabulich added a comment - Fixed revision 832529.
        Dan Fabulich made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        13m 11s 1 Dan Fabulich 03/Nov/09 20:01

          People

          • Assignee:
            Unassigned
            Reporter:
            Dan Fabulich
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development