From 92fad1b4088ca6c7738bfe9c95da15249f40ef74 Mon Sep 17 00:00:00 2001 From: Alex Blewitt Date: Wed, 7 Apr 2021 06:14:38 +0000 Subject: [PATCH] 8264680: Use the blessed modifier order in java.desktop Reviewed-by: serb, kizune, azvegint --- .../aix/classes/sun/awt/X11InputMethod.java | 2 +- .../sun/lwawt/macosx/CDesktopPeer.java | 2 +- .../sun/lwawt/macosx/CTaskbarPeer.java | 2 +- .../classes/sun/lwawt/macosx/CTrayIcon.java | 2 +- .../sun/media/sound/JavaSoundAudioClip.java | 1 - .../share/classes/java/awt/EventQueue.java | 4 +- .../print/attribute/standard/DialogOwner.java | 2 +- .../swing/filechooser/FileSystemView.java | 2 +- .../sun/awt/image/PNGImageDecoder.java | 127 +----------------- .../sun/font/lookup/JDKFontLookup.java | 2 +- .../sun/java2d/x11/X11SurfaceData.java | 4 +- 11 files changed, 18 insertions(+), 132 deletions(-) diff --git a/src/java.desktop/aix/classes/sun/awt/X11InputMethod.java b/src/java.desktop/aix/classes/sun/awt/X11InputMethod.java index ee291126693..5f27129e2c3 100644 --- a/src/java.desktop/aix/classes/sun/awt/X11InputMethod.java +++ b/src/java.desktop/aix/classes/sun/awt/X11InputMethod.java @@ -43,7 +43,7 @@ import sun.util.logging.PlatformLogger; public abstract class X11InputMethod extends X11InputMethodBase { // to keep the instance of activating if IM resumed - static protected X11InputMethod activatedInstance = null; + protected static X11InputMethod activatedInstance = null; /** * Constructs an X11InputMethod instance. It initializes the XIM diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java index f06865ef9aa..a4ec0767298 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java @@ -42,7 +42,7 @@ import java.net.URI; * * @see DesktopPeer */ -final public class CDesktopPeer implements DesktopPeer { +public final class CDesktopPeer implements DesktopPeer { @Override public boolean isSupported(Action action) { diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTaskbarPeer.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTaskbarPeer.java index 6b30aaf9f3c..38f59c112a9 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTaskbarPeer.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTaskbarPeer.java @@ -31,7 +31,7 @@ import java.awt.PopupMenu; import java.awt.Taskbar.Feature; import java.awt.peer.TaskbarPeer; -final public class CTaskbarPeer implements TaskbarPeer { +public final class CTaskbarPeer implements TaskbarPeer { CTaskbarPeer() {} diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java index b92c62f4620..7ea418b8a83 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java @@ -71,7 +71,7 @@ public class CTrayIcon extends CFRetainedResource implements TrayIconPeer { // events between MOUSE_PRESSED and MOUSE_RELEASED for particular button private static int mouseClickButtons = 0; - private final static boolean useTemplateImages = AccessController.doPrivileged((PrivilegedAction) + private static final boolean useTemplateImages = AccessController.doPrivileged((PrivilegedAction) () -> Boolean.getBoolean("apple.awt.enableTemplateImages") ); diff --git a/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java b/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java index 0273149d0de..bc2f87fe33f 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java @@ -88,7 +88,6 @@ public final class JavaSoundAudioClip implements AudioClip, MetaEventListener, L * */ private static final long CLIP_THRESHOLD = 1048576; - //private final static long CLIP_THRESHOLD = 1; private static final int STREAM_BUFFER_SIZE = 1024; public static JavaSoundAudioClip create(final URLConnection uc) { diff --git a/src/java.desktop/share/classes/java/awt/EventQueue.java b/src/java.desktop/share/classes/java/awt/EventQueue.java index 9470be84649..e61b58e20aa 100644 --- a/src/java.desktop/share/classes/java/awt/EventQueue.java +++ b/src/java.desktop/share/classes/java/awt/EventQueue.java @@ -1019,8 +1019,8 @@ public class EventQueue { } private class FwSecondaryLoopWrapper implements SecondaryLoop { - final private SecondaryLoop loop; - final private EventFilter filter; + private final SecondaryLoop loop; + private final EventFilter filter; public FwSecondaryLoopWrapper(SecondaryLoop loop, EventFilter filter) { this.loop = loop; diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/DialogOwner.java b/src/java.desktop/share/classes/javax/print/attribute/standard/DialogOwner.java index a571d49193d..807eaa2b122 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/DialogOwner.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/DialogOwner.java @@ -55,7 +55,7 @@ public final class DialogOwner implements PrintRequestAttribute { } } - static private Accessor accessor = new Accessor(); + private static Accessor accessor = new Accessor(); static { DialogOwnerAccessor.setAccessor(accessor); } diff --git a/src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java b/src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java index 1a6c0e41cac..bdcdd8f3545 100644 --- a/src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java +++ b/src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java @@ -602,7 +602,7 @@ public abstract class FileSystemView { * possibly empty if there are no appropriate permissions. * @since 12 */ - final public File[] getChooserShortcutPanelFiles() { + public final File[] getChooserShortcutPanelFiles() { return (File[]) ShellFolder.get("fileChooserShortcutPanelFolders"); } diff --git a/src/java.desktop/share/classes/sun/awt/image/PNGImageDecoder.java b/src/java.desktop/share/classes/sun/awt/image/PNGImageDecoder.java index aa4f646db01..8e9d5afcba2 100644 --- a/src/java.desktop/share/classes/sun/awt/image/PNGImageDecoder.java +++ b/src/java.desktop/share/classes/sun/awt/image/PNGImageDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,11 +33,6 @@ import java.awt.Color; /** PNG - Portable Network Graphics - image file reader. See RFC2083 for details. */ - -/* this is changed -public class PNGImageDecoder extends FilterInputStream implements Runnable -{ */ - public class PNGImageDecoder extends ImageDecoder { private static final int GRAY=0; @@ -69,18 +64,11 @@ public class PNGImageDecoder extends ImageDecoder private int interlaceMethod; private int gamma = 100000; private java.util.Hashtable properties; - /* this is not needed - ImageConsumer target; - */ private ColorModel cm; private byte[] red_map, green_map, blue_map, alpha_map; private int transparentPixel = -1; private byte[] transparentPixel_16 = null; // we need 6 bytes to store 16bpp value private static ColorModel[] greyModels = new ColorModel[4]; - /* this is not needed - PNGImageDecoder next; - */ - private void property(String key,Object value) { if(value==null) return; if(properties==null) properties=new java.util.Hashtable<>(); @@ -153,9 +141,6 @@ public class PNGImageDecoder extends ImageDecoder compressionMethod = getByte(st+10); filterMethod = getByte(st+11); interlaceMethod = getByte(st+12); - /* this is not needed - if(target!=null) target.setDimensions(width,height); - */ break; case PLTEChunk: { int tsize = len/3; @@ -235,14 +220,7 @@ public class PNGImageDecoder extends ImageDecoder public class PNGException extends IOException { PNGException(String s) { super(s); } } - /* this is changed - public void run() { - */ public void produceImage() throws IOException, ImageFormatException { - /* this is not needed - ImageConsumer t = target; - if(t!=null) try { - */ try { for(int i=0; i0; } - //abstract protected boolean handleChunk(int key, byte[] buf, int st, int len) - // throws IOException; private static boolean checkCRC = true; public static boolean getCheckCRC() { return checkCRC; } public static void setCheckCRC(boolean c) { checkCRC = c; } diff --git a/src/java.desktop/share/classes/sun/font/lookup/JDKFontLookup.java b/src/java.desktop/share/classes/sun/font/lookup/JDKFontLookup.java index 83af637cfb0..fc101d67b86 100644 --- a/src/java.desktop/share/classes/sun/font/lookup/JDKFontLookup.java +++ b/src/java.desktop/share/classes/sun/font/lookup/JDKFontLookup.java @@ -33,7 +33,7 @@ import sun.font.SunFontManager; */ public final class JDKFontLookup { - public final static String getJDKFontDir() { + public static final String getJDKFontDir() { return SunFontManager.getJDKFontDir(); } } diff --git a/src/java.desktop/unix/classes/sun/java2d/x11/X11SurfaceData.java b/src/java.desktop/unix/classes/sun/java2d/x11/X11SurfaceData.java index f96297b1019..8fcecae08a7 100644 --- a/src/java.desktop/unix/classes/sun/java2d/x11/X11SurfaceData.java +++ b/src/java.desktop/unix/classes/sun/java2d/x11/X11SurfaceData.java @@ -695,7 +695,7 @@ public abstract class X11SurfaceData extends XSurfaceData { } } - private final static class X11WindowSurfaceData extends X11SurfaceData { + private static final class X11WindowSurfaceData extends X11SurfaceData { private final int scale; @@ -744,7 +744,7 @@ public abstract class X11SurfaceData extends XSurfaceData { } } - private final static class X11PixmapSurfaceData extends X11SurfaceData { + private static final class X11PixmapSurfaceData extends X11SurfaceData { private final Image offscreenImage; private final int width;