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

InputVerifier.shouldYieldFocus should call verify directly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • 9
    • client-libs
    • None

      InputVerifier.shouldYieldFocus(JComponent source, JComponent target) specifies:

      “The basic implementation of this method returns the conjunction of results obtained from verify(input) and verifyTarget(input) to ensure that both the source and the target components are in valid state.”

      Yet the implementation of the method:

      return shouldYieldFocus(source) && verifyTarget(target);

      Yes, shouldYieldFocus(source) calls verify(source). But the result depends on what shouldYieldFocus(source) returns rather than verify(source): shouldYieldFocus(JComponent) could be overridden not to call verify.

            aivanov Alexey Ivanov
            aivanov Alexey Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: