FEST
  1. FEST
  2. FEST-37

Are classes in org.fest.swing.core.matcher.* final?

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: FEST-Swing 1.1
    • Fix Version/s: FEST-Swing 1.2a1
    • Component/s: Swing
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Classes in org.fest.swing.core.matcher.* should be marked as final (if they are not assumed to be extendable), or their properties should be protected, not private (so they can be extended).

        Activity

        Hide
        Alex Ruiz added a comment -

        My original intention was to allow extension of the matchers. After giving it a second thought, I decided to mark them as final. The reason is the lack of static-typing checks for their constructors. They take Objects as arguments, and in many cases it should be Strings (e.g. name, title.) The reason for using Objects is to allow the use of ANY. If subclasses send the wrong argument, the matching can fail at runtime, instead of having the compiler to check for these errors. The type checking is perform in the static factory methods though.

        Show
        Alex Ruiz added a comment - My original intention was to allow extension of the matchers. After giving it a second thought, I decided to mark them as final. The reason is the lack of static-typing checks for their constructors. They take Objects as arguments, and in many cases it should be Strings (e.g. name, title.) The reason for using Objects is to allow the use of ANY. If subclasses send the wrong argument, the matching can fail at runtime, instead of having the compiler to check for these errors. The type checking is perform in the static factory methods though.

          People

          • Assignee:
            Alex Ruiz
            Reporter:
            Ondrej Medek
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: