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

documentation for Pattern.asPredicate should state that it uses matcher.find()

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      The documentation for https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#asPredicate
      states
        Creates a predicate which can be used to match a string.
        Returns:
        The predicate which can be used for matching on a string

      but does NOT say which matching method will be invoked on the matcher: matches(), lookingAt(), or find()

      Decompiling shows that it's find(), but the docs should state that explicitly, especially since the provided phrase "for matching on a string" is lexigraphically closest to matches(), which is not the method that is used.


            rgiulietti Raffaello Giulietti
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: