JDK-8327255 : javac lint warnings: removal, missing-explicit-ctor
  • Type: Bug
  • Component: javafx
  • Sub-Component: other
  • Affected Version: jfx23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-03-04
  • Updated: 2024-06-27
  • Resolved: 2024-06-25
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
jfx23 b24Fixed
Related Reports
Blocks :  
Blocks :  
Duplicate :  
Relates :  
Relates :  
Description
As noted in JDK-8327170, we have many javac lint warnings, and since they aren't enabled by default, new warnings can easily creep in.

As such we want to start fixing and then enabling various lint warnings, either globally or on a per-module basis.

This initial bug will address the "removal" and "missing-explicit-ctor" warnings. We have a few "removal" warnings that will be fixed as part of this bug. We ccurrently have no "missing-explicit-ctor" warnings, so just need to enable that lint option by default.

To see the removal warnings:

$ gradle -PLINT=removal sdk

In javafx.base there are 2 warnings:

modules/javafx.base/src/main/java/javafx/util/converter/CurrencyStringConverter.java:97: warning: [removal] getNumberFormat() in NumberStringConverter has been deprecated and marked for removal
modules/javafx.base/src/main/java/javafx/util/converter/PercentageStringConverter.java:73: warning: [removal] getNumberFormat() in NumberStringConverter has been deprecated and marked for removal

In javafx.graphics there are 48 warnings in 5 files:

modules/javafx.graphics/src/main/java/com/sun/javafx/css/SelectorPartitioning.java
modules/javafx.graphics/src/main/java/javafx/css/CompoundSelector.java
modules/javafx.graphics/src/main/java/javafx/css/CssParser.java
modules/javafx.graphics/src/main/java/javafx/css/Match.java
modules/javafx.graphics/src/main/java/javafx/css/Selector.java

Each of the warnings is an access to one of the following two terminally deprecated classes:

warning: [removal] CompoundSelector in javafx.css has been deprecated and marked for removal
warning: [removal] SimpleSelector in javafx.css has been deprecated and marked for removal


See the attached log file for the complete list of removal warnings.
Comments
Changeset: 83c8dcc9 Author: Kevin Rushforth <kcr@openjdk.org> Date: 2024-06-25 11:59:31 +0000 URL: https://git.openjdk.org/jfx/commit/83c8dcc91a892c557c5b40064e94274caa89ce6f
25-06-2024

The fix is as follows: 1. Eliminate the removal warnings by adding the necessary @SuppressWarnings("removal") annotations 2. Add the needed support for enabling javac lint warnings in `build.gradle`, including per-module warnings and a separate set of warnings for tool and test tasks. 3. Enable "removal" and "missing-explicit-ctor" by default in all projects for regular compilation tasks UPDATE: for tracking purposes I split item 1 into a separate bug ID, JDK-8334143, but I am including the fix as part of the PR for this bug (now out for review).
12-06-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jfx/pull/1474 Date: 2024-06-12 20:03:24 +0000
12-06-2024

This subsumes JDK-8252782 so I am closing that as a duplicate of this.
04-03-2024