Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-461

splitmap.TransformedMap is not really a Map

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0-alpha1, 4.0
    • None
    • None

    Description

      splitmap.TransformedMap is part of the Get/Put hierarchy, but it does not behave like a proper Java Map.

      In particular, java.util.Map.put(K, V) returns V.
      However the collections Put interface returns Object.
      As far as I can tell, this was done in order to be able to include TransformedMap in the hiearchy. But the side effect is to break the generics for all the non-transformer maps in the hierarchy.

      Maybe there should be a separate PutTransformed interface which has the appropriate generic types, i.e.

      public T put(K key, V value)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment