code: static private boolean hasMatch(String path, List<String> patterns) {
          for (String p : patterns) {
              // Exact match
              if (p.equals(path)) {
                  return true;
              }
              // Single dot the end matches this package and all its subpackages.
              if (p.endsWith(".*")) {
                  // Remove the wildcard
                  String patprefix = p.substring(0,p.length()-2);
                  // Does the path start with the pattern prefix?
                  if (path.startsWith(patprefix)) {
                      // If the path has the same length as the pattern prefix, then it is a match.
                      // If the path is longer, then make sure that
                      // the next part of the path starts with a dot (.) to prevent
                      // wildcard matching in the middle of a package name.
                      if (path.length()==patprefix.length() || path.charAt(patprefix.length())=='.') {
                          return true;
                      }
                  }
              }
          }
          return false;
      }
docs: Test if a path matches any of the patterns given.
  The pattern foo.bar matches only foo.bar
  The pattern foo.* matches foo.bar and foo.bar.zoo etc