test_class.file: cli/src/test/java/org/openjdk/skara/cli/debug/TestGitMlRules.java
test_class.identifier: TestGitMlRules
test_case.body: @Test
      void collapseMultiple2() {
          assertEquals(Map.of("", List.of("v1")),
                       GitMlRules.stripDuplicatePrefixes(Map.of("k1a", List.of("v1"),
                                                                "k1b", List.of("v1"),
                                                                "k2bb", List.of("v1"),
                                                                "k4", List.of("v1"))));
  
      }
test_case.class_method_signature: TestGitMlRules.collapseMultiple2()
test_case.full_signature: @Test void collapseMultiple2()
test_case.identifier: collapseMultiple2
test_case.invocations: assertEquals of of stripDuplicatePrefixes of of of of of
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void collapseMultiple2()
focal_class.declarator: rfrSubject = Pattern.compile("(?:^Subject: .*?)([78]\\d{6})", Pattern.MULTILINE)
focal_class.modifier: private final static
focal_class.original_string: private final static Pattern rfrSubject = Pattern.compile("(?:^Subject: .*?)([78]\\d{6})", Pattern.MULTILINE);
focal_class.type: Pattern
focal_class.var_name: rfrSubject
focal_class.declarator: rfrSubjectOrIssue = Pattern.compile("(?:(?:^Subject: .*?)|(?:JDK-))([78]\\\\d{6})", Pattern.MULTILINE)
focal_class.modifier: private final static
focal_class.original_string: private final static Pattern rfrSubjectOrIssue = Pattern.compile("(?:(?:^Subject: .*?)|(?:JDK-))([78]\\\\d{6})", Pattern.MULTILINE);
focal_class.type: Pattern
focal_class.var_name: rfrSubjectOrIssue
focal_class.declarator: log = Logger.getLogger("org.openjdk.skara.mlrules")
focal_class.modifier: private final static
focal_class.original_string: private final static Logger log = Logger.getLogger("org.openjdk.skara.mlrules");
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: reviewPattern = rfrSubject
focal_class.modifier: private static
focal_class.original_string: private static Pattern reviewPattern = rfrSubject;
focal_class.type: Pattern
focal_class.var_name: reviewPattern
focal_class.declarator: daysOfHistory = 30
focal_class.modifier: private static
focal_class.original_string: private static int daysOfHistory = 30;
focal_class.type: int
focal_class.var_name: daysOfHistory
focal_class.declarator: filterDivider = 5
focal_class.modifier: private static
focal_class.original_string: private static int filterDivider = 5;
focal_class.type: int
focal_class.var_name: filterDivider
focal_class.declarator: listFilterPattern = Pattern.compile(".*")
focal_class.modifier: private static
focal_class.original_string: private static Pattern listFilterPattern = Pattern.compile(".*");
focal_class.type: Pattern
focal_class.var_name: listFilterPattern
focal_class.declarator: flags = List.of(
              Option.shortcut("d")
                    .fullname("days")
                    .describe("DAYS")
                    .helptext("Number of days to look back")
                    .optional(),
              Option.shortcut("f")
                    .fullname("filter")
                    .describe("DIVIDER")
                    .helptext("Divider for filter threshold")
                    .optional(),
              Option.shortcut("o")
                    .fullname("output")
                    .describe("FILE")
                    .helptext("Name of file to write output to")
                    .optional(),
              Option.shortcut("v")
                    .fullname("verify")
                    .describe("FILE")
                    .helptext("Name of file to verify against")
                    .optional(),
              Option.shortcut("l")
                    .fullname("lists")
                    .describe("PATTERN")
                    .helptext("Regular expression matching mailing lists to include when verifying (default all known)")
                    .optional(),
              Switch.shortcut("")
                    .fullname("verbose")
                    .helptext("Turn on verbose output")
                    .optional(),
              Switch.shortcut("")
                    .fullname("debug")
                    .helptext("Turn on debugging output")
                    .optional(),
              Switch.shortcut("")
                    .fullname("relaxed")
                    .helptext("Use more relaxed matching when searching for reviews")
                    .optional()
      )
focal_class.modifier: static final
focal_class.original_string: static final List<Flag> flags = List.of(
              Option.shortcut("d")
                    .fullname("days")
                    .describe("DAYS")
                    .helptext("Number of days to look back")
                    .optional(),
              Option.shortcut("f")
                    .fullname("filter")
                    .describe("DIVIDER")
                    .helptext("Divider for filter threshold")
                    .optional(),
              Option.shortcut("o")
                    .fullname("output")
                    .describe("FILE")
                    .helptext("Name of file to write output to")
                    .optional(),
              Option.shortcut("v")
                    .fullname("verify")
                    .describe("FILE")
                    .helptext("Name of file to verify against")
                    .optional(),
              Option.shortcut("l")
                    .fullname("lists")
                    .describe("PATTERN")
                    .helptext("Regular expression matching mailing lists to include when verifying (default all known)")
                    .optional(),
              Switch.shortcut("")
                    .fullname("verbose")
                    .helptext("Turn on verbose output")
                    .optional(),
              Switch.shortcut("")
                    .fullname("debug")
                    .helptext("Turn on debugging output")
                    .optional(),
              Switch.shortcut("")
                    .fullname("relaxed")
                    .helptext("Use more relaxed matching when searching for reviews")
                    .optional()
      );
focal_class.type: List<Flag>
focal_class.var_name: flags
focal_class.declarator: inputs = List.of(
              Input.position(0)
                   .describe("repository root or files")
                   .trailing()
                   .required()
      )
focal_class.modifier: static final
focal_class.original_string: static final List<Input> inputs = List.of(
              Input.position(0)
                   .describe("repository root or files")
                   .trailing()
                   .required()
      );
focal_class.type: List<Input>
focal_class.var_name: inputs
focal_class.file: cli/src/main/java/org/openjdk/skara/cli/debug/GitMlRules.java
focal_class.identifier: GitMlRules
focal_class.class_method_signature: GitMlRules.archivePageName(ZonedDateTime month)
focal_class.full_signature: private static String archivePageName(ZonedDateTime month)
focal_class.identifier: archivePageName
focal_class.modifiers: private static
focal_class.parameters: (ZonedDateTime month)
focal_class.return: String
focal_class.signature: String archivePageName(ZonedDateTime month)
focal_class.class_method_signature: GitMlRules.monthRange(Duration maxAge)
focal_class.full_signature: private static List<ZonedDateTime> monthRange(Duration maxAge)
focal_class.identifier: monthRange
focal_class.modifiers: private static
focal_class.parameters: (Duration maxAge)
focal_class.return: List<ZonedDateTime>
focal_class.signature: List<ZonedDateTime> monthRange(Duration maxAge)
focal_class.class_method_signature: GitMlRules.archivePageNames()
focal_class.full_signature: private static Set<String> archivePageNames()
focal_class.identifier: archivePageNames
focal_class.modifiers: private static
focal_class.parameters: ()
focal_class.return: Set<String>
focal_class.signature: Set<String> archivePageNames()
focal_class.class_method_signature: GitMlRules.listSubjects(HttpClient client, String list)
focal_class.full_signature: private static Set<String> listSubjects(HttpClient client, String list)
focal_class.identifier: listSubjects
focal_class.modifiers: private static
focal_class.parameters: (HttpClient client, String list)
focal_class.return: Set<String>
focal_class.signature: Set<String> listSubjects(HttpClient client, String list)
focal_class.class_method_signature: GitMlRules.listReviewedIssues(String... lists)
focal_class.full_signature: private static Map<String, Set<String>> listReviewedIssues(String... lists)
focal_class.identifier: listReviewedIssues
focal_class.modifiers: private static
focal_class.parameters: (String... lists)
focal_class.return: Map<String, Set<String>>
focal_class.signature: Map<String, Set<String>> listReviewedIssues(String... lists)
focal_class.class_method_signature: GitMlRules.issueLists(List<CommitMetadata> commits, Map<String, Set<String>> listReviewedIssues)
focal_class.full_signature: private static Map<CommitMetadata, Set<String>> issueLists(List<CommitMetadata> commits, Map<String, Set<String>> listReviewedIssues)
focal_class.identifier: issueLists
focal_class.modifiers: private static
focal_class.parameters: (List<CommitMetadata> commits, Map<String, Set<String>> listReviewedIssues)
focal_class.return: Map<CommitMetadata, Set<String>>
focal_class.signature: Map<CommitMetadata, Set<String>> issueLists(List<CommitMetadata> commits, Map<String, Set<String>> listReviewedIssues)
focal_class.class_method_signature: GitMlRules.commitChanges(ReadOnlyRepository repo, CommitMetadata commit)
focal_class.full_signature: private static Set<String> commitChanges(ReadOnlyRepository repo, CommitMetadata commit)
focal_class.identifier: commitChanges
focal_class.modifiers: private static
focal_class.parameters: (ReadOnlyRepository repo, CommitMetadata commit)
focal_class.return: Set<String>
focal_class.signature: Set<String> commitChanges(ReadOnlyRepository repo, CommitMetadata commit)
focal_class.class_method_signature: GitMlRules.commitPaths(ReadOnlyRepository repo, Collection<CommitMetadata> commits)
focal_class.full_signature: private static Map<CommitMetadata, Set<String>> commitPaths(ReadOnlyRepository repo, Collection<CommitMetadata> commits)
focal_class.identifier: commitPaths
focal_class.modifiers: private static
focal_class.parameters: (ReadOnlyRepository repo, Collection<CommitMetadata> commits)
focal_class.return: Map<CommitMetadata, Set<String>>
focal_class.signature: Map<CommitMetadata, Set<String>> commitPaths(ReadOnlyRepository repo, Collection<CommitMetadata> commits)
focal_class.class_method_signature: GitMlRules.pathLists(Map<CommitMetadata, Set<String>> commitLists, Map<CommitMetadata, Set<String>> commitPaths)
focal_class.full_signature: private static Map<String, List<String>> pathLists(Map<CommitMetadata, Set<String>> commitLists, Map<CommitMetadata, Set<String>> commitPaths)
focal_class.identifier: pathLists
focal_class.modifiers: private static
focal_class.parameters: (Map<CommitMetadata, Set<String>> commitLists, Map<CommitMetadata, Set<String>> commitPaths)
focal_class.return: Map<String, List<String>>
focal_class.signature: Map<String, List<String>> pathLists(Map<CommitMetadata, Set<String>> commitLists, Map<CommitMetadata, Set<String>> commitPaths)
focal_class.class_method_signature: GitMlRules.mapToTrie(Map<String, List<String>> list)
focal_class.full_signature: private static TrieEntry mapToTrie(Map<String, List<String>> list)
focal_class.identifier: mapToTrie
focal_class.modifiers: private static
focal_class.parameters: (Map<String, List<String>> list)
focal_class.return: TrieEntry
focal_class.signature: TrieEntry mapToTrie(Map<String, List<String>> list)
focal_class.class_method_signature: GitMlRules.trieToMap(TrieEntry trie, String curPath)
focal_class.full_signature: private static Map<String, List<String>> trieToMap(TrieEntry trie, String curPath)
focal_class.identifier: trieToMap
focal_class.modifiers: private static
focal_class.parameters: (TrieEntry trie, String curPath)
focal_class.return: Map<String, List<String>>
focal_class.signature: Map<String, List<String>> trieToMap(TrieEntry trie, String curPath)
focal_class.class_method_signature: GitMlRules.relevantLists(List<String> allLists)
focal_class.full_signature: private static Set<String> relevantLists(List<String> allLists)
focal_class.identifier: relevantLists
focal_class.modifiers: private static
focal_class.parameters: (List<String> allLists)
focal_class.return: Set<String>
focal_class.signature: Set<String> relevantLists(List<String> allLists)
focal_class.class_method_signature: GitMlRules.listsMatch(List<String> list1, List<String> list2)
focal_class.full_signature: private static boolean listsMatch(List<String> list1, List<String> list2)
focal_class.identifier: listsMatch
focal_class.modifiers: private static
focal_class.parameters: (List<String> list1, List<String> list2)
focal_class.return: boolean
focal_class.signature: boolean listsMatch(List<String> list1, List<String> list2)
focal_class.class_method_signature: GitMlRules.pruneEntry(TrieEntry root)
focal_class.full_signature: private static TrieEntry pruneEntry(TrieEntry root)
focal_class.identifier: pruneEntry
focal_class.modifiers: private static
focal_class.parameters: (TrieEntry root)
focal_class.return: TrieEntry
focal_class.signature: TrieEntry pruneEntry(TrieEntry root)
focal_class.class_method_signature: GitMlRules.stripDuplicatePrefixes(Map<String, List<String>> fullList)
focal_class.full_signature: static Map<String, List<String>> stripDuplicatePrefixes(Map<String, List<String>> fullList)
focal_class.identifier: stripDuplicatePrefixes
focal_class.modifiers: static
focal_class.parameters: (Map<String, List<String>> fullList)
focal_class.return: Map<String, List<String>>
focal_class.signature: Map<String, List<String>> stripDuplicatePrefixes(Map<String, List<String>> fullList)
focal_class.class_method_signature: GitMlRules.pathListsToListPaths(Map<String, List<String>> pathLists)
focal_class.full_signature: static Map<String, Set<String>> pathListsToListPaths(Map<String, List<String>> pathLists)
focal_class.identifier: pathListsToListPaths
focal_class.modifiers: static
focal_class.parameters: (Map<String, List<String>> pathLists)
focal_class.return: Map<String, Set<String>>
focal_class.signature: Map<String, Set<String>> pathListsToListPaths(Map<String, List<String>> pathLists)
focal_class.class_method_signature: GitMlRules.verifyInput(String rulesFile, Map<CommitMetadata, Set<String>> issueLists, Map<CommitMetadata, Set<String>> commitPaths)
focal_class.full_signature: private static void verifyInput(String rulesFile, Map<CommitMetadata, Set<String>> issueLists, Map<CommitMetadata, Set<String>> commitPaths)
focal_class.identifier: verifyInput
focal_class.modifiers: private static
focal_class.parameters: (String rulesFile, Map<CommitMetadata, Set<String>> issueLists, Map<CommitMetadata, Set<String>> commitPaths)
focal_class.return: void
focal_class.signature: void verifyInput(String rulesFile, Map<CommitMetadata, Set<String>> issueLists, Map<CommitMetadata, Set<String>> commitPaths)
focal_class.class_method_signature: GitMlRules.main(String[] args)
focal_class.full_signature: public static void main(String[] args)
focal_class.identifier: main
focal_class.modifiers: public static
focal_class.parameters: (String[] args)
focal_class.return: void
focal_class.signature: void main(String[] args)
focal_method.body: static Map<String, List<String>> stripDuplicatePrefixes(Map<String, List<String>> fullList) {
          // Create a prefix tree
          var trie = mapToTrie(fullList);
  
          // Prune it
          var pruned = pruneEntry(trie);
  
          // Restore the map from the tree
          return trieToMap(pruned, "");
      }
focal_method.class_method_signature: GitMlRules.stripDuplicatePrefixes(Map<String, List<String>> fullList)
focal_method.full_signature: static Map<String, List<String>> stripDuplicatePrefixes(Map<String, List<String>> fullList)
focal_method.identifier: stripDuplicatePrefixes
focal_method.invocations: mapToTrie pruneEntry trieToMap
focal_method.modifiers: static
focal_method.parameters: (Map<String, List<String>> fullList)
focal_method.return: Map<String, List<String>>
focal_method.signature: Map<String, List<String>> stripDuplicatePrefixes(Map<String, List<String>> fullList)