GeoTools
  1. GeoTools
  2. GEOT-2745

LikeFilterImpl uses pattern matcher in non thread safe way

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.7, 2.6-M2
    • Fix Version/s: 2.5.8, 2.6-RC1
    • Component/s: main
    • Labels:
      None

      Issue Links

        Activity

        Hide
        Justin Deoliveira added a comment -
        Here is the patch suggested by Andrea to just cache the compiled the pattern (which is thread safe) rather than the matcher (which is not thread safe).
        Show
        Justin Deoliveira added a comment - Here is the patch suggested by Andrea to just cache the compiled the pattern (which is thread safe) rather than the matcher (which is not thread safe).
        Hide
        Andrea Aime added a comment -
        Looking at it you could avoid resetting the matcher if getMatcher() takes the target strings as a param. Usually the pattern to match a string is pattern.matcher(string).matches().
        Or else change the method into getPattern() and apply the matcher outside (would look better, separate the cached part from the non cached one).
        Minor thing anyways
        Show
        Andrea Aime added a comment - Looking at it you could avoid resetting the matcher if getMatcher() takes the target strings as a param. Usually the pattern to match a string is pattern.matcher(string).matches(). Or else change the method into getPattern() and apply the matcher outside (would look better, separate the cached part from the non cached one). Minor thing anyways
        Hide
        Justin Deoliveira added a comment -
        Ahh right, the reset is pointless, good catch, i was just doing the bare minimum to avoid the race condition. Thanks for the review.
        Show
        Justin Deoliveira added a comment - Ahh right, the reset is pointless, good catch, i was just doing the bare minimum to avoid the race condition. Thanks for the review.
        Hide
        Andrea Aime added a comment -
        Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update
        Show
        Andrea Aime added a comment - Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update

          People

          • Assignee:
            Justin Deoliveira
            Reporter:
            Justin Deoliveira
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: