JDK-8269424 : Some SuppressWarnings annotations can be more localized
  • Type: Bug
  • Component: javafx
  • Sub-Component: other
  • Affected Version: openjfx17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-06-26
  • Updated: 2021-07-08
  • Resolved: 2021-06-29
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
openjfx17Fixed
Related Reports
Relates :  
Description
This is a follow-up to JDK-8264139, which added `@SuppressWarning` annotations to usages of deprecated security manager methods. [~weijun] noticed that there was one pattern where the automated tool added the warning at a higher level than was needed.

Here are the two instances where the annotation can be more localized:

jfx/modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/GlassScene.java:
245     public TKClipboard createDragboard(boolean isDragSource) {
246         ClipboardAssistance assistant = new ClipboardAssistance(Clipboard.DND) {
247             @Override
248             public void actionPerformed(final int performedAction) {
249                 super.actionPerformed(performedAction);
250                 AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
The annotation should be added on line 247 instead of 246.

jfx/modules/javafx.graphics/src/main/java/javafx/animation/Animation.java:
 196     final PulseReceiver pulseReceiver = new PulseReceiver() {
 197         @Override public void timePulse(long now) {
 198             final long elapsedTime = now - startTime;
 199             if (elapsedTime < 0) {
 200                 return;
 201             }
 202             if (accessCtrlCtx == null) {
 203                 throw new IllegalStateException("Error: AccessControlContext not captured");
 204             }
 205
 206             AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
The annotation should be added on line 197 instead of 196.

Comments
Changeset: 50ed890f Author: Kevin Rushforth <kcr@openjdk.org> Date: 2021-06-29 12:02:47 +0000 URL: https://git.openjdk.java.net/jfx/commit/50ed890f55e073ba1abe457dfaaba5cd7c84e8b9
29-06-2021