Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16715

Replace new HashMap(int) and new HashSet(int) with CollectionUtil.newHashMap / CollectionUtil.newHashSet

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • main (10.0), 9.3
    • None
    • None

    Description

      While looking at replacing Guava, dsmiley proposed converting existing new HashMap(int) and new HashSet(int) to avoid the trap of them not actually being that size.

      https://github.com/apache/solr/pull/1466#discussion_r1144811614

      We should be able to enforce this with ForbiddenAPIs and https://github.com/apache/solr/pull/1466 adds CollectionUtil inspired by Lucene that we can use.

      Attachments

        Issue Links

          Activity

            People

              krisden Kevin Risden
              krisden Kevin Risden
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2.5h
                  2.5h