Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8312618

StringUtils::is_star_match() is too liberal

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 22
    • hotspot

      This API was added in JDK-8287647. Its matching criteria is more liberal than the common implementations of "*" matches:

      - it is always case insensitive
      - it allows the pattern to match a subset of the target string

      Therefore, it's not possible to use this API to
      - perform case sensitive matching
      - perform a full string match

      Proposed change:

      [1] Add a parameter to select case sensitivity
      [2] The pattern should match the full string. I.e., the string "abcd" matches "*bc*" but doesn't match "bc*".

      (If substring matching is desired, you can just add "*" to the beginning and end of the pattern).

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: