Skip to content

Commit 92fad1b

Browse files
albluemrserb
authored andcommitted
8264680: Use the blessed modifier order in java.desktop
Reviewed-by: serb, kizune, azvegint
1 parent 17202c8 commit 92fad1b

File tree

11 files changed

+18
-132
lines changed

11 files changed

+18
-132
lines changed

src/java.desktop/aix/classes/sun/awt/X11InputMethod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
public abstract class X11InputMethod extends X11InputMethodBase {
4444

4545
// to keep the instance of activating if IM resumed
46-
static protected X11InputMethod activatedInstance = null;
46+
protected static X11InputMethod activatedInstance = null;
4747

4848
/**
4949
* Constructs an X11InputMethod instance. It initializes the XIM

src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
*
4343
* @see DesktopPeer
4444
*/
45-
final public class CDesktopPeer implements DesktopPeer {
45+
public final class CDesktopPeer implements DesktopPeer {
4646

4747
@Override
4848
public boolean isSupported(Action action) {

src/java.desktop/macosx/classes/sun/lwawt/macosx/CTaskbarPeer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import java.awt.Taskbar.Feature;
3232
import java.awt.peer.TaskbarPeer;
3333

34-
final public class CTaskbarPeer implements TaskbarPeer {
34+
public final class CTaskbarPeer implements TaskbarPeer {
3535

3636
CTaskbarPeer() {}
3737

src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public class CTrayIcon extends CFRetainedResource implements TrayIconPeer {
7171
// events between MOUSE_PRESSED and MOUSE_RELEASED for particular button
7272
private static int mouseClickButtons = 0;
7373

74-
private final static boolean useTemplateImages = AccessController.doPrivileged((PrivilegedAction<Boolean>)
74+
private static final boolean useTemplateImages = AccessController.doPrivileged((PrivilegedAction<Boolean>)
7575
() -> Boolean.getBoolean("apple.awt.enableTemplateImages")
7676
);
7777

src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ public final class JavaSoundAudioClip implements AudioClip, MetaEventListener, L
8888
*
8989
*/
9090
private static final long CLIP_THRESHOLD = 1048576;
91-
//private final static long CLIP_THRESHOLD = 1;
9291
private static final int STREAM_BUFFER_SIZE = 1024;
9392

9493
public static JavaSoundAudioClip create(final URLConnection uc) {

src/java.desktop/share/classes/java/awt/EventQueue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,8 +1019,8 @@ public SecondaryLoop createSecondaryLoop() {
10191019
}
10201020

10211021
private class FwSecondaryLoopWrapper implements SecondaryLoop {
1022-
final private SecondaryLoop loop;
1023-
final private EventFilter filter;
1022+
private final SecondaryLoop loop;
1023+
private final EventFilter filter;
10241024

10251025
public FwSecondaryLoopWrapper(SecondaryLoop loop, EventFilter filter) {
10261026
this.loop = loop;

src/java.desktop/share/classes/javax/print/attribute/standard/DialogOwner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public long getOwnerID(DialogOwner owner) {
5555
}
5656
}
5757

58-
static private Accessor accessor = new Accessor();
58+
private static Accessor accessor = new Accessor();
5959
static {
6060
DialogOwnerAccessor.setAccessor(accessor);
6161
}

src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ public File[] getChooserComboBoxFiles() {
602602
* possibly empty if there are no appropriate permissions.
603603
* @since 12
604604
*/
605-
final public File[] getChooserShortcutPanelFiles() {
605+
public final File[] getChooserShortcutPanelFiles() {
606606
return (File[]) ShellFolder.get("fileChooserShortcutPanelFolders");
607607
}
608608

src/java.desktop/share/classes/sun/awt/image/PNGImageDecoder.java

Lines changed: 7 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -33,11 +33,6 @@
3333

3434
/** PNG - Portable Network Graphics - image file reader.
3535
See <a href=http://www.ietf.org/rfc/rfc2083.txt>RFC2083</a> for details. */
36-
37-
/* this is changed
38-
public class PNGImageDecoder extends FilterInputStream implements Runnable
39-
{ */
40-
4136
public class PNGImageDecoder extends ImageDecoder
4237
{
4338
private static final int GRAY=0;
@@ -69,18 +64,11 @@ public class PNGImageDecoder extends ImageDecoder
6964
private int interlaceMethod;
7065
private int gamma = 100000;
7166
private java.util.Hashtable<String, Object> properties;
72-
/* this is not needed
73-
ImageConsumer target;
74-
*/
7567
private ColorModel cm;
7668
private byte[] red_map, green_map, blue_map, alpha_map;
7769
private int transparentPixel = -1;
7870
private byte[] transparentPixel_16 = null; // we need 6 bytes to store 16bpp value
7971
private static ColorModel[] greyModels = new ColorModel[4];
80-
/* this is not needed
81-
PNGImageDecoder next;
82-
*/
83-
8472
private void property(String key,Object value) {
8573
if(value==null) return;
8674
if(properties==null) properties=new java.util.Hashtable<>();
@@ -153,9 +141,6 @@ protected boolean handleChunk(int key, byte[] buf, int st, int len)
153141
compressionMethod = getByte(st+10);
154142
filterMethod = getByte(st+11);
155143
interlaceMethod = getByte(st+12);
156-
/* this is not needed
157-
if(target!=null) target.setDimensions(width,height);
158-
*/
159144
break;
160145
case PLTEChunk:
161146
{ int tsize = len/3;
@@ -235,14 +220,7 @@ protected boolean handleChunk(int key, byte[] buf, int st, int len)
235220
public class PNGException extends IOException {
236221
PNGException(String s) { super(s); }
237222
}
238-
/* this is changed
239-
public void run() {
240-
*/
241223
public void produceImage() throws IOException, ImageFormatException {
242-
/* this is not needed
243-
ImageConsumer t = target;
244-
if(t!=null) try {
245-
*/
246224
try {
247225
for(int i=0; i<signature.length; i++)
248226
if((signature[i]&0xFF)!=underlyingInputStream.read())
@@ -310,14 +288,6 @@ public void produceImage() throws IOException, ImageFormatException {
310288
default:
311289
throw new PNGException("invalid color type");
312290
}
313-
/* this is going to be set in the pixel store
314-
t.setColorModel(cm);
315-
t.setHints(interlaceMethod !=0
316-
? ImageConsumer.TOPDOWNLEFTRIGHT | ImageConsumer.COMPLETESCANLINES
317-
: ImageConsumer.TOPDOWNLEFTRIGHT | ImageConsumer.COMPLETESCANLINES |
318-
ImageConsumer.SINGLEPASS | ImageConsumer.SINGLEFRAME);
319-
*/
320-
// code added to make it work with ImageDecoder architecture
321291
setDimensions(width, height);
322292
setColorModel(cm);
323293
int flags = (interlaceMethod !=0
@@ -326,7 +296,6 @@ public void produceImage() throws IOException, ImageFormatException {
326296
ImageConsumer.SINGLEPASS | ImageConsumer.SINGLEFRAME);
327297
setHints(flags);
328298
headerComplete();
329-
// end of adding
330299

331300
int samplesPerPixel = ((colorType&PALETTE)!=0 ? 1
332301
: ((colorType&COLOR)!=0 ? 3 : 1)+((colorType&ALPHA)!=0?1:0));
@@ -335,11 +304,6 @@ public void produceImage() throws IOException, ImageFormatException {
335304
int pass, passLimit;
336305
if(interlaceMethod==0) { pass = -1; passLimit = 0; }
337306
else { pass = 0; passLimit = 7; }
338-
// These loops are far from being tuned. They're this way to make them easy to
339-
// debug. Tuning comes later.
340-
/* code changed. target not needed here
341-
while(++pass<=passLimit && (t=target)!=null) {
342-
*/
343307
while(++pass<=passLimit) {
344308
int row = startingRow[pass];
345309
int rowInc = rowIncrement[pass];
@@ -356,9 +320,6 @@ public void produceImage() throws IOException, ImageFormatException {
356320

357321
byte[] rowByteBuffer = new byte[rowByteWidth];
358322
byte[] prevRowByteBuffer = new byte[rowByteWidth];
359-
/* code changed. target not needed here
360-
while (row < height && (t=target)!=null) {
361-
*/
362323
while (row < height) {
363324
int rowFilter = is.read();
364325
for (int rowFillPos=0;rowFillPos<rowByteWidth; ) {
@@ -457,27 +418,13 @@ public void produceImage() throws IOException, ImageFormatException {
457418
break;
458419
default: throw new PNGException("illegal type/depth");
459420
}
460-
/*visit (row, col,
461-
min (bHeight, height - row),
462-
min (bWidth, width - col)); */
463421
col += colInc;
464422
}
465423
if(interlaceMethod==0)
466424
if(wPixels!=null) {
467-
/* code changed. target not needed here
468-
t.setPixels(0,row,width,1,cm,wPixels,0,width);
469-
*/
470-
// code added to make it work with ImageDecoder arch
471425
sendPixels(0,row,width,1,wPixels,0,width);
472-
// end of adding
473-
}
474-
else {
475-
/* code changed. target not needed here
476-
t.setPixels(0,row,width,1,cm,bPixels,0,width);
477-
*/
478-
// code added to make it work with ImageDecoder arch
426+
} else {
479427
sendPixels(0,row,width,1,bPixels,0,width);
480-
//end of adding
481428
}
482429
row += rowInc;
483430
rowOffset += rowInc*rowStride;
@@ -488,20 +435,9 @@ public void produceImage() throws IOException, ImageFormatException {
488435
}
489436
if(interlaceMethod!=0)
490437
if(wPixels!=null) {
491-
/* code changed. target not needed here
492-
t.setPixels(0,0,width,height,cm,wPixels,0,width);
493-
*/
494-
// code added to make it work with ImageDecoder arch
495438
sendPixels(0,0,width,height,wPixels,0,width);
496-
//end of adding
497-
}
498-
else {
499-
/* code changed. target not needed here
500-
t.setPixels(0,0,width,height,cm,bPixels,0,width);
501-
*/
502-
// code added to make it work with ImageDecoder arch
439+
} else {
503440
sendPixels(0,0,width,height,bPixels,0,width);
504-
//end of adding
505441
}
506442
}
507443

@@ -511,37 +447,15 @@ public void produceImage() throws IOException, ImageFormatException {
511447
and column, using the color indicated by the pixel. Note that row
512448
and column are measured from 0,0 at the upper left corner. */
513449

514-
/* code not needed, don't deal with target
515-
if((t=target)!=null) {
516-
if(properties!=null) t.setProperties(properties);
517-
t.imageComplete(ImageConsumer.STATICIMAGEDONE);
518-
*/
519-
520450
imageComplete(ImageConsumer.STATICIMAGEDONE, true);
521-
522-
/* code not needed }
523-
is.close();
524-
*/
525451
} catch(IOException e) {
526452
if(!aborted) {
527-
/* code not needed
528-
if((t=target)!=null) {
529-
PNGEncoder.prChunk(e.toString(),inbuf,pos,limit-pos,true);
530-
*/
531453
property("error", e);
532-
/* code not needed
533-
t.setProperties(properties);
534-
t.imageComplete(ImageConsumer.IMAGEERROR|ImageConsumer.STATICIMAGEDONE);
535-
*/
536454
imageComplete(ImageConsumer.IMAGEERROR|ImageConsumer.STATICIMAGEDONE, true);
537455
throw e;
538456
}
539457
} finally {
540458
try { close(); } catch(Throwable e){}
541-
/* code not needed
542-
target = null;
543-
endTurn();
544-
*/
545459
}
546460
}
547461

@@ -620,47 +534,22 @@ private void filterRow(byte[] rowByteBuffer, byte[] prevRow,
620534
private static final byte[] blockHeight = { 1, 8, 8, 4, 4, 2, 2, 1 };
621535
private static final byte[] blockWidth = { 1, 8, 4, 4, 2, 2, 1, 1 };
622536

623-
//abstract public class ChunkReader extends FilterInputStream {
624-
int pos, limit;
537+
int pos, limit;
625538
int chunkStart;
626-
int chunkKey, chunkLength, chunkCRC;
539+
int chunkKey, chunkLength, chunkCRC;
627540
boolean seenEOF;
628541

629542
private static final byte[] signature = { (byte) 137, (byte) 80, (byte) 78,
630543
(byte) 71, (byte) 13, (byte) 10, (byte) 26, (byte) 10 };
631544

632-
PNGFilterInputStream inputStream;
633-
InputStream underlyingInputStream;
545+
PNGFilterInputStream inputStream;
546+
InputStream underlyingInputStream;
634547

635-
/* code changed
636-
public PNGImageDecoder(InputStream in, ImageConsumer t) throws IOException {
637-
*/
638548
public PNGImageDecoder(InputStreamImageSource src, InputStream input) throws IOException {
639-
// code added
640549
super(src, input);
641550
inputStream = new PNGFilterInputStream(this, input);
642551
underlyingInputStream = inputStream.underlyingInputStream;
643-
// end of adding
644-
/* code changed
645-
super(in);
646-
target = t;
647-
waitTurn();
648-
new Thread(this).start();
649-
*/
650-
}
651-
/* code changed to make it work with ImageDecoder architecture
652-
static int ThreadLimit = 10;
653-
private static synchronized void waitTurn() {
654-
try {
655-
while(ThreadLimit<=0) PNGImageDecoder.class.wait(1000);
656-
} catch(InterruptedException e){}
657-
ThreadLimit--;
658-
}
659-
private static synchronized void endTurn() {
660-
if(ThreadLimit<=0) PNGImageDecoder.class.notify();
661-
ThreadLimit++;
662552
}
663-
*/
664553
byte[] inbuf = new byte[4096];
665554
private void fill() throws IOException {
666555
if(!seenEOF) {
@@ -728,8 +617,6 @@ boolean getData() throws IOException {
728617
chunkLength = 0;
729618
return chunkLength>0;
730619
}
731-
//abstract protected boolean handleChunk(int key, byte[] buf, int st, int len)
732-
// throws IOException;
733620
private static boolean checkCRC = true;
734621
public static boolean getCheckCRC() { return checkCRC; }
735622
public static void setCheckCRC(boolean c) { checkCRC = c; }

src/java.desktop/share/classes/sun/font/lookup/JDKFontLookup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434
public final class JDKFontLookup {
3535

36-
public final static String getJDKFontDir() {
36+
public static final String getJDKFontDir() {
3737
return SunFontManager.getJDKFontDir();
3838
}
3939
}

0 commit comments

Comments
 (0)