JDK-8313651 : Add 'final' keyword to public property methods in controls
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: jfx20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-08-02
  • Updated: 2023-09-15
  • Resolved: 2023-09-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
jfx22 b09Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Relates :  
Description
Noticed during triage of JDK-8313635 that in ComboBox and other controls the properties (those that are created during initialization), and their corresponding methods such as get*Property(), set*(), get*(), is*() should be declared as final.

Perhaps this should also apply to Node.hasProperties() and other controls that declare getProperties() and hasProperties(), see JDK-8313650 , although it might be done under a different JBS ticket (and discussion) since the Node properties are not javafx.beans properties.
Comments
Changeset: 624fe86f Author: Andy Goryachev <angorya@openjdk.org> Date: 2023-09-11 18:02:34 +0000 URL: https://git.openjdk.org/jfx/commit/624fe86f4c22e43caa95cca03eb11230141d11da
11-09-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jfx/pull/1213 Date: 2023-08-17 23:07:14 +0000
18-08-2023

I changed the title slightly to reflect that the important part of this change is to make all public property methods -- meaning xxxProperty(), setXxx(), and getXxx() -- final, regardless of whether or not the private property field is final. If we can make some of the private property fields private, so much the better. That won't be reflected in the CSR (since it is just an implementation detail), but is good cleanup.
02-08-2023