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.