Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7903321

Use a set instead of a map to record methods in class 'MethodGroup'

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • None
    • None
    • tools
    • None
    • jmh

    Description

      I notice there is a field `Map<MethodInvocation, MethodInvocation> methods` in the class `org.openjdk.jmh.generators.core.MethodGroup`. It is used to record all the methods of one group and the key and value of one entry of the map is always the same. From the program's meaning, I think it is good to use a set instead of a map. And this implementation confused the newbie, like me, so that I needed more time to read the related code to confirm its meaning.

      So I propose to change it from a map to a set. I know the `TreeSet` is implemented by using a `TreeMap` internally, but it is clearer about the program's meaning by using a set.

      Attachments

        Issue Links

          Activity

            People

              gli Guoxiong Li
              gli Guoxiong Li
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: