Class NormalizedFileNames

java.lang.Object
org.jacoco.report.internal.NormalizedFileNames

class NormalizedFileNames extends Object
Internal utility to create normalized file names from string ids. The file names generated by an instance of this class have the following properties:
  • The same input id is mapped to the same file name.
  • Different ids are mapped to different file names.
  • For safe characters the file name corresponds to the input id, other characters are replaced by _ (underscore).
  • File names are case aware, i.e. the same file name but with different upper/lower case characters is not possible.
  • If unique filenames can't directly created from the ids, additional suffixes are appended.
  • Field Details

    • mapping

      private final Map<String,String> mapping
    • usedNames

      private final Set<String> usedNames
  • Constructor Details

    • NormalizedFileNames

      NormalizedFileNames()
  • Method Details

    • getFileName

      public String getFileName(String id)
    • replaceIllegalChars

      private String replaceIllegalChars(String s)
    • ensureUniqueness

      private String ensureUniqueness(String s)