Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
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 :
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
Alex Ruiz
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Issue Type | Bug [ 1 ] | Improvement [ 4 ] |
| Assignee | Alex Ruiz [ alexruiz ] | |
| Fix Version/s | Cairo [ 15055 ] | |
| Affects Version/s | Tirane [ 15051 ] |
Alex Ruiz
made changes -
| Status | Open [ 1 ] | In Progress [ 3 ] |
Alex Ruiz
made changes -
| Resolution | Fixed [ 1 ] | |
| Status | In Progress [ 3 ] | Resolved [ 5 ] |
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.