From 5cdd8bd3c65ddab5ec92b0f753a6f4892c14f58a Mon Sep 17 00:00:00 2001 From: Semyon Sadetsky Date: Wed, 16 Sep 2015 10:01:24 +0300 Subject: [PATCH 01/81] 8129838: [macosx] Regression: NPE in java.awt.Choice Reviewed-by: alexsch, azvegint --- .../com/apple/laf/AquaComboBoxPopup.java | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxPopup.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxPopup.java index ecc6d20690e..332cb7e46ff 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxPopup.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxPopup.java @@ -26,6 +26,8 @@ package com.apple.laf; import java.awt.*; +import java.awt.Insets; +import java.awt.Rectangle; import java.awt.event.*; import javax.swing.*; @@ -195,24 +197,14 @@ class AquaComboBoxPopup extends BasicComboPopup { final GraphicsDevice[] gs = ge.getScreenDevices(); //System.err.println(" gs.length = " + gs.length); final Rectangle comboBoxBounds = comboBox.getBounds(); - if (gs.length == 1) { - final Dimension scrSize = Toolkit.getDefaultToolkit().getScreenSize(); - - //System.err.println(" scrSize: "+ scrSize); - - // If the combo box is totally off screen, don't show a popup - if ((p.x + comboBoxBounds.width < 0) || (p.y + comboBoxBounds.height < 0) || (p.x > scrSize.width) || (p.y > scrSize.height)) { - return null; - } - Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(comboBox.getGraphicsConfiguration()); - return new Rectangle(0, insets.top, scrSize.width, scrSize.height - insets.top - insets.bottom); - } for (final GraphicsDevice gd : gs) { final GraphicsConfiguration[] gc = gd.getConfigurations(); for (final GraphicsConfiguration element0 : gc) { final Rectangle gcBounds = element0.getBounds(); - if (gcBounds.contains(p)) return gcBounds; + if (gcBounds.contains(p)) { + return getAvailableScreenArea(gcBounds, element0); + } } } @@ -222,13 +214,24 @@ class AquaComboBoxPopup extends BasicComboPopup { final GraphicsConfiguration[] gc = gd.getConfigurations(); for (final GraphicsConfiguration element0 : gc) { final Rectangle gcBounds = element0.getBounds(); - if (gcBounds.intersects(comboBoxBounds)) return gcBounds; + if (gcBounds.intersects(comboBoxBounds)) { + if (gcBounds.contains(p)) { + return getAvailableScreenArea(gcBounds, element0); + } + } } } return null; } + private Rectangle getAvailableScreenArea(Rectangle bounds, + GraphicsConfiguration gc) { + Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(gc); + return new Rectangle(0, insets.top, bounds.width, + bounds.height - insets.top); + } + @Override protected Rectangle computePopupBounds(int px, int py, int pw, int ph) { final int itemCount = comboBox.getModel().getSize(); From 968c43c3fa383d9648b7c984711db7ff28531ad7 Mon Sep 17 00:00:00 2001 From: Semyon Sadetsky Date: Wed, 16 Sep 2015 10:05:34 +0300 Subject: [PATCH 02/81] 8133803: Swing JFileChooserBug2 test fais with MotifLookAndFeel Reviewed-by: alexsch, serb --- .../com/sun/java/swing/plaf/motif/MotifFileChooserUI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java index d00a6ec6767..fcb9e724feb 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java @@ -306,7 +306,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI { } @SuppressWarnings("serial") // anonymous class - JTextField tmp1 = new JTextField(curDirName) { + JTextField tmp1 = new JTextField(curDirName, 35) { public Dimension getMaximumSize() { Dimension d = super.getMaximumSize(); d.height = getPreferredSize().height; @@ -420,7 +420,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI { interior.add(fileNameLabel); @SuppressWarnings("serial") // anonymous class - JTextField tmp3 = new JTextField() { + JTextField tmp3 = new JTextField(35) { public Dimension getMaximumSize() { Dimension d = super.getMaximumSize(); d.height = getPreferredSize().height; From 31f16f421ed5da76c36fe02a923d0db80974f288 Mon Sep 17 00:00:00 2001 From: Semyon Sadetsky Date: Wed, 16 Sep 2015 10:11:14 +0300 Subject: [PATCH 03/81] 8133108: [PIT] Container size is wrong in JEditorPane Reviewed-by: alexsch, azvegint --- .../swing/plaf/basic/BasicTextFieldUI.java | 8 +- .../classes/javax/swing/text/GlyphView.java | 5 - .../JTextPane/JTextPaneDocumentWrapping.java | 101 ++++++++++++++++++ 3 files changed, 108 insertions(+), 6 deletions(-) create mode 100644 jdk/test/javax/swing/JTextPane/JTextPaneDocumentWrapping.java diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java index 1db0d09a875..f71eb5f9ff0 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java @@ -97,7 +97,13 @@ public class BasicTextFieldUI extends BasicTextUI { String kind = elem.getName(); if (kind != null) { if (kind.equals(AbstractDocument.ContentElementName)) { - return new GlyphView(elem); + return new GlyphView(elem){ + @Override + public float getMinimumSpan(int axis) { + // no wrap + return getPreferredSpan(axis); + } + }; } else if (kind.equals(AbstractDocument.ParagraphElementName)) { return new I18nFieldView(elem); } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphView.java b/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphView.java index 31eb62d5d6b..d29b56bde19 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphView.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphView.java @@ -550,11 +550,6 @@ public class GlyphView extends View implements TabableView, Cloneable { */ @Override public float getMinimumSpan(int axis) { - int w = getResizeWeight(axis); - if (w == 0) { - // can't resize - return getPreferredSpan(axis); - } switch (axis) { case View.X_AXIS: if (minimumSpan < 0) { diff --git a/jdk/test/javax/swing/JTextPane/JTextPaneDocumentWrapping.java b/jdk/test/javax/swing/JTextPane/JTextPaneDocumentWrapping.java new file mode 100644 index 00000000000..ba7aee423ed --- /dev/null +++ b/jdk/test/javax/swing/JTextPane/JTextPaneDocumentWrapping.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 8133108 + @summary [PIT] Container size is wrong in JEditorPane + @author Semyon Sadetsky + */ + +import javax.swing.*; +import javax.swing.text.BadLocationException; +import javax.swing.text.SimpleAttributeSet; +import javax.swing.text.html.CSS; +import java.awt.*; + +public class JTextPaneDocumentWrapping { + + private static JFrame frame; + private static JTextPane jTextPane; + private static int position; + + public static void main(String[] args) throws Exception{ + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + frame = new JFrame(); + frame.setUndecorated(true); + frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + frame.setSize(200, 200); + jTextPane = new JTextPane(); + jTextPane.setContentType("text/html"); + jTextPane.setText( + "Test Test Test Test Test Test " + + "Test Test Test Test Test Test Test Test Test Test " + + "Test Test Test Test Test Test Test Test Test Test" + + ""); + frame.getContentPane().add(jTextPane); + frame.setVisible(true); + } + }); + Robot robot = new Robot(); + robot.waitForIdle(); + robot.delay(200); + + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + try { + position = jTextPane.modelToView(100).y; + SimpleAttributeSet wrap = new SimpleAttributeSet(); + wrap.addAttribute(CSS.Attribute.WHITE_SPACE, "nowrap"); + jTextPane.getStyledDocument() + .setParagraphAttributes(0, 10, wrap, true); + } catch (BadLocationException e) { + e.printStackTrace(); + } + } + }); + if(position < 40) { + throw new RuntimeException("Text is not wrapped " + position); + } + robot.waitForIdle(); + robot.delay(200); + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + try { + position = jTextPane.modelToView(100).y; + } catch (BadLocationException e) { + e.printStackTrace(); + } + frame.dispose(); + } + }); + if(position > 20) { + throw new RuntimeException("Text is wrapped " + position); + } + System.out.println("ok"); + + } +} From 265ab8bd4cd608e8ce6eb4c774692135e7ddbb97 Mon Sep 17 00:00:00 2001 From: Semyon Sadetsky Date: Wed, 16 Sep 2015 10:16:16 +0300 Subject: [PATCH 04/81] 8130471: [Regression] Test java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Extra.java fails Reviewed-by: alexsch, serb --- .../unix/classes/sun/awt/X11/XWindow.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java index 7ba27919fd8..f48ec9cc114 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java @@ -572,6 +572,14 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { } static int getModifiers(int state, int button, int keyCode) { + return getModifiers(state, button, keyCode, false); + } + + static int getWheelModifiers(int state, int button) { + return getModifiers(state, button, 0, true); + } + + private static int getModifiers(int state, int button, int keyCode, boolean isWheelMouse) { int modifiers = 0; if (((state & XConstants.ShiftMask) != 0) ^ (keyCode == KeyEvent.VK_SHIFT)) { @@ -602,7 +610,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { // ONLY one of these conditions should be TRUE to add that modifier. if (((state & XlibUtil.getButtonMask(i + 1)) != 0) != (button == XConstants.buttons[i])){ //exclude wheel buttons from adding their numbers as modifiers - if (!isWheel(XConstants.buttons[i])) { + if (!isWheelMouse || !isWheel(XConstants.buttons[i])) { modifiers |= InputEvent.getMaskForButton(i+1); } } @@ -715,9 +723,9 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { if (button > XConstants.buttons[4]){ button -= 2; } - modifiers = getModifiers(xbe.get_state(),button,0); if (!isWheel(lbutton)) { + modifiers = getModifiers(xbe.get_state(), button, 0); MouseEvent me = new MouseEvent(getEventSource(), type == XConstants.ButtonPress ? MouseEvent.MOUSE_PRESSED : MouseEvent.MOUSE_RELEASED, jWhen,modifiers, x, y, @@ -743,6 +751,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { } else { + modifiers = getWheelModifiers(xbe.get_state(), button); if (xev.get_type() == XConstants.ButtonPress) { MouseWheelEvent mwe = new MouseWheelEvent(getEventSource(),MouseEvent.MOUSE_WHEEL, jWhen, modifiers, From ffb466574f592e61bbd20492d4cfd893cef523da Mon Sep 17 00:00:00 2001 From: Semyon Sadetsky Date: Wed, 16 Sep 2015 10:22:42 +0300 Subject: [PATCH 05/81] 8014725: closed/java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.html failed intermittently Reviewed-by: alexsch, azvegint --- .../sun/awt/datatransfer/DataTransferer.java | 14 +- .../HTMLTransferTest/HTMLTransferTest.html | 44 + .../HTMLTransferTest/HTMLTransferTest.java | 767 ++++++++++++++++++ 3 files changed, 815 insertions(+), 10 deletions(-) create mode 100644 jdk/test/java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.html create mode 100644 jdk/test/java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.java diff --git a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java index 007102641bc..9808a3af3be 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, 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 @@ -938,15 +938,9 @@ search: try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) { try (InputStream is = (InputStream)obj) { - boolean eof = false; - int avail = is.available(); - byte[] tmp = new byte[avail > 8192 ? avail : 8192]; - do { - int aValue; - if (!(eof = (aValue = is.read(tmp, 0, tmp.length)) == -1)) { - bos.write(tmp, 0, aValue); - } - } while (!eof); + is.mark(Integer.MAX_VALUE); + is.transferTo(bos); + is.reset(); } if (DataFlavorUtil.isFlavorCharsetTextType(flavor) && isTextFormat(format)) { diff --git a/jdk/test/java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.html b/jdk/test/java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.html new file mode 100644 index 00000000000..c9f72366677 --- /dev/null +++ b/jdk/test/java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.html @@ -0,0 +1,44 @@ + + + + + + + + + + +

HTMLTransferTest
Bug ID: 6392086

+ +

This is an AUTOMATIC test, simply wait for completion

+ + + + diff --git a/jdk/test/java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.java b/jdk/test/java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.java new file mode 100644 index 00000000000..980816e41ef --- /dev/null +++ b/jdk/test/java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.java @@ -0,0 +1,767 @@ +/* + * Copyright (c) 2015 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @bug 6392086 8014725 + @summary Tests basic DnD functionality in an applet + @author Alexey Utkin, Semyon Sadetsky + @run applet HTMLTransferTest.html +*/ + +/** + * HTMLTransferTest.java + * + * summary: tests that HTMLs of all supported native HTML formats + * are transfered properly + */ + +import java.applet.Applet; +import java.awt.*; +import java.awt.datatransfer.*; +import java.io.*; + + +public class HTMLTransferTest extends Applet { + public static final int CODE_NOT_RETURNED = 100; + public static final int CODE_CONSUMER_TEST_FAILED = 101; + public static final int CODE_FAILURE = 102; + public static DataFlavor[] HTMLFlavors = null; + public static DataFlavor SyncFlavor = null; + static { + try{ + HTMLFlavors = new DataFlavor[] { + new DataFlavor("text/html; document=selection; Class=" + InputStream.class.getName() + "; charset=UTF-8"), + new DataFlavor("text/html; document=selection; Class=" + String.class.getName() + "; charset=UTF-8") + }; + SyncFlavor = new DataFlavor( + "application/x-java-serialized-object; class=" + + SyncMessage.class.getName() + + "; charset=UTF-8" + ); + }catch(Exception e){ + e.printStackTrace(); + } + } + + private THTMLProducer imPr; + private int returnCode = CODE_NOT_RETURNED; + + public void init() { + initImpl(); + + String[] instructions = + { + "This is an AUTOMATIC test", + "simply wait until it is done" + }; + Sysout.createDialog( ); + Sysout.printInstructions( instructions ); + + } // init() + + private void initImpl() { + imPr = new THTMLProducer(); + imPr.begin(); + } + + + public void start() { + try { + String stFormats = ""; + + String iniMsg = "Testing formats from the list:\n"; + for (int i = 0; i < HTMLTransferTest.HTMLFlavors.length; i++) { + stFormats += "\"" + HTMLTransferTest.HTMLFlavors[i].getMimeType() + "\"\n"; + } + Sysout.println(iniMsg + stFormats); + System.err.println("===>" + iniMsg + stFormats); + + String javaPath = System.getProperty("java.home", ""); + String cmd = javaPath + File.separator + "bin" + File.separator + + "java -cp " + System.getProperty("test.classes", ".") + + //+ "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 " + " THTMLConsumer" + //+ stFormats + ; + + Process process = Runtime.getRuntime().exec(cmd); + ProcessResults pres = ProcessResults.doWaitFor(process); + returnCode = pres.exitValue; + + if (pres.stderr != null && pres.stderr.length() > 0) { + System.err.println("========= Child VM System.err ========"); + System.err.print(pres.stderr); + System.err.println("======================================"); + } + + if (pres.stdout != null && pres.stdout.length() > 0) { + System.err.println("========= Child VM System.out ========"); + System.err.print(pres.stdout); + System.err.println("======================================"); + } + } catch (Throwable e) { + e.printStackTrace(); + //returnCode equals CODE_NOT_RETURNED + } + + switch (returnCode) { + case CODE_NOT_RETURNED: + System.err.println("Child VM: failed to start"); + break; + case CODE_FAILURE: + System.err.println("Child VM: abnormal termination"); + break; + case CODE_CONSUMER_TEST_FAILED: + throw new RuntimeException("test failed: HTMLs in some " + + "native formats are not transferred properly: " + + "see output of child VM"); + default: + boolean failed = false; + String passedFormats = ""; + String failedFormats = ""; + + for (int i = 0; i < imPr.passedArray.length; i++) { + if (imPr.passedArray[i]) { + passedFormats += HTMLTransferTest.HTMLFlavors[i].getMimeType() + " "; + } else { + failed = true; + failedFormats += HTMLTransferTest.HTMLFlavors[i].getMimeType() + " "; + } + } + if (failed) { + throw new RuntimeException( + "test failed: HTMLs in following " + + "native formats are not transferred properly: " + + failedFormats + ); + } else { + System.err.println( + "HTMLs in following native formats are " + + "transferred properly: " + + passedFormats + ); + } + } + + } // start() + +} // class HTMLTransferTest + +class SyncMessage implements Serializable { + String msg; + + public SyncMessage(String sync) { + this.msg = sync; + } + + @Override + public boolean equals(Object obj) { + return this.msg.equals(((SyncMessage)obj).msg); + } + + @Override + public String toString() { + return msg; + } +} + +class ProcessResults { + public int exitValue; + public String stdout; + public String stderr; + + public ProcessResults() { + exitValue = -1; + stdout = ""; + stderr = ""; + } + + /** + * Method to perform a "wait" for a process and return its exit value. + * This is a workaround for Process.waitFor() never returning. + */ + public static ProcessResults doWaitFor(Process p) { + ProcessResults pres = new ProcessResults(); + + InputStream in = null; + InputStream err = null; + + try { + in = p.getInputStream(); + err = p.getErrorStream(); + + boolean finished = false; + + while (!finished) { + try { + while (in.available() > 0) { + pres.stdout += (char)in.read(); + } + while (err.available() > 0) { + pres.stderr += (char)err.read(); + } + // Ask the process for its exitValue. If the process + // is not finished, an IllegalThreadStateException + // is thrown. If it is finished, we fall through and + // the variable finished is set to true. + pres.exitValue = p.exitValue(); + finished = true; + } + catch (IllegalThreadStateException e) { + // Process is not finished yet; + // Sleep a little to save on CPU cycles + Thread.currentThread().sleep(500); + } + } + if (in != null) in.close(); + if (err != null) err.close(); + } + catch (Throwable e) { + System.err.println("doWaitFor(): unexpected exception"); + e.printStackTrace(); + } + return pres; + } +} + + +abstract class HTMLTransferer implements ClipboardOwner { + + static final SyncMessage S_PASSED = new SyncMessage("Y"); + static final SyncMessage S_FAILED = new SyncMessage("N"); + static final SyncMessage S_BEGIN = new SyncMessage("B"); + static final SyncMessage S_BEGIN_ANSWER = new SyncMessage("BA"); + static final SyncMessage S_END = new SyncMessage("E"); + + + + Clipboard m_clipboard; + + HTMLTransferer() { + m_clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + } + + + abstract void notifyTransferSuccess(boolean status); + + + static Object createTRInstance(int i) { + try{ + String _htmlText = + "The quick brown mouse jumped over the lazy cat."; + switch(i){ + case 0: + return new ByteArrayInputStream(_htmlText.getBytes("utf-8")); + case 1: + return _htmlText; + } + }catch(UnsupportedEncodingException e){ e.printStackTrace(); } + return null; + } + + static byte[] getContent(InputStream is) + { + ByteArrayOutputStream tmp = new ByteArrayOutputStream(); + try{ + int read; + while( -1 != (read = is.read()) ){ + tmp.write(read); + }; + } catch( IOException e ) { + e.printStackTrace(); + } + return tmp.toByteArray(); + } + + static void Dump(byte[] b){ + System.err.println( new String(b) ); + }; + + void setClipboardContents( + Transferable contents, + ClipboardOwner owner + ) { + synchronized (m_clipboard) { + boolean set = false; + while (!set) { + try { + m_clipboard.setContents(contents, owner); + set = true; + } catch (IllegalStateException ise) { + try { + Thread.sleep(100); + } catch(InterruptedException e) { + e.printStackTrace(); + } + } + } + } + } + + Transferable getClipboardContents(Object requestor) + { + synchronized (m_clipboard) { + while (true) { + try { + Transferable t = m_clipboard.getContents(requestor); + return t; + } catch (IllegalStateException ise) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + } + } + +} + + +class THTMLProducer extends HTMLTransferer { + + boolean[] passedArray; + int fi = 0; // next format index + private boolean isFirstCallOfLostOwnership = true; + + THTMLProducer() { + passedArray = new boolean[HTMLTransferTest.HTMLFlavors.length]; + } + + void begin() { + setClipboardContents( + new HTMLSelection( + HTMLTransferTest.SyncFlavor, + S_BEGIN + ), + this + ); + } + + public void lostOwnership(Clipboard cb, Transferable contents) { + System.err.println("{PRODUCER: lost clipboard ownership"); + Transferable t = getClipboardContents(null); + if (t.isDataFlavorSupported(HTMLTransferTest.SyncFlavor)) { + SyncMessage msg = null; + // for test going on if t.getTransferData() will throw an exception + if (isFirstCallOfLostOwnership) { + isFirstCallOfLostOwnership = false; + msg = S_BEGIN_ANSWER; + } else { + msg = S_PASSED; + } + try { + msg = (SyncMessage)t.getTransferData(HTMLTransferTest.SyncFlavor); + System.err.println("++received message: " + msg); + } catch (Exception e) { + System.err.println("Can't getTransferData-message: " + e); + } + if( msg.equals(S_PASSED) ){ + notifyTransferSuccess(true); + } else if( msg.equals(S_FAILED) ){ + notifyTransferSuccess(false); + } else if (!msg.equals(S_BEGIN_ANSWER)) { + throw new RuntimeException("wrong message in " + + "THTMLProducer.lostOwnership(): " + msg + + " (possibly due to bug 4683804)"); + } + } else { + throw new RuntimeException( + "DataFlavor.stringFlavor is not " + + "suppurted by transferable in " + + "THTMLProducer.lostOwnership()" + ); + } + + if (fi < HTMLTransferTest.HTMLFlavors.length) { + System.err.println( + "testing native HTML format \"" + + HTMLTransferTest.HTMLFlavors[fi].getMimeType() + + "\"..." + ); + //leaveFormat( HTMLTransferTest.HTMLFlavors[fi].getMimeType() ); + setClipboardContents( + new HTMLSelection( + HTMLTransferTest.HTMLFlavors[fi], + HTMLTransferer.createTRInstance(fi) + ), + this + ); + } else { + setClipboardContents( + new HTMLSelection( + HTMLTransferTest.SyncFlavor, + S_END + ), + null + ); + } + System.err.println("}PRODUCER: lost clipboard ownership"); + } + + + void notifyTransferSuccess(boolean status) { + passedArray[fi] = status; + fi++; + } + +} + + +class THTMLConsumer extends HTMLTransferer +{ + private static final Object LOCK = new Object(); + private static boolean failed; + int fi = 0; // next format index + + public void lostOwnership(Clipboard cb, Transferable contents) { + System.err.println("{CONSUMER: lost clipboard ownership"); + Transferable t = getClipboardContents(null); + boolean bContinue = true; + if(t.isDataFlavorSupported(HTMLTransferTest.SyncFlavor)) { + try { + SyncMessage msg = (SyncMessage)t.getTransferData(HTMLTransferTest.SyncFlavor); + System.err.println("received message: " + msg); + if(msg.equals(S_END)){ + synchronized (LOCK) { + LOCK.notifyAll(); + } + bContinue = false; + } + } catch (Exception e) { + System.err.println("Can't getTransferData-message: " + e); + } + } + if(bContinue){ + // all HTML formats have been processed + System.err.println( "============================================================"); + System.err.println( "Put as " + HTMLTransferTest.HTMLFlavors[fi].getMimeType() ); + boolean bSuccess = false; + for(int i = 0; i < HTMLTransferTest.HTMLFlavors.length; ++i) { + System.err.println( "----------------------------------------------------------"); + if( t.isDataFlavorSupported(HTMLTransferTest.HTMLFlavors[i]) ){ + Object im = null; //? HTML; + try { + im = t.getTransferData(HTMLTransferTest.HTMLFlavors[i]); + if (im == null) { + System.err.println("getTransferData returned null"); + } else { + System.err.println( "Extract as " + HTMLTransferTest.HTMLFlavors[i].getMimeType() ); + String stIn = "(unknown)", stOut = "(unknown)"; + switch( i ){ + case 0: + stIn = new String( getContent( (InputStream)HTMLTransferer.createTRInstance(i) ) ); + stOut = new String( getContent((InputStream)im) ); + bSuccess = stIn.equals(stOut); + break; + case 1: + stIn = (String)HTMLTransferer.createTRInstance(i); + stOut = (String)im; + int head = stOut.indexOf(""); + if (head >= 0) { + stOut = stOut.substring(head + 12, stOut.length() - 14); + } + bSuccess = stIn.equals(stOut); + break; + default: + bSuccess = HTMLTransferer.createTRInstance(i).equals(im); + break; + }; + System.err.println("in :" + stIn); + System.err.println("out:" + stOut); + }; + } catch (Exception e) { + System.err.println("Can't getTransferData: " + e); + } + if(!bSuccess) + System.err.println("transferred DATA is different from initial DATA\n"); + } else { + System.err.println("Flavor is not supported by transferable:\n"); + DataFlavor[] dfs = t.getTransferDataFlavors(); + int ii; + for(ii = 0; ii < dfs.length; ++ii) + System.err.println("Supported:" + dfs[ii] + "\n"); + dfs = HTMLTransferTest.HTMLFlavors; + for(ii = 0; ii < dfs.length; ++ii) + System.err.println("Accepted:" + dfs[ii] + "\n" ); + } + } + System.err.println( "----------------------------------------------------------"); + notifyTransferSuccess(bSuccess); + System.err.println( "============================================================"); + ++fi; + } + System.err.println("}CONSUMER: lost clipboard ownership"); + } + + + void notifyTransferSuccess(boolean status) { + System.err.println( + "format " + + (status + ? "passed" + : "failed" + ) + + "!!!" + ); + setClipboardContents( + new HTMLSelection( + HTMLTransferTest.SyncFlavor, + status + ? S_PASSED + : S_FAILED + ), + this + ); + } + + + public static void main(String[] args) { + try { + System.err.println("{CONSUMER: start"); + THTMLConsumer ic = new THTMLConsumer(); + ic.setClipboardContents( + new HTMLSelection( + HTMLTransferTest.SyncFlavor, + S_BEGIN_ANSWER + ), + ic + ); + synchronized (LOCK) { + LOCK.wait(); + } + System.err.println("}CONSUMER: start"); + } catch (Throwable e) { + e.printStackTrace(); + System.exit(HTMLTransferTest.CODE_FAILURE); + } + } + +} + + +/** + * A Transferable which implements the capability required + * to transfer an HTML. + * + * This Transferable properly supports + * HTMLTransferTest.HTMLFlavors. + * and all equivalent flavors. + * No other DataFlavors are supported. + * + * @see java.awt.datatransfer.HTMLTransferTest.HTMLFlavors + */ +class HTMLSelection implements Transferable { + private DataFlavor m_flavor; + private Object m_data; + + /** + * Creates a Transferable capable of transferring + * the specified String. + */ + public HTMLSelection( + DataFlavor flavor, + Object data + ){ + m_flavor = flavor; + m_data = data; + } + + /** + * Returns an array of flavors in which this Transferable + * can provide the data. DataFlavor.stringFlavor + * is properly supported. + * Support for DataFlavor.plainTextFlavor is + * deprecated. + * + * @return an array of length one, whose element is DataFlavor. + * HTMLTransferTest.HTMLFlavors + */ + public DataFlavor[] getTransferDataFlavors() { + // returning flavors itself would allow client code to modify + // our internal behavior + return new DataFlavor[]{ m_flavor } ; + } + + /** + * Returns whether the requested flavor is supported by this + * Transferable. + * + * @param flavor the requested flavor for the data + * @return true if flavor is equal to + * HTMLTransferTest.HTMLFlavors; + * false if flavor + * is not one of the above flavors + * @throws NullPointerException if flavor is null + */ + public boolean isDataFlavorSupported(DataFlavor flavor) { + System.err.println("Have:" + flavor + " Can:" + m_flavor); + if(flavor.equals(m_flavor)) + return true; + return false; + } + + /** + * Returns the Transferable's data in the requested + * DataFlavor if possible. If the desired flavor is + * HTMLTransferTest.HTMLFlavors, or an equivalent flavor, + * the HTML representing the selection is + * returned. + * + * @param flavor the requested flavor for the data + * @return the data in the requested flavor, as outlined above + * @throws UnsupportedFlavorException if the requested data flavor is + * not equivalent to HTMLTransferTest.HTMLFlavors + * @throws IOException if an IOException occurs while retrieving the data. + * By default, HTMLSelection never throws + * this exception, but a subclass may. + * @throws NullPointerException if flavor is null + */ + public Object getTransferData(DataFlavor flavor) + throws UnsupportedFlavorException, IOException + { + if (flavor.equals(m_flavor)) { + return (Object)m_data; + } else { + throw new UnsupportedFlavorException(flavor); + } + } + +} // class HTMLSelection + + +/**************************************************** + Standard Test Machinery + DO NOT modify anything below -- it's a standard + chunk of code whose purpose is to make user + interaction uniform, and thereby make it simpler + to read and understand someone else's test. + ****************************************************/ +class Sysout + { + private static TestDialog dialog; + + public static void createDialogWithInstructions( String[] instructions ) + { + dialog = new TestDialog( new Frame(), "Instructions" ); + dialog.printInstructions( instructions ); + dialog.show(); + println( "Any messages for the tester will display here." ); + } + + public static void createDialog( ) + { + dialog = new TestDialog( new Frame(), "Instructions" ); + String[] defInstr = { "Instructions will appear here. ", "" } ; + dialog.printInstructions( defInstr ); + dialog.show(); + println( "Any messages for the tester will display here." ); + } + + + public static void printInstructions( String[] instructions ) + { + dialog.printInstructions( instructions ); + } + + + public static void println( String messageIn ) + { + dialog.displayMessage( messageIn ); + } + + }// Sysout class + +class TestDialog extends Dialog + { + + TextArea instructionsText; + TextArea messageText; + int maxStringLength = 80; + + //DO NOT call this directly, go through Sysout + public TestDialog( Frame frame, String name ) + { + super( frame, name ); + int scrollBoth = TextArea.SCROLLBARS_BOTH; + instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); + add( "North", instructionsText ); + + messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); + add("South", messageText); + + pack(); + + show(); + }// TestDialog() + + //DO NOT call this directly, go through Sysout + public void printInstructions( String[] instructions ) + { + //Clear out any current instructions + instructionsText.setText( "" ); + + //Go down array of instruction strings + + String printStr, remainingStr; + for( int i=0; i < instructions.length; i++ ) + { + //chop up each into pieces maxSringLength long + remainingStr = instructions[ i ]; + while( remainingStr.length() > 0 ) + { + //if longer than max then chop off first max chars to print + if( remainingStr.length() >= maxStringLength ) + { + //Try to chop on a word boundary + int posOfSpace = remainingStr. + lastIndexOf(' ', maxStringLength - 1); + + if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; + + printStr = remainingStr.substring( 0, posOfSpace + 1 ); + remainingStr = remainingStr.substring( posOfSpace + 1 ); + } + //else just print + else + { + printStr = remainingStr; + remainingStr = ""; + } + + instructionsText.append( printStr + "\n" ); + + }// while + + }// for + + }//printInstructions() + + //DO NOT call this directly, go through Sysout + public void displayMessage( String messageIn ) + { + messageText.append( messageIn + "\n" ); + } + + }// TestDialog class From 450cdf7f65cdc6332b4b9ce74fda32d90e04ca29 Mon Sep 17 00:00:00 2001 From: Semyon Sadetsky Date: Wed, 16 Sep 2015 10:32:46 +0300 Subject: [PATCH 06/81] 8131670: [TEST_BUG]Test java/awt/EventQueue/6980209/bug6980209.java fails on Linux Reviewed-by: alexsch, serb --- .../awt/EventQueue/6980209/bug6980209.java | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/jdk/test/java/awt/EventQueue/6980209/bug6980209.java b/jdk/test/java/awt/EventQueue/6980209/bug6980209.java index 0f1080cba02..02520034a18 100644 --- a/jdk/test/java/awt/EventQueue/6980209/bug6980209.java +++ b/jdk/test/java/awt/EventQueue/6980209/bug6980209.java @@ -29,6 +29,7 @@ import javax.swing.*; import java.awt.*; +import java.awt.event.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; @@ -47,6 +48,8 @@ public class bug6980209 implements ActionListener { private static Boolean enterReturn; private static Boolean exitReturn; private static int dispatchedEvents; + private static JButton button; + private static Point point; public static void main(String[] args) throws Exception { System.out.println( @@ -62,6 +65,23 @@ public class bug6980209 implements ActionListener { setup(frame); } }); + final Robot robot = new Robot(); + robot.delay(100); + robot.waitForIdle(); + robot.setAutoDelay(10); + robot.setAutoWaitForIdle(true); + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + point = button.getLocationOnScreen(); + } + }); + robot.mouseMove( point.x + 5, point.y + 5 ); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.delay(100); + robot.waitForIdle(); + testExitBeforeEnter(); System.out.println("Run random test in EDT"); runInEDT = true; @@ -102,6 +122,7 @@ public class bug6980209 implements ActionListener { private static void testRandomly() throws AWTException { disorderCounter = 0; final Robot robot = new Robot(); + robot.setAutoDelay(1); for (int i = 0; i < ATTEMPTS; i++) { enterReturn = null; exitReturn = null; @@ -156,14 +177,14 @@ public class bug6980209 implements ActionListener { } private static void setup(final JFrame frame) { - JButton jButton = new JButton("Button"); - frame.getContentPane().add(jButton); - jButton.addActionListener(new bug6980209()); + button = new JButton("Button"); + frame.getContentPane().add(button); + button.addActionListener(new bug6980209()); frame.pack(); frame.setVisible(true); - jButton.setFocusable(true); - jButton.requestFocus(); - jButton.addKeyListener(new KeyListener() { + button.setFocusable(true); + button.requestFocus(); + button.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { } From 0b454ad041f97dafc584e32072e502dd2044a573 Mon Sep 17 00:00:00 2001 From: Daniil Titov Date: Wed, 16 Sep 2015 18:34:38 +0300 Subject: [PATCH 07/81] 8134808: Remove support for serialized applets from java.desktop Reviewed-by: serb, azvegint --- .../share/classes/sun/applet/AppletPanel.java | 44 ++++--------------- 1 file changed, 8 insertions(+), 36 deletions(-) diff --git a/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java b/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java index 14023fcfa67..f2b0434090d 100644 --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java @@ -65,13 +65,6 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { */ Applet applet; - /** - * Applet will allow initialization. Should be - * set to false if loading a serialized applet - * that was pickled in the init=true state. - */ - protected boolean doInit = true; - /** * The classloader for the applet. @@ -141,7 +134,6 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { /* abstract classes */ abstract protected String getCode(); abstract protected String getJarFiles(); - abstract protected String getSerializedObject(); @Override abstract public int getWidth(); @@ -430,13 +422,12 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { break; } applet.resize(defaultAppletSize); - if (doInit) { - if (PerformanceLogger.loggingEnabled()) { - PerformanceLogger.setTime("Applet Init"); - PerformanceLogger.outputLog(); - } - applet.init(); + + if (PerformanceLogger.loggingEnabled()) { + PerformanceLogger.setTime("Applet Init"); + PerformanceLogger.outputLog(); } + applet.init(); //Need the default(fallback) font to be created in this AppContext Font f = getFont(); @@ -446,8 +437,6 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { setFont(new Font(Font.DIALOG, Font.PLAIN, 12)); } - doInit = true; // allow restarts - // Validate the applet in event dispatch thread // to avoid deadlock. try { @@ -786,34 +775,17 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { protected Applet createApplet(final AppletClassLoader loader) throws ClassNotFoundException, IllegalAccessException, IOException, InstantiationException, InterruptedException { - final String serName = getSerializedObject(); String code = getCode(); - if (code != null && serName != null) { - System.err.println(amh.getMessage("runloader.err")); -// return null; - throw new InstantiationException("Either \"code\" or \"object\" should be specified, but not both."); - } - if (code == null && serName == null) { + if (code != null) { + applet = (Applet)loader.loadCode(code).newInstance(); + } else { String msg = "nocode"; status = APPLET_ERROR; showAppletStatus(msg); showAppletLog(msg); repaint(); } - if (code != null) { - applet = (Applet)loader.loadCode(code).newInstance(); - doInit = true; - } else { - // serName is not null; - try (InputStream is = AccessController.doPrivileged( - (PrivilegedAction)() -> loader.getResourceAsStream(serName)); - ObjectInputStream ois = new AppletObjectInputStream(is, loader)) { - - applet = (Applet) ois.readObject(); - doInit = false; // skip over the first init - } - } // Determine the JDK level that the applet targets. // This is critical for enabling certain backward From 4560ea43051a60bea5512c6ec674af488ac8ab6b Mon Sep 17 00:00:00 2001 From: Phil Race Date: Sat, 19 Sep 2015 15:45:59 -0700 Subject: [PATCH 08/81] 8136783: Run blessed-modifier-order script on java.desktop Reviewed-by: martin, serb --- .../com/apple/eawt/_AppEventHandler.java | 2 +- .../classes/com/apple/eio/FileManager.java | 10 +- .../com/apple/laf/AquaButtonBorder.java | 6 +- .../apple/laf/AquaButtonExtendedTypes.java | 4 +- .../com/apple/laf/AquaButtonLabeledUI.java | 2 +- .../classes/com/apple/laf/AquaButtonUI.java | 2 +- .../com/apple/laf/AquaComboBoxButton.java | 8 +- .../com/apple/laf/AquaFileSystemModel.java | 4 +- .../classes/com/apple/laf/AquaIcon.java | 8 +- .../laf/AquaInternalFrameDockIconUI.java | 6 +- .../com/apple/laf/AquaKeyBindings.java | 2 +- .../classes/com/apple/laf/AquaRootPaneUI.java | 2 +- .../laf/AquaTabbedPaneCopyFromBasicUI.java | 28 ++-- .../com/apple/laf/AquaTableHeaderUI.java | 2 +- .../com/apple/laf/AquaUtilControlSize.java | 6 +- .../macosx/classes/sun/java2d/CRenderer.java | 2 +- .../sun/java2d/CompositeCRenderer.java | 4 +- .../classes/sun/java2d/OSXSurfaceData.java | 4 +- .../sun/java2d/opengl/CGLSurfaceData.java | 6 +- .../macosx/classes/sun/lwawt/LWToolkit.java | 16 +-- .../sun/lwawt/macosx/CAccessibility.java | 6 +- .../sun/lwawt/macosx/CDataTransferer.java | 2 +- .../sun/lwawt/macosx/CInputMethod.java | 26 ++-- .../sun/lwawt/macosx/CWarningWindow.java | 6 +- .../sun/lwawt/macosx/CocoaConstants.java | 72 +++++----- .../classes/sun/lwawt/macosx/LWCToolkit.java | 10 +- .../com/sun/beans/editors/NumberEditor.java | 2 +- .../com/sun/imageio/plugins/common/I18N.java | 2 +- .../plugins/common/LZWStringTable.java | 16 +-- .../imageio/plugins/jpeg/JPEGImageReader.java | 2 +- .../sun/java/swing/plaf/gtk/GTKEngine.java | 6 +- .../sun/java/swing/plaf/gtk/GTKPainter.java | 4 +- .../java/swing/plaf/motif/MotifBorders.java | 8 +- .../swing/plaf/motif/MotifCheckBoxUI.java | 2 +- .../swing/plaf/motif/MotifDesktopIconUI.java | 6 +- .../swing/plaf/motif/MotifIconFactory.java | 2 +- .../motif/MotifInternalFrameTitlePane.java | 2 +- .../swing/plaf/motif/MotifScrollPaneUI.java | 6 +- .../plaf/windows/AnimationController.java | 4 +- .../swing/plaf/windows/WindowsCheckBoxUI.java | 2 +- .../plaf/windows/WindowsFileChooserUI.java | 2 +- .../plaf/windows/WindowsIconFactory.java | 2 +- .../plaf/windows/WindowsLookAndFeel.java | 2 +- .../swing/plaf/windows/WindowsRootPaneUI.java | 2 +- .../swing/plaf/windows/WindowsTreeUI.java | 8 +- .../com/sun/media/sound/AuFileWriter.java | 2 +- .../sun/media/sound/AudioFloatConverter.java | 6 +- .../com/sun/media/sound/DLSRegion.java | 2 +- .../com/sun/media/sound/DLSSampleLoop.java | 4 +- .../com/sun/media/sound/DLSSoundbank.java | 2 +- .../sun/media/sound/EmergencySoundbank.java | 30 ++--- .../sun/media/sound/JavaSoundAudioClip.java | 4 +- .../media/sound/MidiOutDeviceProvider.java | 2 +- .../com/sun/media/sound/MidiUtils.java | 6 +- .../sun/media/sound/ModelConnectionBlock.java | 2 +- .../com/sun/media/sound/ModelTransform.java | 2 +- .../classes/com/sun/media/sound/Platform.java | 6 +- .../com/sun/media/sound/PortMixer.java | 2 +- .../sun/media/sound/RealTimeSequencer.java | 4 +- .../com/sun/media/sound/SF2Modulator.java | 36 ++--- .../com/sun/media/sound/SF2Region.java | 124 +++++++++--------- .../media/sound/SoftEnvelopeGenerator.java | 18 +-- .../com/sun/media/sound/SoftFilter.java | 14 +- .../com/sun/media/sound/SoftMainMixer.java | 28 ++-- .../sun/media/sound/SoftMixingMainMixer.java | 24 ++-- .../com/sun/media/sound/SoftReverb.java | 6 +- .../com/sun/media/sound/SoftSynthesizer.java | 2 +- .../media/sound/StandardMidiFileWriter.java | 2 +- .../com/sun/media/sound/UlawCodec.java | 4 +- .../share/classes/java/applet/Applet.java | 4 +- .../share/classes/java/awt/AWTEvent.java | 42 +++--- .../share/classes/java/awt/BasicStroke.java | 12 +- .../share/classes/java/awt/Color.java | 52 ++++---- .../share/classes/java/awt/Component.java | 42 +++--- .../share/classes/java/awt/Container.java | 4 +- .../ContainerOrderFocusTraversalPolicy.java | 8 +- .../share/classes/java/awt/Cursor.java | 4 +- .../share/classes/java/awt/Dialog.java | 4 +- .../share/classes/java/awt/DisplayMode.java | 4 +- .../share/classes/java/awt/EventQueue.java | 2 +- .../classes/java/awt/GraphicsDevice.java | 6 +- .../java/awt/KeyboardFocusManager.java | 6 +- .../share/classes/java/awt/List.java | 2 +- .../share/classes/java/awt/MenuComponent.java | 4 +- .../classes/java/awt/RenderingHints.java | 2 +- .../classes/java/awt/SequencedEvent.java | 6 +- .../share/classes/java/awt/SplashScreen.java | 18 +-- .../share/classes/java/awt/SystemColor.java | 106 +++++++-------- .../share/classes/java/awt/SystemTray.java | 2 +- .../share/classes/java/awt/TextComponent.java | 2 +- .../classes/java/awt/TexturePaintContext.java | 8 +- .../share/classes/java/awt/Toolkit.java | 4 +- .../share/classes/java/awt/Transparency.java | 6 +- .../share/classes/java/awt/TrayIcon.java | 2 +- .../classes/java/awt/WaitDispatchSupport.java | 4 +- .../share/classes/java/awt/Window.java | 2 +- .../java/awt/dnd/DropTargetDropEvent.java | 2 +- .../awt/dnd/InvalidDnDOperationException.java | 2 +- .../classes/java/awt/event/MouseEvent.java | 2 +- .../share/classes/java/awt/font/OpenType.java | 102 +++++++------- .../share/classes/java/awt/geom/Arc2D.java | 6 +- .../share/classes/java/awt/geom/Path2D.java | 2 +- .../java/awt/im/InputMethodHighlight.java | 12 +- .../classes/java/awt/image/BufferedImage.java | 2 +- .../classes/java/awt/image/ColorModel.java | 8 +- .../java/awt/image/DirectColorModel.java | 26 ++-- .../java/awt/image/IndexColorModel.java | 26 ++-- .../share/classes/java/awt/image/Kernel.java | 10 +- .../java/awt/image/PackedColorModel.java | 10 +- .../share/classes/java/awt/image/Raster.java | 20 +-- .../classes/java/awt/image/RescaleOp.java | 6 +- .../classes/java/awt/image/SampleModel.java | 10 +- .../share/classes/java/beans/BeanInfo.java | 8 +- .../classes/java/beans/Introspector.java | 8 +- .../share/classes/java/beans/MetaData.java | 4 +- .../javax/accessibility/AccessibleRole.java | 4 +- .../javax/accessibility/AccessibleState.java | 2 +- .../metadata/IIOMetadataFormatImpl.java | 2 +- .../print/attribute/standard/MediaSize.java | 10 +- .../classes/javax/sound/midi/MetaMessage.java | 2 +- .../javax/swing/AbstractCellEditor.java | 2 +- .../classes/javax/swing/BorderFactory.java | 2 +- .../javax/swing/DefaultButtonModel.java | 10 +- .../javax/swing/DefaultDesktopManager.java | 8 +- .../classes/javax/swing/GroupLayout.java | 2 +- .../share/classes/javax/swing/ImageIcon.java | 10 +- .../share/classes/javax/swing/JComponent.java | 10 +- .../classes/javax/swing/JEditorPane.java | 2 +- .../javax/swing/JFormattedTextField.java | 4 +- .../classes/javax/swing/JInternalFrame.java | 24 ++-- .../classes/javax/swing/JLayeredPane.java | 14 +- .../share/classes/javax/swing/JList.java | 4 +- .../classes/javax/swing/JOptionPane.java | 10 +- .../share/classes/javax/swing/JPopupMenu.java | 2 +- .../classes/javax/swing/JProgressBar.java | 6 +- .../share/classes/javax/swing/JSplitPane.java | 28 ++-- .../share/classes/javax/swing/JTable.java | 14 +- .../share/classes/javax/swing/JToolBar.java | 2 +- .../share/classes/javax/swing/JTree.java | 48 +++---- .../share/classes/javax/swing/JViewport.java | 2 +- .../share/classes/javax/swing/RowFilter.java | 4 +- .../swing/SortingFocusTraversalPolicy.java | 8 +- .../classes/javax/swing/SwingWorker.java | 2 +- .../share/classes/javax/swing/Timer.java | 6 +- .../share/classes/javax/swing/TimerQueue.java | 2 +- .../classes/javax/swing/TransferHandler.java | 2 +- .../share/classes/javax/swing/UIManager.java | 6 +- .../javax/swing/border/TitledBorder.java | 32 ++--- .../javax/swing/event/EventListenerList.java | 2 +- .../javax/swing/plaf/basic/BasicButtonUI.java | 2 +- .../swing/plaf/basic/BasicCheckBoxUI.java | 2 +- .../plaf/basic/BasicComboBoxRenderer.java | 2 +- .../swing/plaf/basic/BasicIconFactory.java | 2 +- .../javax/swing/plaf/basic/BasicListUI.java | 22 ++-- .../swing/plaf/basic/BasicRadioButtonUI.java | 2 +- .../swing/plaf/basic/BasicScrollBarUI.java | 2 +- .../swing/plaf/basic/BasicTabbedPaneUI.java | 28 ++-- .../swing/plaf/basic/BasicToggleButtonUI.java | 2 +- .../javax/swing/plaf/basic/BasicTreeUI.java | 10 +- .../swing/plaf/metal/MetalCheckBoxUI.java | 2 +- .../swing/plaf/metal/MetalFileChooserUI.java | 2 +- .../swing/plaf/metal/MetalIconFactory.java | 12 +- .../swing/plaf/metal/MetalToolBarUI.java | 6 +- .../swing/table/DefaultTableColumnModel.java | 2 +- .../javax/swing/table/JTableHeader.java | 6 +- .../javax/swing/table/TableColumn.java | 10 +- .../javax/swing/text/AbstractDocument.java | 10 +- .../javax/swing/text/AbstractWriter.java | 2 +- .../javax/swing/text/DefaultCaret.java | 8 +- .../javax/swing/text/DefaultHighlighter.java | 2 +- .../swing/text/DefaultStyledDocument.java | 2 +- .../javax/swing/text/DocumentFilter.java | 2 +- .../classes/javax/swing/text/GapContent.java | 2 +- .../classes/javax/swing/text/GlyphView.java | 2 +- .../javax/swing/text/LayeredHighlighter.java | 2 +- .../javax/swing/text/NavigationFilter.java | 2 +- .../javax/swing/text/ParagraphView.java | 8 +- .../classes/javax/swing/text/TableView.java | 2 +- .../classes/javax/swing/text/html/CSS.java | 2 +- .../javax/swing/text/html/CSSBorder.java | 10 +- .../javax/swing/text/html/FormView.java | 2 +- .../javax/swing/text/html/HTMLDocument.java | 2 +- .../javax/swing/text/html/HTMLEditorKit.java | 6 +- .../classes/javax/swing/text/html/Map.java | 2 +- .../javax/swing/text/html/StyleSheet.java | 2 +- .../javax/swing/text/html/TableView.java | 2 +- .../javax/swing/text/rtf/RTFAttributes.java | 2 +- .../javax/swing/text/rtf/RTFGenerator.java | 18 +-- .../javax/swing/text/rtf/RTFReader.java | 4 +- .../javax/swing/tree/AbstractLayoutCache.java | 2 +- .../swing/tree/DefaultMutableTreeNode.java | 4 +- .../swing/tree/DefaultTreeCellEditor.java | 2 +- .../swing/tree/DefaultTreeCellRenderer.java | 6 +- .../swing/tree/DefaultTreeSelectionModel.java | 2 +- .../share/classes/sun/applet/AppletPanel.java | 36 ++--- .../classes/sun/applet/AppletViewer.java | 2 +- .../share/classes/sun/awt/AppContext.java | 6 +- .../share/classes/sun/awt/DebugSettings.java | 6 +- .../classes/sun/awt/ExtendedKeyCodes.java | 6 +- .../share/classes/sun/awt/OSInfo.java | 2 +- .../share/classes/sun/awt/SunHints.java | 2 +- .../share/classes/sun/awt/SunToolkit.java | 4 +- .../share/classes/sun/awt/UngrabEvent.java | 2 +- .../sun/awt/datatransfer/DataTransferer.java | 4 +- .../sun/awt/dnd/SunDragSourceContextPeer.java | 12 +- .../sun/awt/dnd/SunDropTargetContextPeer.java | 8 +- .../share/classes/sun/awt/geom/AreaOp.java | 2 +- .../share/classes/sun/awt/geom/Crossings.java | 4 +- .../classes/sun/awt/im/CompositionArea.java | 10 +- .../sun/awt/im/InputMethodContext.java | 2 +- .../sun/awt/image/ByteComponentRaster.java | 2 +- .../sun/awt/image/BytePackedRaster.java | 2 +- .../classes/sun/awt/image/ImageCache.java | 2 +- .../sun/awt/image/ImageRepresentation.java | 2 +- .../classes/sun/awt/image/ImagingLib.java | 12 +- .../sun/awt/image/IntegerComponentRaster.java | 2 +- .../sun/awt/image/PNGImageDecoder.java | 8 +- .../sun/awt/image/ShortComponentRaster.java | 2 +- .../classes/sun/awt/image/SurfaceManager.java | 2 +- .../classes/sun/dc/DuctusRenderingEngine.java | 4 +- .../share/classes/sun/font/Type1Font.java | 4 +- .../classes/sun/java2d/NullSurfaceData.java | 2 +- .../sun/java2d/StateTrackableDelegate.java | 4 +- .../classes/sun/java2d/SunGraphics2D.java | 2 +- .../sun/java2d/SurfaceManagerFactory.java | 4 +- .../classes/sun/java2d/cmm/lcms/LCMS.java | 2 +- .../sun/java2d/loops/CompositeType.java | 2 +- .../sun/java2d/loops/DrawGlyphList.java | 4 +- .../sun/java2d/loops/DrawGlyphListAA.java | 4 +- .../sun/java2d/loops/DrawGlyphListLCD.java | 4 +- .../classes/sun/java2d/loops/DrawLine.java | 4 +- .../sun/java2d/loops/DrawParallelogram.java | 4 +- .../classes/sun/java2d/loops/DrawPath.java | 4 +- .../sun/java2d/loops/DrawPolygons.java | 4 +- .../classes/sun/java2d/loops/DrawRect.java | 4 +- .../sun/java2d/loops/FillParallelogram.java | 4 +- .../classes/sun/java2d/loops/FillPath.java | 4 +- .../classes/sun/java2d/loops/FillRect.java | 4 +- .../classes/sun/java2d/loops/FillSpans.java | 4 +- .../sun/java2d/loops/GraphicsPrimitive.java | 6 +- .../java2d/loops/GraphicsPrimitiveMgr.java | 10 +- .../classes/sun/java2d/loops/ProcessPath.java | 4 +- .../classes/sun/java2d/opengl/OGLPaints.java | 2 +- .../classes/sun/java2d/pipe/AAShapePipe.java | 4 +- .../classes/sun/java2d/pipe/LoopPipe.java | 2 +- .../sun/java2d/pipe/SpanShapeRenderer.java | 2 +- .../classes/sun/java2d/pisces/Renderer.java | 12 +- .../sun/print/CustomMediaSizeName.java | 2 +- .../classes/sun/print/CustomMediaTray.java | 2 +- .../classes/sun/print/PSStreamPrintJob.java | 6 +- .../share/classes/sun/print/PeekGraphics.java | 4 +- .../share/classes/sun/print/PrintJob2D.java | 30 ++--- .../classes/sun/print/RasterPrinterJob.java | 22 ++-- .../classes/sun/print/ServiceDialog.java | 6 +- .../share/classes/sun/swing/FilePane.java | 16 +-- .../share/classes/sun/swing/ImageCache.java | 10 +- .../swing/plaf/synth/SynthFileChooserUI.java | 4 +- .../plaf/synth/SynthFileChooserUIImpl.java | 2 +- .../unix/classes/sun/awt/X11/InfoWindow.java | 30 ++--- .../classes/sun/awt/X11/MWMConstants.java | 6 +- .../unix/classes/sun/awt/X11/XAwtState.java | 2 +- .../classes/sun/awt/X11/XBaseMenuWindow.java | 4 +- .../unix/classes/sun/awt/X11/XBaseWindow.java | 4 +- .../unix/classes/sun/awt/X11/XButtonPeer.java | 2 +- .../unix/classes/sun/awt/X11/XChoicePeer.java | 8 +- .../classes/sun/awt/X11/XComponentPeer.java | 6 +- .../unix/classes/sun/awt/X11/XConstants.java | 2 +- .../sun/awt/X11/XCursorFontConstants.java | 2 +- .../classes/sun/awt/X11/XDecoratedPeer.java | 2 +- .../sun/awt/X11/XDragAndDropProtocols.java | 4 +- .../sun/awt/X11/XDropTargetContextPeer.java | 2 +- .../classes/sun/awt/X11/XEmbedHelper.java | 54 ++++---- .../classes/sun/awt/X11/XFileDialogPeer.java | 4 +- .../unix/classes/sun/awt/X11/XIconWindow.java | 2 +- .../classes/sun/awt/X11/XLayerProtocol.java | 2 +- .../unix/classes/sun/awt/X11/XListPeer.java | 36 ++--- .../classes/sun/awt/X11/XMenuBarPeer.java | 18 +-- .../classes/sun/awt/X11/XMenuItemPeer.java | 4 +- .../unix/classes/sun/awt/X11/XMenuWindow.java | 20 +-- .../classes/sun/awt/X11/XNETProtocol.java | 10 +- .../classes/sun/awt/X11/XPopupMenuPeer.java | 4 +- .../unix/classes/sun/awt/X11/XProtocol.java | 2 +- .../sun/awt/X11/XProtocolConstants.java | 2 +- .../unix/classes/sun/awt/X11/XRobotPeer.java | 16 +-- .../classes/sun/awt/X11/XScrollPanePeer.java | 12 +- .../unix/classes/sun/awt/X11/XScrollbar.java | 4 +- .../classes/sun/awt/X11/XScrollbarPeer.java | 2 +- .../unix/classes/sun/awt/X11/XToolkit.java | 12 +- .../classes/sun/awt/X11/XTrayIconPeer.java | 4 +- .../classes/sun/awt/X11/XUtilConstants.java | 2 +- .../classes/sun/awt/X11/XWINProtocol.java | 18 +-- .../unix/classes/sun/awt/X11/XWM.java | 32 ++--- .../classes/sun/awt/X11/XWarningWindow.java | 6 +- .../unix/classes/sun/awt/X11/XWindow.java | 10 +- .../unix/classes/sun/awt/X11/XWindowPeer.java | 2 +- .../unix/classes/sun/awt/X11/XlibWrapper.java | 6 +- .../unix/classes/sun/awt/X11InputMethod.java | 2 +- .../unix/classes/sun/font/X11GB18030_0.java | 22 ++-- .../unix/classes/sun/font/X11GB18030_1.java | 26 ++-- .../unix/classes/sun/font/X11Johab.java | 22 ++-- .../classes/sun/font/X11SunUnicode_0.java | 6 +- .../sun/java2d/jules/IdleTileCache.java | 4 +- .../java2d/jules/JulesAATileGenerator.java | 14 +- .../classes/sun/java2d/jules/TileWorker.java | 2 +- .../classes/sun/java2d/xr/XIDGenerator.java | 2 +- .../sun/java2d/xr/XRBackendNative.java | 2 +- .../sun/java2d/xr/XRCompositeManager.java | 6 +- .../sun/java2d/xr/XcbRequestCounter.java | 2 +- .../classes/sun/print/IPPPrintService.java | 2 +- .../unix/classes/sun/print/UnixPrintJob.java | 6 +- .../classes/sun/print/UnixPrintService.java | 4 +- .../sun/awt/windows/WComponentPeer.java | 4 +- .../classes/sun/awt/windows/WDialogPeer.java | 2 +- .../classes/sun/awt/windows/WFramePeer.java | 2 +- .../classes/sun/awt/windows/WInputMethod.java | 28 ++-- .../classes/sun/awt/windows/WObjectPeer.java | 2 +- .../sun/awt/windows/WScrollPanePeer.java | 4 +- .../classes/sun/awt/windows/WToolkit.java | 4 +- .../sun/awt/windows/WTrayIconPeer.java | 6 +- .../classes/sun/awt/windows/WWindowPeer.java | 4 +- .../classes/sun/java2d/d3d/D3DPaints.java | 2 +- .../classes/sun/print/Win32MediaTray.java | 2 +- .../classes/sun/print/Win32PrintJob.java | 6 +- .../classes/sun/print/Win32PrintService.java | 6 +- 324 files changed, 1354 insertions(+), 1354 deletions(-) diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java index b98d5739510..d40b57a31f6 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java @@ -62,7 +62,7 @@ class _AppEventHandler { private static native void nativeReplyToAppShouldTerminate(final boolean shouldTerminate); private static native void nativeRegisterForNotification(final int notification); - final static _AppEventHandler instance = new _AppEventHandler(); + static final _AppEventHandler instance = new _AppEventHandler(); static _AppEventHandler getInstance() { return instance; } diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java b/jdk/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java index e098654a03d..5dec385d5aa 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java @@ -69,31 +69,31 @@ public class FileManager { * @since Java for Mac OS X 10.5 - 1.5 * @since Java for Mac OS X 10.5 Update 1 - 1.6 */ - public final static short kOnAppropriateDisk = -32767; + public static final short kOnAppropriateDisk = -32767; /** * Read-only system hierarchy. * @since Java for Mac OS X 10.5 - 1.5 * @since Java for Mac OS X 10.5 Update 1 - 1.6 */ - public final static short kSystemDomain = -32766; + public static final short kSystemDomain = -32766; /** * All users of a single machine have access to these resources. * @since Java for Mac OS X 10.5 - 1.5 * @since Java for Mac OS X 10.5 Update 1 - 1.6 */ - public final static short kLocalDomain = -32765; + public static final short kLocalDomain = -32765; /** * All users configured to use a common network server has access to these resources. * @since Java for Mac OS X 10.5 - 1.5 * @since Java for Mac OS X 10.5 Update 1 - 1.6 */ - public final static short kNetworkDomain = -32764; + public static final short kNetworkDomain = -32764; /** * Read/write. Resources that are private to the user. * @since Java for Mac OS X 10.5 - 1.5 * @since Java for Mac OS X 10.5 Update 1 - 1.6 */ - public final static short kUserDomain = -32763; + public static final short kUserDomain = -32763; /** diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonBorder.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonBorder.java index f76a8d3e8ae..aa2947cb87d 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonBorder.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonBorder.java @@ -38,17 +38,17 @@ import com.apple.laf.AquaUtils.*; public abstract class AquaButtonBorder extends AquaBorder implements Border, UIResource { public static final RecyclableSingleton fDynamic = new RecyclableSingletonFromDefaultConstructor(Dynamic.class); - static public AquaButtonBorder getDynamicButtonBorder() { + public static AquaButtonBorder getDynamicButtonBorder() { return fDynamic.get(); } private static final RecyclableSingleton fToggle = new RecyclableSingletonFromDefaultConstructor(Toggle.class); - static public AquaButtonBorder getToggleButtonBorder() { + public static AquaButtonBorder getToggleButtonBorder() { return fToggle.get(); } public static final RecyclableSingleton fToolBar = new RecyclableSingletonFromDefaultConstructor(Toolbar.class); - static public Border getToolBarButtonBorder() { + public static Border getToolBarButtonBorder() { return fToolBar.get(); } diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonExtendedTypes.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonExtendedTypes.java index f3520368911..0d48390c6f8 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonExtendedTypes.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonExtendedTypes.java @@ -63,7 +63,7 @@ public class AquaButtonExtendedTypes { return logicalPosition; } - static abstract class TypeSpecifier { + abstract static class TypeSpecifier { final String name; final boolean setIconFont; @@ -138,7 +138,7 @@ public class AquaButtonExtendedTypes { return typeDefinitions.get().get(name); } - protected final static RecyclableSingleton> typeDefinitions = new RecyclableSingleton>() { + protected static final RecyclableSingleton> typeDefinitions = new RecyclableSingleton>() { protected Map getInstance() { return getAllTypes(); } diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java index eba20b93e77..c05f191ef38 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java @@ -221,7 +221,7 @@ public abstract class AquaButtonLabeledUI extends AquaButtonToggleUI implements return new Dimension(width, height); } - public static abstract class LabeledButtonBorder extends AquaButtonBorder { + public abstract static class LabeledButtonBorder extends AquaButtonBorder { public LabeledButtonBorder(final SizeDescriptor sizeDescriptor) { super(sizeDescriptor); } diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java index 0f2f4d97d4d..4d6d463fa5c 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java @@ -462,7 +462,7 @@ public class AquaButtonUI extends BasicButtonUI implements Sizeable { return d; } - final static RecyclableSingleton fHierListener = new RecyclableSingletonFromDefaultConstructor(AquaHierarchyButtonListener.class); + static final RecyclableSingleton fHierListener = new RecyclableSingletonFromDefaultConstructor(AquaHierarchyButtonListener.class); static AquaHierarchyButtonListener getAquaHierarchyButtonListener() { return fHierListener.get(); } diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java index 901d7e9e2bd..777c4c82615 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java @@ -35,10 +35,10 @@ import apple.laf.JRSUIConstants.*; @SuppressWarnings("serial") // Superclass is not serializable across versions class AquaComboBoxButton extends JButton { - final protected JComboBox comboBox; - final protected JList list; - final protected CellRendererPane rendererPane; - final protected AquaComboBoxUI ui; + protected final JComboBox comboBox; + protected final JList list; + protected final CellRendererPane rendererPane; + protected final AquaComboBoxUI ui; protected final AquaPainter painter = AquaPainter.create(JRSUIState.getInstance()); boolean isPopDown; diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java index 266d5065ca3..887ab5c8bd3 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java @@ -57,8 +57,8 @@ class AquaFileSystemModel extends AbstractTableModel implements PropertyChangeLi // private boolean fSortAscending = true; private boolean fSortNames = true; private final String[] fColumnNames; - public final static String SORT_BY_CHANGED = "sortByChanged"; - public final static String SORT_ASCENDING_CHANGED = "sortAscendingChanged"; + public static final String SORT_BY_CHANGED = "sortByChanged"; + public static final String SORT_ASCENDING_CHANGED = "sortAscendingChanged"; public AquaFileSystemModel(final JFileChooser filechooser, final JTable filelist, final String[] colNames) { fileCacheLock = new Object(); diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaIcon.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaIcon.java index e8f854918aa..b4bc1e69d58 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaIcon.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaIcon.java @@ -73,7 +73,7 @@ public class AquaIcon { public void initIconPainter(final AquaPainter painter); } - static abstract class JRSUIIcon implements Icon, UIResource { + abstract static class JRSUIIcon implements Icon, UIResource { protected final AquaPainter painter = AquaPainter.create(JRSUIState.getInstance()); public void paintIcon(final Component c, final Graphics g, final int x, final int y) { @@ -81,7 +81,7 @@ public class AquaIcon { } } - static abstract class DynamicallySizingJRSUIIcon extends JRSUIIcon { + abstract static class DynamicallySizingJRSUIIcon extends JRSUIIcon { protected final SizeDescriptor sizeDescriptor; protected SizeVariant sizeVariant; @@ -109,7 +109,7 @@ public class AquaIcon { } } - static abstract class CachingScalingIcon implements Icon, UIResource { + abstract static class CachingScalingIcon implements Icon, UIResource { int width; int height; Image image; @@ -167,7 +167,7 @@ public class AquaIcon { } - static abstract class ScalingJRSUIIcon implements Icon, UIResource { + abstract static class ScalingJRSUIIcon implements Icon, UIResource { final int width; final int height; diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameDockIconUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameDockIconUI.java index 370cb4e996f..a24faef499a 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameDockIconUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameDockIconUI.java @@ -229,9 +229,9 @@ public class AquaInternalFrameDockIconUI extends DesktopIconUI implements MouseL @SuppressWarnings("serial") // Superclass is not serializable across versions class DockLabel extends JLabel { - final static int NUB_HEIGHT = 7; - final static int ROUND_ADDITIONAL_HEIGHT = 8; - final static int ROUND_ADDITIONAL_WIDTH = 12; + static final int NUB_HEIGHT = 7; + static final int ROUND_ADDITIONAL_HEIGHT = 8; + static final int ROUND_ADDITIONAL_WIDTH = 12; DockLabel(final String text) { super(text); diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java index 83a6182ea03..d6395accd00 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java @@ -529,7 +529,7 @@ public class AquaKeyBindings { // extracted and adapted from DefaultEditorKit in 1.6 @SuppressWarnings("serial") // Superclass is not serializable across versions - static abstract class DeleteWordAction extends TextAction { + abstract static class DeleteWordAction extends TextAction { public DeleteWordAction(final String name) { super(name); } public void actionPerformed(final ActionEvent e) { diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java index 93888e75e6f..3ab83b037c8 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java @@ -48,7 +48,7 @@ import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor; public class AquaRootPaneUI extends BasicRootPaneUI implements AncestorListener, WindowListener, ContainerListener { private static final RecyclableSingleton sRootPaneUI = new RecyclableSingletonFromDefaultConstructor(AquaRootPaneUI.class); - final static int kDefaultButtonPaintDelayBetweenFrames = 50; + static final int kDefaultButtonPaintDelayBetweenFrames = 50; JButton fCurrentDefaultButton = null; Timer fTimer = null; static final boolean sUseScreenMenuBar = AquaMenuBarUI.getScreenMenuBarProperty(); diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java index 9b27b35cf50..94d69294407 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java @@ -2011,20 +2011,20 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing } private static class Actions extends UIAction { - final static String NEXT = "navigateNext"; - final static String PREVIOUS = "navigatePrevious"; - final static String RIGHT = "navigateRight"; - final static String LEFT = "navigateLeft"; - final static String UP = "navigateUp"; - final static String DOWN = "navigateDown"; - final static String PAGE_UP = "navigatePageUp"; - final static String PAGE_DOWN = "navigatePageDown"; - final static String REQUEST_FOCUS = "requestFocus"; - final static String REQUEST_FOCUS_FOR_VISIBLE = "requestFocusForVisibleComponent"; - final static String SET_SELECTED = "setSelectedIndex"; - final static String SELECT_FOCUSED = "selectTabWithFocus"; - final static String SCROLL_FORWARD = "scrollTabsForwardAction"; - final static String SCROLL_BACKWARD = "scrollTabsBackwardAction"; + static final String NEXT = "navigateNext"; + static final String PREVIOUS = "navigatePrevious"; + static final String RIGHT = "navigateRight"; + static final String LEFT = "navigateLeft"; + static final String UP = "navigateUp"; + static final String DOWN = "navigateDown"; + static final String PAGE_UP = "navigatePageUp"; + static final String PAGE_DOWN = "navigatePageDown"; + static final String REQUEST_FOCUS = "requestFocus"; + static final String REQUEST_FOCUS_FOR_VISIBLE = "requestFocusForVisibleComponent"; + static final String SET_SELECTED = "setSelectedIndex"; + static final String SELECT_FOCUSED = "selectTabWithFocus"; + static final String SCROLL_FORWARD = "scrollTabsForwardAction"; + static final String SCROLL_BACKWARD = "scrollTabsBackwardAction"; Actions(final String key) { super(key); diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderUI.java index dbc8c8c86ad..2dec5c895eb 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderUI.java @@ -67,7 +67,7 @@ public class AquaTableHeaderUI extends BasicTableHeaderUI { super.uninstallDefaults(); } - final static RecyclableSingleton> TABLE_HEADER_APPLICATORS = new RecyclableSingleton>() { + static final RecyclableSingleton> TABLE_HEADER_APPLICATORS = new RecyclableSingleton>() { @Override @SuppressWarnings("unchecked") protected ClientPropertyApplicator getInstance() { diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtilControlSize.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtilControlSize.java index 17b372af858..7c4a3351566 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtilControlSize.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtilControlSize.java @@ -40,8 +40,8 @@ import com.apple.laf.AquaUtils.RecyclableSingleton; import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor; public class AquaUtilControlSize { - protected final static String CLIENT_PROPERTY_KEY = "JComponent.sizeVariant"; - protected final static String SYSTEM_PROPERTY_KEY = "swing.component.sizevariant"; + protected static final String CLIENT_PROPERTY_KEY = "JComponent.sizeVariant"; + protected static final String SYSTEM_PROPERTY_KEY = "swing.component.sizevariant"; interface Sizeable { void applySizeFor(final JComponent c, final Size size); @@ -76,7 +76,7 @@ public class AquaUtilControlSize { return JRSUIConstants.Size.REGULAR; } - protected final static JRSUIConstants.Size defaultSize = getDefaultSize(); + protected static final JRSUIConstants.Size defaultSize = getDefaultSize(); protected static JRSUIConstants.Size getUserSizeFrom(final JComponent c) { final Object sizeProp = c.getClientProperty(CLIENT_PROPERTY_KEY); if (sizeProp == null) return defaultSize; diff --git a/jdk/src/java.desktop/macosx/classes/sun/java2d/CRenderer.java b/jdk/src/java.desktop/macosx/classes/sun/java2d/CRenderer.java index b5570f6ce93..5b622eb1899 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/java2d/CRenderer.java +++ b/jdk/src/java.desktop/macosx/classes/sun/java2d/CRenderer.java @@ -36,7 +36,7 @@ import sun.java2d.pipe.*; import sun.lwawt.macosx.*; public class CRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe, DrawImagePipe { - native static void init(); + static native void init(); // cache of the runtime options static { diff --git a/jdk/src/java.desktop/macosx/classes/sun/java2d/CompositeCRenderer.java b/jdk/src/java.desktop/macosx/classes/sun/java2d/CompositeCRenderer.java index c36472ee87d..cbbf76278d8 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/java2d/CompositeCRenderer.java +++ b/jdk/src/java.desktop/macosx/classes/sun/java2d/CompositeCRenderer.java @@ -35,8 +35,8 @@ import sun.java2d.loops.*; import sun.java2d.pipe.*; public class CompositeCRenderer extends CRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe, DrawImagePipe, TextPipe { - final static int fPadding = 4; - final static int fPaddingHalf = fPadding / 2; + static final int fPadding = 4; + static final int fPaddingHalf = fPadding / 2; private static AffineTransform sIdentityMatrix = new AffineTransform(); diff --git a/jdk/src/java.desktop/macosx/classes/sun/java2d/OSXSurfaceData.java b/jdk/src/java.desktop/macosx/classes/sun/java2d/OSXSurfaceData.java index f6e04c8e539..d1444b81a90 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/java2d/OSXSurfaceData.java +++ b/jdk/src/java.desktop/macosx/classes/sun/java2d/OSXSurfaceData.java @@ -43,8 +43,8 @@ import java.lang.annotation.Native; * This is the SurfaceData for a CGContextRef. */ public abstract class OSXSurfaceData extends BufImgSurfaceData { - final static float UPPER_BND = Float.MAX_VALUE / 2.0f; - final static float LOWER_BND = -UPPER_BND; + static final float UPPER_BND = Float.MAX_VALUE / 2.0f; + static final float LOWER_BND = -UPPER_BND; protected static CRenderer sQuartzPipe = null; protected static CTextPipe sCocoaTextPipe = null; diff --git a/jdk/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java b/jdk/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java index 3aaa1bcf31b..c260e60ad68 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java +++ b/jdk/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java @@ -365,7 +365,7 @@ public abstract class CGLSurfaceData extends OGLSurfaceData { // Mac OS X specific APIs for JOGL/Java2D bridge... // given a surface create and attach GL context, then return it - private native static long createCGLContextOnSurface(CGLSurfaceData sd, + private static native long createCGLContextOnSurface(CGLSurfaceData sd, long sharedContext); public static long createOGLContextOnSurface(Graphics g, long sharedContext) { @@ -379,7 +379,7 @@ public abstract class CGLSurfaceData extends OGLSurfaceData { } // returns whether or not the makeCurrent operation succeeded - native static boolean makeCGLContextCurrentOnSurface(CGLSurfaceData sd, + static native boolean makeCGLContextCurrentOnSurface(CGLSurfaceData sd, long ctx); public static boolean makeOGLContextCurrentOnSurface(Graphics g, long ctx) { @@ -393,7 +393,7 @@ public abstract class CGLSurfaceData extends OGLSurfaceData { } // additional cleanup - private native static void destroyCGLContext(long ctx); + private static native void destroyCGLContext(long ctx); public static void destroyOGLContext(long ctx) { if (ctx != 0L) { diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java index 44136640ccf..2870e7ba22b 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java @@ -43,12 +43,12 @@ import static sun.lwawt.LWWindowPeer.PeerType; public abstract class LWToolkit extends SunToolkit implements Runnable { - private final static int STATE_NONE = 0; - private final static int STATE_INIT = 1; - private final static int STATE_MESSAGELOOP = 2; - private final static int STATE_SHUTDOWN = 3; - private final static int STATE_CLEANUP = 4; - private final static int STATE_DONE = 5; + private static final int STATE_NONE = 0; + private static final int STATE_INIT = 1; + private static final int STATE_MESSAGELOOP = 2; + private static final int STATE_SHUTDOWN = 3; + private static final int STATE_CLEANUP = 4; + private static final int STATE_DONE = 5; private int runState = STATE_NONE; @@ -454,14 +454,14 @@ public abstract class LWToolkit extends SunToolkit implements Runnable { /* * Expose non-public targetToPeer() method. */ - public final static Object targetToPeer(Object target) { + public static final Object targetToPeer(Object target) { return SunToolkit.targetToPeer(target); } /* * Expose non-public targetDisposedPeer() method. */ - public final static void targetDisposedPeer(Object target, Object peer) { + public static final void targetDisposedPeer(Object target, Object peer) { SunToolkit.targetDisposedPeer(target, peer); } diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java index d3ab6a651de..919c31cb234 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java @@ -558,9 +558,9 @@ class CAccessibility implements PropertyChangeListener { // Duplicated from JavaComponentAccessibility // Note that values >=0 are indexes into the child array - final static int JAVA_AX_ALL_CHILDREN = -1; - final static int JAVA_AX_SELECTED_CHILDREN = -2; - final static int JAVA_AX_VISIBLE_CHILDREN = -3; + static final int JAVA_AX_ALL_CHILDREN = -1; + static final int JAVA_AX_SELECTED_CHILDREN = -2; + static final int JAVA_AX_VISIBLE_CHILDREN = -3; // Each child takes up two entries in the array: one for itself and one for its role public static Object[] getChildrenAndRoles(final Accessible a, final Component c, final int whichChildren, final boolean allowIgnored) { diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDataTransferer.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDataTransferer.java index d5131d9f61f..2805211d3d1 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDataTransferer.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDataTransferer.java @@ -171,7 +171,7 @@ public class CDataTransferer extends DataTransferer { } @Override - synchronized protected Long getFormatForNativeAsLong(String str) { + protected synchronized Long getFormatForNativeAsLong(String str) { Long format = predefinedClipboardNameMap.get(str); if (format == null) { diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java index 80a68126a98..a1606d2f959 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java @@ -422,7 +422,7 @@ public class CInputMethod extends InputMethodAdapter { * Tell the component to commit all of the characters in the string to the current * text view. This effectively wipes out any text in progress. */ - synchronized private void insertText(String aString) { + private synchronized void insertText(String aString) { AttributedString attribString = new AttributedString(aString); // Set locale information on the new string. @@ -447,11 +447,11 @@ public class CInputMethod extends InputMethodAdapter { fCurrentTextLength = rawText.length(); } - static private final int kCaretPosition = 0; - static private final int kRawText = 1; - static private final int kSelectedRawText = 2; - static private final int kConvertedText = 3; - static private final int kSelectedConvertedText = 4; + private static final int kCaretPosition = 0; + private static final int kRawText = 1; + private static final int kSelectedRawText = 2; + private static final int kConvertedText = 3; + private static final int kSelectedConvertedText = 4; /** * Convert Cocoa text highlight attributes into Java input method highlighting. @@ -556,7 +556,7 @@ public class CInputMethod extends InputMethodAdapter { /** * Frequent callbacks from NSTextInput. I think we're supposed to commit it here? */ - synchronized private void unmarkText() { + private synchronized void unmarkText() { if (fCurrentText == null) return; @@ -574,7 +574,7 @@ public class CInputMethod extends InputMethodAdapter { fCurrentTextLength = 0; } - synchronized private boolean hasMarkedText() { + private synchronized boolean hasMarkedText() { return fCurrentText != null; } @@ -583,7 +583,7 @@ public class CInputMethod extends InputMethodAdapter { * Java does not. So, we have to see where the request is and based on that return the right * substring. */ - synchronized private String attributedSubstringFromRange(final int locationIn, final int lengthIn) { + private synchronized String attributedSubstringFromRange(final int locationIn, final int lengthIn) { final String[] retString = new String[1]; try { @@ -635,7 +635,7 @@ public class CInputMethod extends InputMethodAdapter { * for the fact that the insert point in Swing can come AFTER the selected text, making this * potentially incorrect. */ - synchronized private int[] selectedRange() { + private synchronized int[] selectedRange() { final int[] returnValue = new int[2]; try { @@ -683,7 +683,7 @@ public class CInputMethod extends InputMethodAdapter { * inserted, so we can return that position, and the length of the text in progress. If there is no marked text * return null. */ - synchronized private int[] markedRange() { + private synchronized int[] markedRange() { if (fCurrentText == null) return null; @@ -710,7 +710,7 @@ public class CInputMethod extends InputMethodAdapter { * which is always in front of the in-progress text, we get the offset into the composed text, and we get * that location from the input method context. */ - synchronized private int[] firstRectForCharacterRange(final int absoluteTextOffset) { + private synchronized int[] firstRectForCharacterRange(final int absoluteTextOffset) { final int[] rect = new int[4]; try { @@ -753,7 +753,7 @@ public class CInputMethod extends InputMethodAdapter { * The coordinates are in Java screen coordinates. If no character in the composed text was hit, we return -1, indicating * not found. */ - synchronized private int characterIndexForPoint(final int screenX, final int screenY) { + private synchronized int characterIndexForPoint(final int screenX, final int screenY) { final TextHitInfo[] offsetInfo = new TextHitInfo[1]; final int[] insertPositionOffset = new int[1]; diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CWarningWindow.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CWarningWindow.java index 05db2784b95..b2c36705a09 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CWarningWindow.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CWarningWindow.java @@ -45,8 +45,8 @@ public final class CWarningWindow extends CPlatformWindow private static class Lock {} private final Lock lock = new Lock(); - private final static int SHOWING_DELAY = 300; - private final static int HIDING_DELAY = 2000; + private static final int SHOWING_DELAY = 300; + private static final int HIDING_DELAY = 2000; private Rectangle bounds = new Rectangle(); private final WeakReference ownerPeer; @@ -406,7 +406,7 @@ public final class CWarningWindow extends CPlatformWindow private final Lock taskLock = new Lock(); private CancelableRunnable showHideTask; - private static abstract class CancelableRunnable implements Runnable { + private abstract static class CancelableRunnable implements Runnable { private volatile boolean perform = true; public final void cancel() { diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CocoaConstants.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CocoaConstants.java index e94f512b0fb..a60cc43c411 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CocoaConstants.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CocoaConstants.java @@ -30,35 +30,35 @@ public final class CocoaConstants { private CocoaConstants(){} //from the NSEvent class reference: - public final static int NSLeftMouseDown = 1; - public final static int NSLeftMouseUp = 2; - public final static int NSRightMouseDown = 3; - public final static int NSRightMouseUp = 4; - public final static int NSMouseMoved = 5; - public final static int NSLeftMouseDragged = 6; - public final static int NSRightMouseDragged = 7; - public final static int NSMouseEntered = 8; - public final static int NSMouseExited = 9; - public final static int NSKeyDown = 10; - public final static int NSKeyUp = 11; - public final static int NSFlagsChanged = 12; + public static final int NSLeftMouseDown = 1; + public static final int NSLeftMouseUp = 2; + public static final int NSRightMouseDown = 3; + public static final int NSRightMouseUp = 4; + public static final int NSMouseMoved = 5; + public static final int NSLeftMouseDragged = 6; + public static final int NSRightMouseDragged = 7; + public static final int NSMouseEntered = 8; + public static final int NSMouseExited = 9; + public static final int NSKeyDown = 10; + public static final int NSKeyUp = 11; + public static final int NSFlagsChanged = 12; - public final static int NSScrollWheel = 22; - public final static int NSOtherMouseDown = 25; - public final static int NSOtherMouseUp = 26; - public final static int NSOtherMouseDragged = 27; + public static final int NSScrollWheel = 22; + public static final int NSOtherMouseDown = 25; + public static final int NSOtherMouseUp = 26; + public static final int NSOtherMouseDragged = 27; - public final static int AllLeftMouseEventsMask = + public static final int AllLeftMouseEventsMask = 1 << NSLeftMouseDown | 1 << NSLeftMouseUp | 1 << NSLeftMouseDragged; - public final static int AllRightMouseEventsMask = + public static final int AllRightMouseEventsMask = 1 << NSRightMouseDown | 1 << NSRightMouseUp | 1 << NSRightMouseDragged; - public final static int AllOtherMouseEventsMask = + public static final int AllOtherMouseEventsMask = 1 << NSOtherMouseDown | 1 << NSOtherMouseUp | 1 << NSOtherMouseDragged; @@ -82,24 +82,24 @@ public final class CocoaConstants { // See http://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html - public final static int kCGMouseButtonLeft = 0; - public final static int kCGMouseButtonRight = 1; - public final static int kCGMouseButtonCenter = 2; + public static final int kCGMouseButtonLeft = 0; + public static final int kCGMouseButtonRight = 1; + public static final int kCGMouseButtonCenter = 2; // See https://wiki.mozilla.org/NPAPI:CocoaEventModel - public final static int NPCocoaEventDrawRect = 1; - public final static int NPCocoaEventMouseDown = 2; - public final static int NPCocoaEventMouseUp = 3; - public final static int NPCocoaEventMouseMoved = 4; - public final static int NPCocoaEventMouseEntered = 5; - public final static int NPCocoaEventMouseExited = 6; - public final static int NPCocoaEventMouseDragged = 7; - public final static int NPCocoaEventKeyDown = 8; - public final static int NPCocoaEventKeyUp = 9; - public final static int NPCocoaEventFlagsChanged = 10; - public final static int NPCocoaEventFocusChanged = 11; - public final static int NPCocoaEventWindowFocusChanged = 12; - public final static int NPCocoaEventScrollWheel = 13; - public final static int NPCocoaEventTextInput = 14; + public static final int NPCocoaEventDrawRect = 1; + public static final int NPCocoaEventMouseDown = 2; + public static final int NPCocoaEventMouseUp = 3; + public static final int NPCocoaEventMouseMoved = 4; + public static final int NPCocoaEventMouseEntered = 5; + public static final int NPCocoaEventMouseExited = 6; + public static final int NPCocoaEventMouseDragged = 7; + public static final int NPCocoaEventKeyDown = 8; + public static final int NPCocoaEventKeyUp = 9; + public static final int NPCocoaEventFlagsChanged = 10; + public static final int NPCocoaEventFocusChanged = 11; + public static final int NPCocoaEventWindowFocusChanged = 12; + public static final int NPCocoaEventScrollWheel = 13; + public static final int NPCocoaEventTextInput = 14; } diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index 0188339093e..eccba3032dd 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -127,10 +127,10 @@ public final class LWCToolkit extends LWToolkit { /* * System colors with default initial values, overwritten by toolkit if system values differ and are available. */ - private final static int NUM_APPLE_COLORS = 3; - public final static int KEYBOARD_FOCUS_COLOR = 0; - public final static int INACTIVE_SELECTION_BACKGROUND_COLOR = 1; - public final static int INACTIVE_SELECTION_FOREGROUND_COLOR = 2; + private static final int NUM_APPLE_COLORS = 3; + public static final int KEYBOARD_FOCUS_COLOR = 0; + public static final int INACTIVE_SELECTION_BACKGROUND_COLOR = 1; + public static final int INACTIVE_SELECTION_FOREGROUND_COLOR = 2; private static int[] appleColors = { 0xFF808080, // keyboardFocusColor = Color.gray; 0xFFC0C0C0, // secondarySelectedControlColor @@ -681,7 +681,7 @@ public final class LWCToolkit extends LWToolkit { * @param r a {@code Runnable} to execute * @param delay a delay in milliseconds */ - native static void performOnMainThreadAfterDelay(Runnable r, long delay); + static native void performOnMainThreadAfterDelay(Runnable r, long delay); // DnD support diff --git a/jdk/src/java.desktop/share/classes/com/sun/beans/editors/NumberEditor.java b/jdk/src/java.desktop/share/classes/com/sun/beans/editors/NumberEditor.java index 3941e2cf0bc..9097546d2e0 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/beans/editors/NumberEditor.java +++ b/jdk/src/java.desktop/share/classes/com/sun/beans/editors/NumberEditor.java @@ -32,7 +32,7 @@ package com.sun.beans.editors; import java.beans.*; -abstract public class NumberEditor extends PropertyEditorSupport { +public abstract class NumberEditor extends PropertyEditorSupport { public String getJavaInitializationString() { Object value = getValue(); diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/I18N.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/I18N.java index 7d55e35cacc..a3c865b3aad 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/I18N.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/I18N.java @@ -26,7 +26,7 @@ package com.sun.imageio.plugins.common; public final class I18N extends I18NImpl { - private final static String resource_name = "iio-plugin.properties"; + private static final String resource_name = "iio-plugin.properties"; public static String getString(String key) { return getString("com.sun.imageio.plugins.common.I18N", resource_name, key); } diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java index 7d1714630b9..c90ed4b2b44 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java @@ -37,16 +37,16 @@ import java.io.PrintStream; **/ public class LZWStringTable { /** codesize + Reserved Codes */ - private final static int RES_CODES = 2; + private static final int RES_CODES = 2; - private final static short HASH_FREE = (short)0xFFFF; - private final static short NEXT_FIRST = (short)0xFFFF; + private static final short HASH_FREE = (short)0xFFFF; + private static final short NEXT_FIRST = (short)0xFFFF; - private final static int MAXBITS = 12; - private final static int MAXSTR = (1 << MAXBITS); + private static final int MAXBITS = 12; + private static final int MAXSTR = (1 << MAXBITS); - private final static short HASHSIZE = 9973; - private final static short HASHSTEP = 2039; + private static final short HASHSIZE = 9973; + private static final short HASHSTEP = 2039; byte[] strChr; // after predecessor character short[] strNxt; // predecessor string @@ -142,7 +142,7 @@ public class LZWStringTable { } } - static public int hash(short index, byte lastbyte) { + public static int hash(short index, byte lastbyte) { return (((short)(lastbyte << 8) ^ index) & 0xFFFF) % HASHSIZE; } diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java index 5743cedc904..5a0e560f9ae 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java @@ -1773,7 +1773,7 @@ class ImageTypeProducer { private static final ImageTypeProducer [] defaultTypes = new ImageTypeProducer [JPEG.NUM_JCS_CODES]; - public synchronized static ImageTypeProducer getTypeProducer(int csCode) { + public static synchronized ImageTypeProducer getTypeProducer(int csCode) { if (csCode < 0 || csCode >= JPEG.NUM_JCS_CODES) { return null; } diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java index 742a9f9ad1e..f52982a4461 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java @@ -56,7 +56,7 @@ import sun.swing.ImageCache; */ class GTKEngine { - final static GTKEngine INSTANCE = new GTKEngine(); + static final GTKEngine INSTANCE = new GTKEngine(); /** Size of the image cache */ private static final int CACHE_SIZE = 50; @@ -523,7 +523,7 @@ class GTKEngine { native_paint_background(widget, state, x - x0, y - y0, w, h); } - private final static ColorModel[] COLOR_MODELS = { + private static final ColorModel[] COLOR_MODELS = { // Transparency.OPAQUE new DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000), // Transparency.BITMASK @@ -532,7 +532,7 @@ class GTKEngine { ColorModel.getRGBdefault(), }; - private final static int[][] BAND_OFFSETS = { + private static final int[][] BAND_OFFSETS = { { 0x00ff0000, 0x0000ff00, 0x000000ff }, // OPAQUE { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x01000000 }, // BITMASK { 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 } // TRANSLUCENT diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java index 3e55c0837de..ad61aca85f1 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java @@ -63,8 +63,8 @@ class GTKPainter extends SynthPainter { ShadowType.ETCHED_IN, ShadowType.OUT }; - private final static GTKEngine ENGINE = GTKEngine.INSTANCE; - final static GTKPainter INSTANCE = new GTKPainter(); + private static final GTKEngine ENGINE = GTKEngine.INSTANCE; + static final GTKPainter INSTANCE = new GTKPainter(); private GTKPainter() { } diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifBorders.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifBorders.java index 950f7d18b24..2b1b9b89f7a 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifBorders.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifBorders.java @@ -263,7 +263,7 @@ public class MotifBorders { Color frameShadow; // The width of the border - public final static int BORDER_SIZE = 5; + public static final int BORDER_SIZE = 5; /** Constructs an FrameBorder for the JComponent comp. */ @@ -446,7 +446,7 @@ public class MotifBorders { JInternalFrame frame; // The size of the bounding box for Motif frame corners. - public final static int CORNER_SIZE = 24; + public static final int CORNER_SIZE = 24; /** Constructs an InternalFrameBorder for the InternalFrame * aFrame. @@ -634,10 +634,10 @@ public class MotifBorders { protected Color highlightColor; // Space between the border and text - static protected final int TEXT_SPACING = 2; + protected static final int TEXT_SPACING = 2; // Space for the separator under the title - static protected final int GROOVE_HEIGHT = 2; + protected static final int GROOVE_HEIGHT = 2; /** * Creates a MotifPopupMenuBorder instance diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifCheckBoxUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifCheckBoxUI.java index 62b1577c7ca..11dc92d3a8d 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifCheckBoxUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifCheckBoxUI.java @@ -49,7 +49,7 @@ public class MotifCheckBoxUI extends MotifRadioButtonUI { private static final Object MOTIF_CHECK_BOX_UI_KEY = new Object(); - private final static String propertyPrefix = "CheckBox" + "."; + private static final String propertyPrefix = "CheckBox" + "."; private boolean defaults_initialized = false; diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopIconUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopIconUI.java index d7c69ccec46..16f56e2f9c9 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopIconUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopIconUI.java @@ -59,10 +59,10 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI JPopupMenu systemMenu; EventListener mml; - final static int LABEL_HEIGHT = 18; - final static int LABEL_DIVIDER = 4; // padding between icon and label + static final int LABEL_HEIGHT = 18; + static final int LABEL_DIVIDER = 4; // padding between icon and label - final static Font defaultTitleFont = + static final Font defaultTitleFont = new Font(Font.SANS_SERIF, Font.PLAIN, 12); public static ComponentUI createUI(JComponent c) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifIconFactory.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifIconFactory.java index 394bb892327..4c8e33fcf87 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifIconFactory.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifIconFactory.java @@ -93,7 +93,7 @@ public class MotifIconFactory implements Serializable @SuppressWarnings("serial") // Same-version serialization only private static class CheckBoxIcon implements Icon, UIResource, Serializable { - final static int csize = 13; + static final int csize = 13; private Color control = UIManager.getColor("control"); private Color foreground = UIManager.getColor("CheckBox.foreground"); diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java index 167a8d019c5..3d38e3b4b71 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java @@ -56,7 +56,7 @@ public class MotifInternalFrameTitlePane Color shadow; // The width and height of a title pane button - public final static int BUTTON_SIZE = 19; // 17 + 1 pixel border + public static final int BUTTON_SIZE = 19; // 17 + 1 pixel border public MotifInternalFrameTitlePane(JInternalFrame frame) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollPaneUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollPaneUI.java index 8cb5028c476..63514f64343 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollPaneUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifScrollPaneUI.java @@ -47,9 +47,9 @@ import java.beans.PropertyChangeListener; */ public class MotifScrollPaneUI extends BasicScrollPaneUI { - private final static Border vsbMarginBorderR = new EmptyBorder(0, 4, 0, 0); - private final static Border vsbMarginBorderL = new EmptyBorder(0, 0, 0, 4); - private final static Border hsbMarginBorder = new EmptyBorder(4, 0, 0, 0); + private static final Border vsbMarginBorderR = new EmptyBorder(0, 4, 0, 0); + private static final Border vsbMarginBorderL = new EmptyBorder(0, 0, 0, 4); + private static final Border hsbMarginBorder = new EmptyBorder(4, 0, 0, 0); private CompoundBorder vsbBorder; private CompoundBorder hsbBorder; diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/AnimationController.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/AnimationController.java index 70edf604df5..dab22fd293e 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/AnimationController.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/AnimationController.java @@ -69,11 +69,11 @@ import sun.awt.AppContext; */ class AnimationController implements ActionListener, PropertyChangeListener { - private final static boolean VISTA_ANIMATION_DISABLED = + private static final boolean VISTA_ANIMATION_DISABLED = AccessController.doPrivileged(new GetBooleanAction("swing.disablevistaanimation")); - private final static Object ANIMATION_CONTROLLER_KEY = + private static final Object ANIMATION_CONTROLLER_KEY = new StringBuilder("ANIMATION_CONTROLLER_KEY"); private final Map> animationStateMap = diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxUI.java index 91f4530dabf..91c919c8711 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxUI.java @@ -53,7 +53,7 @@ public class WindowsCheckBoxUI extends WindowsRadioButtonUI private static final Object WINDOWS_CHECK_BOX_UI_KEY = new Object(); - private final static String propertyPrefix = "CheckBox" + "."; + private static final String propertyPrefix = "CheckBox" + "."; private boolean defaults_initialized = false; diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java index ca9121c225d..0dc3cb844ce 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java @@ -1017,7 +1017,7 @@ public class WindowsFileChooserUI extends BasicFileChooserUI { } } - final static int space = 10; + static final int space = 10; class IndentIcon implements Icon { Icon icon = null; diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java index 4faeba214aa..01de04d1dea 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java @@ -321,7 +321,7 @@ public class WindowsIconFactory implements Serializable @SuppressWarnings("serial") // Same-version serialization only private static class CheckBoxIcon implements Icon, Serializable { - final static int csize = 13; + static final int csize = 13; public void paintIcon(Component c, Graphics g, int x, int y) { JCheckBox cb = (JCheckBox) c; ButtonModel model = cb.getModel(); diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java index 8496e363196..abdcb841f9a 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java @@ -2271,7 +2271,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel protected Object classicValue, xpValue; // A constant that lets you specify null when using XP styles. - private final static Object NULL_VALUE = new Object(); + private static final Object NULL_VALUE = new Object(); XPValue(Object xpValue, Object classicValue) { this.xpValue = xpValue; diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java index 347f2943155..8f730949684 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java @@ -70,7 +70,7 @@ import javax.swing.plaf.basic.ComboPopup; */ public class WindowsRootPaneUI extends BasicRootPaneUI { - private final static WindowsRootPaneUI windowsRootPaneUI = new WindowsRootPaneUI(); + private static final WindowsRootPaneUI windowsRootPaneUI = new WindowsRootPaneUI(); static final AltProcessor altProcessor = new AltProcessor(); public static ComponentUI createUI(JComponent c) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTreeUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTreeUI.java index d532090669c..8849b786f6f 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTreeUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTreeUI.java @@ -106,8 +106,8 @@ public class WindowsTreeUI extends BasicTreeUI { } } - static protected final int HALF_SIZE = 4; - static protected final int SIZE = 9; + protected static final int HALF_SIZE = 4; + protected static final int SIZE = 9; /** * Returns the default cell renderer that is used to do the @@ -130,7 +130,7 @@ public class WindowsTreeUI extends BasicTreeUI { @SuppressWarnings("serial") // Same-version serialization only public static class ExpandedIcon implements Icon, Serializable { - static public Icon createExpandedIcon() { + public static Icon createExpandedIcon() { return new ExpandedIcon(); } @@ -182,7 +182,7 @@ public class WindowsTreeUI extends BasicTreeUI { */ @SuppressWarnings("serial") // Superclass is not serializable across versions public static class CollapsedIcon extends ExpandedIcon { - static public Icon createCollapsedIcon() { + public static Icon createCollapsedIcon() { return new CollapsedIcon(); } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java index 7a459158a30..3020c348953 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java @@ -52,7 +52,7 @@ import javax.sound.sampled.AudioSystem; public final class AuFileWriter extends SunFileWriter { //$$fb value for length field if length is not known - public final static int UNKNOWN_SIZE=-1; + public static final int UNKNOWN_SIZE=-1; /** * Constructs a new AuFileWriter object. diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatConverter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatConverter.java index 9b850e03ad3..910e2dc8352 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatConverter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatConverter.java @@ -53,11 +53,11 @@ public abstract class AudioFloatConverter { private final AudioFloatConverter converter; - final private int offset; + private final int offset; - final private int stepsize; + private final int stepsize; - final private byte mask; + private final byte mask; private byte[] mask_buffer; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSRegion.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSRegion.java index 3ef1e845c87..feb99823a98 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSRegion.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSRegion.java @@ -38,7 +38,7 @@ import java.util.List; */ public final class DLSRegion { - public final static int OPTION_SELFNONEXCLUSIVE = 0x0001; + public static final int OPTION_SELFNONEXCLUSIVE = 0x0001; List modulators = new ArrayList(); int keyfrom; int keyto; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSSampleLoop.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSSampleLoop.java index 091e38385dd..724815bd1bd 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSSampleLoop.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSSampleLoop.java @@ -31,8 +31,8 @@ package com.sun.media.sound; */ public final class DLSSampleLoop { - public final static int LOOP_TYPE_FORWARD = 0; - public final static int LOOP_TYPE_RELEASE = 1; + public static final int LOOP_TYPE_FORWARD = 0; + public static final int LOOP_TYPE_RELEASE = 1; long type; long start; long length; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java index 376521338c2..59d0c8cf6af 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java @@ -53,7 +53,7 @@ import javax.sound.sampled.AudioFormat.Encoding; */ public final class DLSSoundbank implements Soundbank { - static private class DLSID { + private static class DLSID { long i1; int s1; int s2; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/EmergencySoundbank.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/EmergencySoundbank.java index 587d3ff7ebe..22638076fcd 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/EmergencySoundbank.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/EmergencySoundbank.java @@ -37,7 +37,7 @@ import javax.sound.sampled.AudioFormat; */ public final class EmergencySoundbank { - private final static String[] general_midi_instruments = { + private static final String[] general_midi_instruments = { "Acoustic Grand Piano", "Bright Acoustic Piano", "Electric Grand Piano", @@ -2564,11 +2564,11 @@ public final class EmergencySoundbank { return ins; } - static public void ifft(double[] data) { + public static void ifft(double[] data) { new FFT(data.length / 2, 1).transform(data); } - static public void fft(double[] data) { + public static void fft(double[] data) { new FFT(data.length / 2, -1).transform(data); } @@ -2580,7 +2580,7 @@ public final class EmergencySoundbank { } } - static public void randomPhase(double[] data) { + public static void randomPhase(double[] data) { for (int i = 0; i < data.length; i += 2) { double phase = Math.random() * 2 * Math.PI; double d = data[i]; @@ -2589,7 +2589,7 @@ public final class EmergencySoundbank { } } - static public void randomPhase(double[] data, Random random) { + public static void randomPhase(double[] data, Random random) { for (int i = 0; i < data.length; i += 2) { double phase = random.nextDouble() * 2 * Math.PI; double d = data[i]; @@ -2598,7 +2598,7 @@ public final class EmergencySoundbank { } } - static public void normalize(double[] data, double target) { + public static void normalize(double[] data, double target) { double maxvalue = 0; for (int i = 0; i < data.length; i++) { if (data[i] > maxvalue) @@ -2613,7 +2613,7 @@ public final class EmergencySoundbank { data[i] *= gain; } - static public void normalize(float[] data, double target) { + public static void normalize(float[] data, double target) { double maxvalue = 0.5; for (int i = 0; i < data.length; i++) { if (data[i * 2] > maxvalue) @@ -2626,7 +2626,7 @@ public final class EmergencySoundbank { data[i * 2] *= gain; } - static public double[] realPart(double[] in) { + public static double[] realPart(double[] in) { double[] out = new double[in.length / 2]; for (int i = 0; i < out.length; i++) { out[i] = in[i * 2]; @@ -2634,7 +2634,7 @@ public final class EmergencySoundbank { return out; } - static public double[] imgPart(double[] in) { + public static double[] imgPart(double[] in) { double[] out = new double[in.length / 2]; for (int i = 0; i < out.length; i++) { out[i] = in[i * 2]; @@ -2642,7 +2642,7 @@ public final class EmergencySoundbank { return out; } - static public float[] toFloat(double[] in) { + public static float[] toFloat(double[] in) { float[] out = new float[in.length]; for (int i = 0; i < out.length; i++) { out[i] = (float) in[i]; @@ -2650,24 +2650,24 @@ public final class EmergencySoundbank { return out; } - static public byte[] toBytes(float[] in, AudioFormat format) { + public static byte[] toBytes(float[] in, AudioFormat format) { byte[] out = new byte[in.length * format.getFrameSize()]; return AudioFloatConverter.getConverter(format).toByteArray(in, out); } - static public void fadeUp(double[] data, int samples) { + public static void fadeUp(double[] data, int samples) { double dsamples = samples; for (int i = 0; i < samples; i++) data[i] *= i / dsamples; } - static public void fadeUp(float[] data, int samples) { + public static void fadeUp(float[] data, int samples) { double dsamples = samples; for (int i = 0; i < samples; i++) data[i] *= i / dsamples; } - static public double[] loopExtend(double[] data, int newsize) { + public static double[] loopExtend(double[] data, int newsize) { double[] outdata = new double[newsize]; int p_len = data.length; int p_ps = 0; @@ -2680,7 +2680,7 @@ public final class EmergencySoundbank { return outdata; } - static public float[] loopExtend(float[] data, int newsize) { + public static float[] loopExtend(float[] data, int newsize) { float[] outdata = new float[newsize]; int p_len = data.length; int p_ps = 0; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java index 0b2d9a33d52..1ac0a54a3d8 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java @@ -88,9 +88,9 @@ public final class JavaSoundAudioClip implements AudioClip, MetaEventListener, L * with the number of samples in the stream. * */ - private final static long CLIP_THRESHOLD = 1048576; + private static final long CLIP_THRESHOLD = 1048576; //private final static long CLIP_THRESHOLD = 1; - private final static int STREAM_BUFFER_SIZE = 1024; + private static final int STREAM_BUFFER_SIZE = 1024; public JavaSoundAudioClip(InputStream in) throws IOException { if (DEBUG || Printer.debug)Printer.debug("JavaSoundAudioClip."); diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java index eaacf0991be..dd0894aaf02 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java @@ -42,7 +42,7 @@ public final class MidiOutDeviceProvider extends AbstractMidiDeviceProvider { /** Cache of open MIDI output devices on the system. */ private static MidiDevice[] devices = null; - private final static boolean enabled; + private static final boolean enabled; // STATIC diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java index 40f7cd9f576..a56b5eca48e 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java @@ -44,9 +44,9 @@ import javax.sound.midi.Track; */ public final class MidiUtils { - public final static int DEFAULT_TEMPO_MPQ = 500000; // 120bpm - public final static int META_END_OF_TRACK_TYPE = 0x2F; - public final static int META_TEMPO_TYPE = 0x51; + public static final int DEFAULT_TEMPO_MPQ = 500000; // 120bpm + public static final int META_END_OF_TRACK_TYPE = 0x2F; + public static final int META_TEMPO_TYPE = 0x51; /** * Suppresses default constructor, ensuring non-instantiability. diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/ModelConnectionBlock.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/ModelConnectionBlock.java index 05a438fac8e..4b10cfad0a1 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/ModelConnectionBlock.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/ModelConnectionBlock.java @@ -39,7 +39,7 @@ public final class ModelConnectionBlock { // // source1 * source2 * scale -> destination // - private final static ModelSource[] no_sources = new ModelSource[0]; + private static final ModelSource[] no_sources = new ModelSource[0]; private ModelSource[] sources = no_sources; private double scale = 1; private ModelDestination destination; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/ModelTransform.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/ModelTransform.java index f39f996d1ca..cbe0adb97b5 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/ModelTransform.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/ModelTransform.java @@ -31,5 +31,5 @@ package com.sun.media.sound; */ public interface ModelTransform { - abstract public double transform(double value); + public abstract double transform(double value); } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/Platform.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/Platform.java index 469be149c81..09ece592c93 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/Platform.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/Platform.java @@ -169,9 +169,9 @@ final class Platform { } // the following native methods are implemented in Platform.c - private native static boolean nIsBigEndian(); - private native static String nGetExtraLibraries(); - private native static int nGetLibraryForFeature(int feature); + private static native boolean nIsBigEndian(); + private static native String nGetExtraLibraries(); + private static native int nGetLibraryForFeature(int feature); /** * Read the required system properties. diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/PortMixer.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/PortMixer.java index ee0fbd064ae..8bf34bd8fdf 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/PortMixer.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/PortMixer.java @@ -422,7 +422,7 @@ final class PortMixer extends AbstractMixer { private boolean closed = false; // predefined float control types. See also Ports.h - private final static FloatControl.Type[] FLOAT_CONTROL_TYPES = { + private static final FloatControl.Type[] FLOAT_CONTROL_TYPES = { null, FloatControl.Type.BALANCE, FloatControl.Type.MASTER_GAIN, diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/RealTimeSequencer.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/RealTimeSequencer.java index ea782e811b0..b26708b12f1 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/RealTimeSequencer.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/RealTimeSequencer.java @@ -51,8 +51,8 @@ final class RealTimeSequencer extends AbstractMidiDevice // STATIC VARIABLES /** debugging flags */ - private final static boolean DEBUG_PUMP = false; - private final static boolean DEBUG_PUMP_ALL = false; + private static final boolean DEBUG_PUMP = false; + private static final boolean DEBUG_PUMP_ALL = false; /** * Event Dispatcher thread. Should be using a shared event diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SF2Modulator.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SF2Modulator.java index 2d85032ce4d..11930714219 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SF2Modulator.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SF2Modulator.java @@ -31,24 +31,24 @@ package com.sun.media.sound; */ public final class SF2Modulator { - public final static int SOURCE_NONE = 0; - public final static int SOURCE_NOTE_ON_VELOCITY = 2; - public final static int SOURCE_NOTE_ON_KEYNUMBER = 3; - public final static int SOURCE_POLY_PRESSURE = 10; - public final static int SOURCE_CHANNEL_PRESSURE = 13; - public final static int SOURCE_PITCH_WHEEL = 14; - public final static int SOURCE_PITCH_SENSITIVITY = 16; - public final static int SOURCE_MIDI_CONTROL = 128 * 1; - public final static int SOURCE_DIRECTION_MIN_MAX = 256 * 0; - public final static int SOURCE_DIRECTION_MAX_MIN = 256 * 1; - public final static int SOURCE_POLARITY_UNIPOLAR = 512 * 0; - public final static int SOURCE_POLARITY_BIPOLAR = 512 * 1; - public final static int SOURCE_TYPE_LINEAR = 1024 * 0; - public final static int SOURCE_TYPE_CONCAVE = 1024 * 1; - public final static int SOURCE_TYPE_CONVEX = 1024 * 2; - public final static int SOURCE_TYPE_SWITCH = 1024 * 3; - public final static int TRANSFORM_LINEAR = 0; - public final static int TRANSFORM_ABSOLUTE = 2; + public static final int SOURCE_NONE = 0; + public static final int SOURCE_NOTE_ON_VELOCITY = 2; + public static final int SOURCE_NOTE_ON_KEYNUMBER = 3; + public static final int SOURCE_POLY_PRESSURE = 10; + public static final int SOURCE_CHANNEL_PRESSURE = 13; + public static final int SOURCE_PITCH_WHEEL = 14; + public static final int SOURCE_PITCH_SENSITIVITY = 16; + public static final int SOURCE_MIDI_CONTROL = 128 * 1; + public static final int SOURCE_DIRECTION_MIN_MAX = 256 * 0; + public static final int SOURCE_DIRECTION_MAX_MIN = 256 * 1; + public static final int SOURCE_POLARITY_UNIPOLAR = 512 * 0; + public static final int SOURCE_POLARITY_BIPOLAR = 512 * 1; + public static final int SOURCE_TYPE_LINEAR = 1024 * 0; + public static final int SOURCE_TYPE_CONCAVE = 1024 * 1; + public static final int SOURCE_TYPE_CONVEX = 1024 * 2; + public static final int SOURCE_TYPE_SWITCH = 1024 * 3; + public static final int TRANSFORM_LINEAR = 0; + public static final int TRANSFORM_ABSOLUTE = 2; int sourceOperator; int destinationOperator; short amount; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SF2Region.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SF2Region.java index 02dd53e97c9..264c3f9038c 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SF2Region.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SF2Region.java @@ -36,67 +36,67 @@ import java.util.Map; */ public class SF2Region { - public final static int GENERATOR_STARTADDRSOFFSET = 0; - public final static int GENERATOR_ENDADDRSOFFSET = 1; - public final static int GENERATOR_STARTLOOPADDRSOFFSET = 2; - public final static int GENERATOR_ENDLOOPADDRSOFFSET = 3; - public final static int GENERATOR_STARTADDRSCOARSEOFFSET = 4; - public final static int GENERATOR_MODLFOTOPITCH = 5; - public final static int GENERATOR_VIBLFOTOPITCH = 6; - public final static int GENERATOR_MODENVTOPITCH = 7; - public final static int GENERATOR_INITIALFILTERFC = 8; - public final static int GENERATOR_INITIALFILTERQ = 9; - public final static int GENERATOR_MODLFOTOFILTERFC = 10; - public final static int GENERATOR_MODENVTOFILTERFC = 11; - public final static int GENERATOR_ENDADDRSCOARSEOFFSET = 12; - public final static int GENERATOR_MODLFOTOVOLUME = 13; - public final static int GENERATOR_UNUSED1 = 14; - public final static int GENERATOR_CHORUSEFFECTSSEND = 15; - public final static int GENERATOR_REVERBEFFECTSSEND = 16; - public final static int GENERATOR_PAN = 17; - public final static int GENERATOR_UNUSED2 = 18; - public final static int GENERATOR_UNUSED3 = 19; - public final static int GENERATOR_UNUSED4 = 20; - public final static int GENERATOR_DELAYMODLFO = 21; - public final static int GENERATOR_FREQMODLFO = 22; - public final static int GENERATOR_DELAYVIBLFO = 23; - public final static int GENERATOR_FREQVIBLFO = 24; - public final static int GENERATOR_DELAYMODENV = 25; - public final static int GENERATOR_ATTACKMODENV = 26; - public final static int GENERATOR_HOLDMODENV = 27; - public final static int GENERATOR_DECAYMODENV = 28; - public final static int GENERATOR_SUSTAINMODENV = 29; - public final static int GENERATOR_RELEASEMODENV = 30; - public final static int GENERATOR_KEYNUMTOMODENVHOLD = 31; - public final static int GENERATOR_KEYNUMTOMODENVDECAY = 32; - public final static int GENERATOR_DELAYVOLENV = 33; - public final static int GENERATOR_ATTACKVOLENV = 34; - public final static int GENERATOR_HOLDVOLENV = 35; - public final static int GENERATOR_DECAYVOLENV = 36; - public final static int GENERATOR_SUSTAINVOLENV = 37; - public final static int GENERATOR_RELEASEVOLENV = 38; - public final static int GENERATOR_KEYNUMTOVOLENVHOLD = 39; - public final static int GENERATOR_KEYNUMTOVOLENVDECAY = 40; - public final static int GENERATOR_INSTRUMENT = 41; - public final static int GENERATOR_RESERVED1 = 42; - public final static int GENERATOR_KEYRANGE = 43; - public final static int GENERATOR_VELRANGE = 44; - public final static int GENERATOR_STARTLOOPADDRSCOARSEOFFSET = 45; - public final static int GENERATOR_KEYNUM = 46; - public final static int GENERATOR_VELOCITY = 47; - public final static int GENERATOR_INITIALATTENUATION = 48; - public final static int GENERATOR_RESERVED2 = 49; - public final static int GENERATOR_ENDLOOPADDRSCOARSEOFFSET = 50; - public final static int GENERATOR_COARSETUNE = 51; - public final static int GENERATOR_FINETUNE = 52; - public final static int GENERATOR_SAMPLEID = 53; - public final static int GENERATOR_SAMPLEMODES = 54; - public final static int GENERATOR_RESERVED3 = 55; - public final static int GENERATOR_SCALETUNING = 56; - public final static int GENERATOR_EXCLUSIVECLASS = 57; - public final static int GENERATOR_OVERRIDINGROOTKEY = 58; - public final static int GENERATOR_UNUSED5 = 59; - public final static int GENERATOR_ENDOPR = 60; + public static final int GENERATOR_STARTADDRSOFFSET = 0; + public static final int GENERATOR_ENDADDRSOFFSET = 1; + public static final int GENERATOR_STARTLOOPADDRSOFFSET = 2; + public static final int GENERATOR_ENDLOOPADDRSOFFSET = 3; + public static final int GENERATOR_STARTADDRSCOARSEOFFSET = 4; + public static final int GENERATOR_MODLFOTOPITCH = 5; + public static final int GENERATOR_VIBLFOTOPITCH = 6; + public static final int GENERATOR_MODENVTOPITCH = 7; + public static final int GENERATOR_INITIALFILTERFC = 8; + public static final int GENERATOR_INITIALFILTERQ = 9; + public static final int GENERATOR_MODLFOTOFILTERFC = 10; + public static final int GENERATOR_MODENVTOFILTERFC = 11; + public static final int GENERATOR_ENDADDRSCOARSEOFFSET = 12; + public static final int GENERATOR_MODLFOTOVOLUME = 13; + public static final int GENERATOR_UNUSED1 = 14; + public static final int GENERATOR_CHORUSEFFECTSSEND = 15; + public static final int GENERATOR_REVERBEFFECTSSEND = 16; + public static final int GENERATOR_PAN = 17; + public static final int GENERATOR_UNUSED2 = 18; + public static final int GENERATOR_UNUSED3 = 19; + public static final int GENERATOR_UNUSED4 = 20; + public static final int GENERATOR_DELAYMODLFO = 21; + public static final int GENERATOR_FREQMODLFO = 22; + public static final int GENERATOR_DELAYVIBLFO = 23; + public static final int GENERATOR_FREQVIBLFO = 24; + public static final int GENERATOR_DELAYMODENV = 25; + public static final int GENERATOR_ATTACKMODENV = 26; + public static final int GENERATOR_HOLDMODENV = 27; + public static final int GENERATOR_DECAYMODENV = 28; + public static final int GENERATOR_SUSTAINMODENV = 29; + public static final int GENERATOR_RELEASEMODENV = 30; + public static final int GENERATOR_KEYNUMTOMODENVHOLD = 31; + public static final int GENERATOR_KEYNUMTOMODENVDECAY = 32; + public static final int GENERATOR_DELAYVOLENV = 33; + public static final int GENERATOR_ATTACKVOLENV = 34; + public static final int GENERATOR_HOLDVOLENV = 35; + public static final int GENERATOR_DECAYVOLENV = 36; + public static final int GENERATOR_SUSTAINVOLENV = 37; + public static final int GENERATOR_RELEASEVOLENV = 38; + public static final int GENERATOR_KEYNUMTOVOLENVHOLD = 39; + public static final int GENERATOR_KEYNUMTOVOLENVDECAY = 40; + public static final int GENERATOR_INSTRUMENT = 41; + public static final int GENERATOR_RESERVED1 = 42; + public static final int GENERATOR_KEYRANGE = 43; + public static final int GENERATOR_VELRANGE = 44; + public static final int GENERATOR_STARTLOOPADDRSCOARSEOFFSET = 45; + public static final int GENERATOR_KEYNUM = 46; + public static final int GENERATOR_VELOCITY = 47; + public static final int GENERATOR_INITIALATTENUATION = 48; + public static final int GENERATOR_RESERVED2 = 49; + public static final int GENERATOR_ENDLOOPADDRSCOARSEOFFSET = 50; + public static final int GENERATOR_COARSETUNE = 51; + public static final int GENERATOR_FINETUNE = 52; + public static final int GENERATOR_SAMPLEID = 53; + public static final int GENERATOR_SAMPLEMODES = 54; + public static final int GENERATOR_RESERVED3 = 55; + public static final int GENERATOR_SCALETUNING = 56; + public static final int GENERATOR_EXCLUSIVECLASS = 57; + public static final int GENERATOR_OVERRIDINGROOTKEY = 58; + public static final int GENERATOR_UNUSED5 = 59; + public static final int GENERATOR_ENDOPR = 60; protected Map generators = new HashMap(); protected List modulators = new ArrayList(); @@ -108,7 +108,7 @@ public class SF2Region { return generators.containsKey(generator); } - static public short getDefaultValue(int generator) { + public static short getDefaultValue(int generator) { if (generator == 8) return (short)13500; if (generator == 21) return (short)-12000; if (generator == 23) return (short)-12000; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftEnvelopeGenerator.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftEnvelopeGenerator.java index ee0c9f7dab1..cf4d2894431 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftEnvelopeGenerator.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftEnvelopeGenerator.java @@ -31,15 +31,15 @@ package com.sun.media.sound; */ public final class SoftEnvelopeGenerator implements SoftProcess { - public final static int EG_OFF = 0; - public final static int EG_DELAY = 1; - public final static int EG_ATTACK = 2; - public final static int EG_HOLD = 3; - public final static int EG_DECAY = 4; - public final static int EG_SUSTAIN = 5; - public final static int EG_RELEASE = 6; - public final static int EG_SHUTDOWN = 7; - public final static int EG_END = 8; + public static final int EG_OFF = 0; + public static final int EG_DELAY = 1; + public static final int EG_ATTACK = 2; + public static final int EG_HOLD = 3; + public static final int EG_DECAY = 4; + public static final int EG_SUSTAIN = 5; + public static final int EG_RELEASE = 6; + public static final int EG_SHUTDOWN = 7; + public static final int EG_END = 8; int max_count = 10; int used_count = 0; private final int[] stage = new int[max_count]; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftFilter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftFilter.java index 187fa20508e..98b4c7af9df 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftFilter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftFilter.java @@ -35,13 +35,13 @@ package com.sun.media.sound; */ public final class SoftFilter { - public final static int FILTERTYPE_LP6 = 0x00; - public final static int FILTERTYPE_LP12 = 0x01; - public final static int FILTERTYPE_HP12 = 0x11; - public final static int FILTERTYPE_BP12 = 0x21; - public final static int FILTERTYPE_NP12 = 0x31; - public final static int FILTERTYPE_LP24 = 0x03; - public final static int FILTERTYPE_HP24 = 0x13; + public static final int FILTERTYPE_LP6 = 0x00; + public static final int FILTERTYPE_LP12 = 0x01; + public static final int FILTERTYPE_HP12 = 0x11; + public static final int FILTERTYPE_BP12 = 0x21; + public static final int FILTERTYPE_NP12 = 0x31; + public static final int FILTERTYPE_LP24 = 0x03; + public static final int FILTERTYPE_HP24 = 0x13; // // 0x0 = 1st-order, 6 dB/oct diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMainMixer.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMainMixer.java index 02ce9e02518..d3f8713180c 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMainMixer.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMainMixer.java @@ -53,20 +53,20 @@ public final class SoftMainMixer { SoftAudioBuffer[] buffers; } - public final static int CHANNEL_LEFT = 0; - public final static int CHANNEL_RIGHT = 1; - public final static int CHANNEL_MONO = 2; - public final static int CHANNEL_DELAY_LEFT = 3; - public final static int CHANNEL_DELAY_RIGHT = 4; - public final static int CHANNEL_DELAY_MONO = 5; - public final static int CHANNEL_EFFECT1 = 6; - public final static int CHANNEL_EFFECT2 = 7; - public final static int CHANNEL_DELAY_EFFECT1 = 8; - public final static int CHANNEL_DELAY_EFFECT2 = 9; - public final static int CHANNEL_LEFT_DRY = 10; - public final static int CHANNEL_RIGHT_DRY = 11; - public final static int CHANNEL_SCRATCH1 = 12; - public final static int CHANNEL_SCRATCH2 = 13; + public static final int CHANNEL_LEFT = 0; + public static final int CHANNEL_RIGHT = 1; + public static final int CHANNEL_MONO = 2; + public static final int CHANNEL_DELAY_LEFT = 3; + public static final int CHANNEL_DELAY_RIGHT = 4; + public static final int CHANNEL_DELAY_MONO = 5; + public static final int CHANNEL_EFFECT1 = 6; + public static final int CHANNEL_EFFECT2 = 7; + public static final int CHANNEL_DELAY_EFFECT1 = 8; + public static final int CHANNEL_DELAY_EFFECT2 = 9; + public static final int CHANNEL_LEFT_DRY = 10; + public static final int CHANNEL_RIGHT_DRY = 11; + public static final int CHANNEL_SCRATCH1 = 12; + public static final int CHANNEL_SCRATCH2 = 13; boolean active_sensing_on = false; private long msec_last_activity = -1; private boolean pusher_silent = false; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMixingMainMixer.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMixingMainMixer.java index 43e796ff14f..c07bc59befa 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMixingMainMixer.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMixingMainMixer.java @@ -39,29 +39,29 @@ import javax.sound.sampled.AudioSystem; */ public final class SoftMixingMainMixer { - public final static int CHANNEL_LEFT = 0; + public static final int CHANNEL_LEFT = 0; - public final static int CHANNEL_RIGHT = 1; + public static final int CHANNEL_RIGHT = 1; - public final static int CHANNEL_EFFECT1 = 2; + public static final int CHANNEL_EFFECT1 = 2; - public final static int CHANNEL_EFFECT2 = 3; + public static final int CHANNEL_EFFECT2 = 3; - public final static int CHANNEL_EFFECT3 = 4; + public static final int CHANNEL_EFFECT3 = 4; - public final static int CHANNEL_EFFECT4 = 5; + public static final int CHANNEL_EFFECT4 = 5; - public final static int CHANNEL_LEFT_DRY = 10; + public static final int CHANNEL_LEFT_DRY = 10; - public final static int CHANNEL_RIGHT_DRY = 11; + public static final int CHANNEL_RIGHT_DRY = 11; - public final static int CHANNEL_SCRATCH1 = 12; + public static final int CHANNEL_SCRATCH1 = 12; - public final static int CHANNEL_SCRATCH2 = 13; + public static final int CHANNEL_SCRATCH2 = 13; - public final static int CHANNEL_CHANNELMIXER_LEFT = 14; + public static final int CHANNEL_CHANNELMIXER_LEFT = 14; - public final static int CHANNEL_CHANNELMIXER_RIGHT = 15; + public static final int CHANNEL_CHANNELMIXER_RIGHT = 15; private final SoftMixingMixer mixer; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftReverb.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftReverb.java index c30aae03f6d..3876758ad96 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftReverb.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftReverb.java @@ -35,7 +35,7 @@ import java.util.Arrays; */ public final class SoftReverb implements SoftAudioProcessor { - private final static class Delay { + private static final class Delay { private float[] delaybuffer; private int rovepos = 0; @@ -70,7 +70,7 @@ public final class SoftReverb implements SoftAudioProcessor { } } - private final static class AllPass { + private static final class AllPass { private final float[] delaybuffer; private final int delaybuffersize; @@ -117,7 +117,7 @@ public final class SoftReverb implements SoftAudioProcessor { } } - private final static class Comb { + private static final class Comb { private final float[] delaybuffer; private final int delaybuffersize; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java index b888742970f..277e3db2b25 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java @@ -178,7 +178,7 @@ public final class SoftSynthesizer implements AudioSynthesizer, static final String INFO_VENDOR = "OpenJDK"; static final String INFO_DESCRIPTION = "Software MIDI Synthesizer"; static final String INFO_VERSION = "1.0"; - final static MidiDevice.Info info = new Info(); + static final MidiDevice.Info info = new Info(); private static SourceDataLine testline = null; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/StandardMidiFileWriter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/StandardMidiFileWriter.java index 365fd9c6c28..f03921e72df 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/StandardMidiFileWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/StandardMidiFileWriter.java @@ -307,7 +307,7 @@ public final class StandardMidiFileWriter extends MidiFileWriter { return ERROR; } - private final static long mask = 0x7F; + private static final long mask = 0x7F; private int writeVarInt(long value) throws IOException { int len = 1; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/UlawCodec.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/UlawCodec.java index 337fe199788..5dde45b734b 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/UlawCodec.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/UlawCodec.java @@ -43,8 +43,8 @@ public final class UlawCodec extends SunCodec { /* Tables used for U-law decoding */ - private final static byte[] ULAW_TABH = new byte[256]; - private final static byte[] ULAW_TABL = new byte[256]; + private static final byte[] ULAW_TABH = new byte[256]; + private static final byte[] ULAW_TABL = new byte[256]; private static final AudioFormat.Encoding[] ulawEncodings = {AudioFormat.Encoding.ULAW, AudioFormat.Encoding.PCM_SIGNED}; diff --git a/jdk/src/java.desktop/share/classes/java/applet/Applet.java b/jdk/src/java.desktop/share/classes/java/applet/Applet.java index 9fb8551881a..aed6eae421b 100644 --- a/jdk/src/java.desktop/share/classes/java/applet/Applet.java +++ b/jdk/src/java.desktop/share/classes/java/applet/Applet.java @@ -79,7 +79,7 @@ public class Applet extends Panel { * likely move it into RUNNING state). * The stub field will be restored by the reader. */ - transient private AppletStub stub; + private transient AppletStub stub; /* version ID for serialized form. */ private static final long serialVersionUID = -5836846270535785031L; @@ -310,7 +310,7 @@ public class Applet extends Panel { * * @since 1.2 */ - public final static AudioClip newAudioClip(URL url) { + public static final AudioClip newAudioClip(URL url) { return new sun.applet.AppletAudioClip(url); } diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java b/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java index abad30da22b..04c4effeafa 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java @@ -128,107 +128,107 @@ public abstract class AWTEvent extends EventObject { /** * The event mask for selecting component events. */ - public final static long COMPONENT_EVENT_MASK = 0x01; + public static final long COMPONENT_EVENT_MASK = 0x01; /** * The event mask for selecting container events. */ - public final static long CONTAINER_EVENT_MASK = 0x02; + public static final long CONTAINER_EVENT_MASK = 0x02; /** * The event mask for selecting focus events. */ - public final static long FOCUS_EVENT_MASK = 0x04; + public static final long FOCUS_EVENT_MASK = 0x04; /** * The event mask for selecting key events. */ - public final static long KEY_EVENT_MASK = 0x08; + public static final long KEY_EVENT_MASK = 0x08; /** * The event mask for selecting mouse events. */ - public final static long MOUSE_EVENT_MASK = 0x10; + public static final long MOUSE_EVENT_MASK = 0x10; /** * The event mask for selecting mouse motion events. */ - public final static long MOUSE_MOTION_EVENT_MASK = 0x20; + public static final long MOUSE_MOTION_EVENT_MASK = 0x20; /** * The event mask for selecting window events. */ - public final static long WINDOW_EVENT_MASK = 0x40; + public static final long WINDOW_EVENT_MASK = 0x40; /** * The event mask for selecting action events. */ - public final static long ACTION_EVENT_MASK = 0x80; + public static final long ACTION_EVENT_MASK = 0x80; /** * The event mask for selecting adjustment events. */ - public final static long ADJUSTMENT_EVENT_MASK = 0x100; + public static final long ADJUSTMENT_EVENT_MASK = 0x100; /** * The event mask for selecting item events. */ - public final static long ITEM_EVENT_MASK = 0x200; + public static final long ITEM_EVENT_MASK = 0x200; /** * The event mask for selecting text events. */ - public final static long TEXT_EVENT_MASK = 0x400; + public static final long TEXT_EVENT_MASK = 0x400; /** * The event mask for selecting input method events. */ - public final static long INPUT_METHOD_EVENT_MASK = 0x800; + public static final long INPUT_METHOD_EVENT_MASK = 0x800; /** * The pseudo event mask for enabling input methods. * We're using one bit in the eventMask so we don't need * a separate field inputMethodsEnabled. */ - final static long INPUT_METHODS_ENABLED_MASK = 0x1000; + static final long INPUT_METHODS_ENABLED_MASK = 0x1000; /** * The event mask for selecting paint events. */ - public final static long PAINT_EVENT_MASK = 0x2000; + public static final long PAINT_EVENT_MASK = 0x2000; /** * The event mask for selecting invocation events. */ - public final static long INVOCATION_EVENT_MASK = 0x4000; + public static final long INVOCATION_EVENT_MASK = 0x4000; /** * The event mask for selecting hierarchy events. */ - public final static long HIERARCHY_EVENT_MASK = 0x8000; + public static final long HIERARCHY_EVENT_MASK = 0x8000; /** * The event mask for selecting hierarchy bounds events. */ - public final static long HIERARCHY_BOUNDS_EVENT_MASK = 0x10000; + public static final long HIERARCHY_BOUNDS_EVENT_MASK = 0x10000; /** * The event mask for selecting mouse wheel events. * @since 1.4 */ - public final static long MOUSE_WHEEL_EVENT_MASK = 0x20000; + public static final long MOUSE_WHEEL_EVENT_MASK = 0x20000; /** * The event mask for selecting window state events. * @since 1.4 */ - public final static long WINDOW_STATE_EVENT_MASK = 0x40000; + public static final long WINDOW_STATE_EVENT_MASK = 0x40000; /** * The event mask for selecting window focus events. * @since 1.4 */ - public final static long WINDOW_FOCUS_EVENT_MASK = 0x80000; + public static final long WINDOW_FOCUS_EVENT_MASK = 0x80000; /** * WARNING: there are more mask defined privately. See @@ -239,7 +239,7 @@ public abstract class AWTEvent extends EventObject { * The maximum value for reserved AWT event IDs. Programs defining * their own event IDs should use IDs greater than this value. */ - public final static int RESERVED_ID_MAX = 1999; + public static final int RESERVED_ID_MAX = 1999; // security stuff private static Field inputEvent_CanAccessSystemClipboard_Field = null; diff --git a/jdk/src/java.desktop/share/classes/java/awt/BasicStroke.java b/jdk/src/java.desktop/share/classes/java/awt/BasicStroke.java index a2b14cfa798..7e20e92af3a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/BasicStroke.java +++ b/jdk/src/java.desktop/share/classes/java/awt/BasicStroke.java @@ -117,39 +117,39 @@ public class BasicStroke implements Stroke { * Joins path segments by extending their outside edges until * they meet. */ - @Native public final static int JOIN_MITER = 0; + @Native public static final int JOIN_MITER = 0; /** * Joins path segments by rounding off the corner at a radius * of half the line width. */ - @Native public final static int JOIN_ROUND = 1; + @Native public static final int JOIN_ROUND = 1; /** * Joins path segments by connecting the outer corners of their * wide outlines with a straight segment. */ - @Native public final static int JOIN_BEVEL = 2; + @Native public static final int JOIN_BEVEL = 2; /** * Ends unclosed subpaths and dash segments with no added * decoration. */ - @Native public final static int CAP_BUTT = 0; + @Native public static final int CAP_BUTT = 0; /** * Ends unclosed subpaths and dash segments with a round * decoration that has a radius equal to half of the width * of the pen. */ - @Native public final static int CAP_ROUND = 1; + @Native public static final int CAP_ROUND = 1; /** * Ends unclosed subpaths and dash segments with a square * projection that extends beyond the end of the segment * to a distance equal to half of the line width. */ - @Native public final static int CAP_SQUARE = 2; + @Native public static final int CAP_SQUARE = 2; float width; diff --git a/jdk/src/java.desktop/share/classes/java/awt/Color.java b/jdk/src/java.desktop/share/classes/java/awt/Color.java index 3a94d73ac74..da62fc631da 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Color.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Color.java @@ -62,145 +62,145 @@ public class Color implements Paint, java.io.Serializable { /** * The color white. In the default sRGB space. */ - public final static Color white = new Color(255, 255, 255); + public static final Color white = new Color(255, 255, 255); /** * The color white. In the default sRGB space. * @since 1.4 */ - public final static Color WHITE = white; + public static final Color WHITE = white; /** * The color light gray. In the default sRGB space. */ - public final static Color lightGray = new Color(192, 192, 192); + public static final Color lightGray = new Color(192, 192, 192); /** * The color light gray. In the default sRGB space. * @since 1.4 */ - public final static Color LIGHT_GRAY = lightGray; + public static final Color LIGHT_GRAY = lightGray; /** * The color gray. In the default sRGB space. */ - public final static Color gray = new Color(128, 128, 128); + public static final Color gray = new Color(128, 128, 128); /** * The color gray. In the default sRGB space. * @since 1.4 */ - public final static Color GRAY = gray; + public static final Color GRAY = gray; /** * The color dark gray. In the default sRGB space. */ - public final static Color darkGray = new Color(64, 64, 64); + public static final Color darkGray = new Color(64, 64, 64); /** * The color dark gray. In the default sRGB space. * @since 1.4 */ - public final static Color DARK_GRAY = darkGray; + public static final Color DARK_GRAY = darkGray; /** * The color black. In the default sRGB space. */ - public final static Color black = new Color(0, 0, 0); + public static final Color black = new Color(0, 0, 0); /** * The color black. In the default sRGB space. * @since 1.4 */ - public final static Color BLACK = black; + public static final Color BLACK = black; /** * The color red. In the default sRGB space. */ - public final static Color red = new Color(255, 0, 0); + public static final Color red = new Color(255, 0, 0); /** * The color red. In the default sRGB space. * @since 1.4 */ - public final static Color RED = red; + public static final Color RED = red; /** * The color pink. In the default sRGB space. */ - public final static Color pink = new Color(255, 175, 175); + public static final Color pink = new Color(255, 175, 175); /** * The color pink. In the default sRGB space. * @since 1.4 */ - public final static Color PINK = pink; + public static final Color PINK = pink; /** * The color orange. In the default sRGB space. */ - public final static Color orange = new Color(255, 200, 0); + public static final Color orange = new Color(255, 200, 0); /** * The color orange. In the default sRGB space. * @since 1.4 */ - public final static Color ORANGE = orange; + public static final Color ORANGE = orange; /** * The color yellow. In the default sRGB space. */ - public final static Color yellow = new Color(255, 255, 0); + public static final Color yellow = new Color(255, 255, 0); /** * The color yellow. In the default sRGB space. * @since 1.4 */ - public final static Color YELLOW = yellow; + public static final Color YELLOW = yellow; /** * The color green. In the default sRGB space. */ - public final static Color green = new Color(0, 255, 0); + public static final Color green = new Color(0, 255, 0); /** * The color green. In the default sRGB space. * @since 1.4 */ - public final static Color GREEN = green; + public static final Color GREEN = green; /** * The color magenta. In the default sRGB space. */ - public final static Color magenta = new Color(255, 0, 255); + public static final Color magenta = new Color(255, 0, 255); /** * The color magenta. In the default sRGB space. * @since 1.4 */ - public final static Color MAGENTA = magenta; + public static final Color MAGENTA = magenta; /** * The color cyan. In the default sRGB space. */ - public final static Color cyan = new Color(0, 255, 255); + public static final Color cyan = new Color(0, 255, 255); /** * The color cyan. In the default sRGB space. * @since 1.4 */ - public final static Color CYAN = cyan; + public static final Color CYAN = cyan; /** * The color blue. In the default sRGB space. */ - public final static Color blue = new Color(0, 0, 255); + public static final Color blue = new Color(0, 0, 255); /** * The color blue. In the default sRGB space. * @since 1.4 */ - public final static Color BLUE = blue; + public static final Color BLUE = blue; /** * The color value. diff --git a/jdk/src/java.desktop/share/classes/java/awt/Component.java b/jdk/src/java.desktop/share/classes/java/awt/Component.java index deff1a9e0ae..87bab7eac20 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Component.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Component.java @@ -545,24 +545,24 @@ public abstract class Component implements ImageObserver, MenuContainer, transient InputMethodListener inputMethodListener; /** Internal, constants for serialization */ - final static String actionListenerK = "actionL"; - final static String adjustmentListenerK = "adjustmentL"; - final static String componentListenerK = "componentL"; - final static String containerListenerK = "containerL"; - final static String focusListenerK = "focusL"; - final static String itemListenerK = "itemL"; - final static String keyListenerK = "keyL"; - final static String mouseListenerK = "mouseL"; - final static String mouseMotionListenerK = "mouseMotionL"; - final static String mouseWheelListenerK = "mouseWheelL"; - final static String textListenerK = "textL"; - final static String ownedWindowK = "ownedL"; - final static String windowListenerK = "windowL"; - final static String inputMethodListenerK = "inputMethodL"; - final static String hierarchyListenerK = "hierarchyL"; - final static String hierarchyBoundsListenerK = "hierarchyBoundsL"; - final static String windowStateListenerK = "windowStateL"; - final static String windowFocusListenerK = "windowFocusL"; + static final String actionListenerK = "actionL"; + static final String adjustmentListenerK = "adjustmentL"; + static final String componentListenerK = "componentL"; + static final String containerListenerK = "containerL"; + static final String focusListenerK = "focusL"; + static final String itemListenerK = "itemL"; + static final String keyListenerK = "keyL"; + static final String mouseListenerK = "mouseL"; + static final String mouseMotionListenerK = "mouseMotionL"; + static final String mouseWheelListenerK = "mouseWheelL"; + static final String textListenerK = "textL"; + static final String ownedWindowK = "ownedL"; + static final String windowListenerK = "windowL"; + static final String inputMethodListenerK = "inputMethodL"; + static final String hierarchyListenerK = "hierarchyL"; + static final String hierarchyBoundsListenerK = "hierarchyBoundsL"; + static final String windowStateListenerK = "windowStateL"; + static final String windowFocusListenerK = "windowFocusL"; /** * The eventMask is ONLY set by subclasses via @@ -6209,7 +6209,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * @see #isCoalescingEnabled * @see #checkCoalescing */ - transient private boolean coalescingEnabled = checkCoalescing(); + private transient boolean coalescingEnabled = checkCoalescing(); /** * Weak map of known coalesceEvent overriders. @@ -7916,7 +7916,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } }; - synchronized static void setRequestFocusController(RequestFocusController requestController) + static synchronized void setRequestFocusController(RequestFocusController requestController) { if (requestController == null) { requestFocusController = new DummyRequestFocusController(); @@ -9173,7 +9173,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * to add/remove ComponentListener and FocusListener to track * target Component's state. */ - private volatile transient int propertyListenersCount = 0; + private transient volatile int propertyListenersCount = 0; /** * A component listener to track show/hide/resize events diff --git a/jdk/src/java.desktop/share/classes/java/awt/Container.java b/jdk/src/java.desktop/share/classes/java/awt/Container.java index 0ed78e598df..6e19e26c5d5 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Container.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Container.java @@ -2975,7 +2975,7 @@ public class Container extends Component { } } - final static class WakingRunnable implements Runnable { + static final class WakingRunnable implements Runnable { public void run() { } } @@ -3843,7 +3843,7 @@ public class Container extends Component { * Number of PropertyChangeListener objects registered. It's used * to add/remove ContainerListener to track target Container's state. */ - private volatile transient int propertyListenersCount = 0; + private transient volatile int propertyListenersCount = 0; /** * The handler to fire {@code PropertyChange} diff --git a/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java b/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java index ef010fd9897..312149763df 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java @@ -62,8 +62,8 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy { private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.ContainerOrderFocusTraversalPolicy"); - final private int FORWARD_TRAVERSAL = 0; - final private int BACKWARD_TRAVERSAL = 1; + private final int FORWARD_TRAVERSAL = 0; + private final int BACKWARD_TRAVERSAL = 1; /* * JDK 1.4 serialVersionUID @@ -84,8 +84,8 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy * that they need to invoke getFirstComponent or getLastComponent, the * list should be reused if possible. */ - transient private Container cachedRoot; - transient private List cachedCycle; + private transient Container cachedRoot; + private transient List cachedCycle; /* * We suppose to use getFocusTraversalCycle & getComponentIndex methods in order diff --git a/jdk/src/java.desktop/share/classes/java/awt/Cursor.java b/jdk/src/java.desktop/share/classes/java/awt/Cursor.java index 3e6d9410476..0ca5a3060ad 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Cursor.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Cursor.java @@ -124,7 +124,7 @@ public class Cursor implements java.io.Serializable { /** * This field is a private replacement for 'predefined' array. */ - private final static Cursor[] predefinedPrivate = new Cursor[14]; + private static final Cursor[] predefinedPrivate = new Cursor[14]; /* Localization names and default values */ static final String[][] cursorProperties = { @@ -449,5 +449,5 @@ public class Cursor implements java.io.Serializable { } } - private native static void finalizeImpl(long pData); + private static native void finalizeImpl(long pData); } diff --git a/jdk/src/java.desktop/share/classes/java/awt/Dialog.java b/jdk/src/java.desktop/share/classes/java/awt/Dialog.java index 2b3f4c2584c..84fb5e77e37 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Dialog.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Dialog.java @@ -193,7 +193,7 @@ public class Dialog extends Window { * * @since 1.6 */ - public final static ModalityType DEFAULT_MODALITY_TYPE = ModalityType.APPLICATION_MODAL; + public static final ModalityType DEFAULT_MODALITY_TYPE = ModalityType.APPLICATION_MODAL; /** * True if this dialog is modal, false is the dialog is modeless. @@ -265,7 +265,7 @@ public class Dialog extends Window { }; /* operations with this list should be synchronized on tree lock*/ - transient static IdentityArrayList modalDialogs = new IdentityArrayList(); + static transient IdentityArrayList modalDialogs = new IdentityArrayList(); transient IdentityArrayList blockedWindows = new IdentityArrayList(); diff --git a/jdk/src/java.desktop/share/classes/java/awt/DisplayMode.java b/jdk/src/java.desktop/share/classes/java/awt/DisplayMode.java index 41564300615..12730fde5f4 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/DisplayMode.java +++ b/jdk/src/java.desktop/share/classes/java/awt/DisplayMode.java @@ -92,7 +92,7 @@ public final class DisplayMode { * display mode. * @see #getBitDepth */ - @Native public final static int BIT_DEPTH_MULTI = -1; + @Native public static final int BIT_DEPTH_MULTI = -1; /** * Returns the bit depth of the display, in bits per pixel. This may be @@ -110,7 +110,7 @@ public final class DisplayMode { * Value of the refresh rate if not known. * @see #getRefreshRate */ - @Native public final static int REFRESH_RATE_UNKNOWN = 0; + @Native public static final int REFRESH_RATE_UNKNOWN = 0; /** * Returns the refresh rate of the display, in hertz. This may be diff --git a/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java b/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java index ae728fe295f..11f156094cf 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java +++ b/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java @@ -139,7 +139,7 @@ public class EventQueue { * Dummy runnable to wake up EDT from getNextEvent() after push/pop is performed */ - private final static Runnable dummyRunnable = new Runnable() { + private static final Runnable dummyRunnable = new Runnable() { public void run() { } }; diff --git a/jdk/src/java.desktop/share/classes/java/awt/GraphicsDevice.java b/jdk/src/java.desktop/share/classes/java/awt/GraphicsDevice.java index 819aa49989b..fdc44ca6ab7 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/GraphicsDevice.java +++ b/jdk/src/java.desktop/share/classes/java/awt/GraphicsDevice.java @@ -99,18 +99,18 @@ public abstract class GraphicsDevice { /** * Device is a raster screen. */ - public final static int TYPE_RASTER_SCREEN = 0; + public static final int TYPE_RASTER_SCREEN = 0; /** * Device is a printer. */ - public final static int TYPE_PRINTER = 1; + public static final int TYPE_PRINTER = 1; /** * Device is an image buffer. This buffer can reside in device * or system memory but it is not physically viewable by the user. */ - public final static int TYPE_IMAGE_BUFFER = 2; + public static final int TYPE_IMAGE_BUFFER = 2; /** * Kinds of translucency supported by the underlying system. diff --git a/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java b/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java index f234b1bf784..7f1c6dcd88a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java +++ b/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java @@ -216,7 +216,7 @@ public abstract class KeyboardFocusManager return getCurrentKeyboardFocusManager(AppContext.getAppContext()); } - synchronized static KeyboardFocusManager + static synchronized KeyboardFocusManager getCurrentKeyboardFocusManager(AppContext appcontext) { KeyboardFocusManager manager = (KeyboardFocusManager) @@ -2599,7 +2599,7 @@ public abstract class KeyboardFocusManager * @param comp the component to dispatch the event to * @param event the event to dispatch to the component */ - static private Throwable dispatchAndCatchException(Throwable ex, Component comp, FocusEvent event) { + private static Throwable dispatchAndCatchException(Throwable ex, Component comp, FocusEvent event) { Throwable retEx = null; try { comp.dispatchEvent(event); @@ -2617,7 +2617,7 @@ public abstract class KeyboardFocusManager return ex; } - static private void handleException(Throwable ex) { + private static void handleException(Throwable ex) { ex.printStackTrace(); } diff --git a/jdk/src/java.desktop/share/classes/java/awt/List.java b/jdk/src/java.desktop/share/classes/java/awt/List.java index f8504ca9fe4..4112f87fbe2 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/List.java +++ b/jdk/src/java.desktop/share/classes/java/awt/List.java @@ -209,7 +209,7 @@ public class List extends Component implements ItemSelectable, Accessible { * The default number of visible rows is 4. A list with * zero rows is unusable and unsightly. */ - final static int DEFAULT_VISIBLE_ROWS = 4; + static final int DEFAULT_VISIBLE_ROWS = 4; /** * Creates a new scrolling list initialized to display the specified diff --git a/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java b/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java index b99e1c3eb7f..fca144ac0f8 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java @@ -123,8 +123,8 @@ public abstract class MenuComponent implements java.io.Serializable { /* * Internal constants for serialization. */ - final static String actionListenerK = Component.actionListenerK; - final static String itemListenerK = Component.itemListenerK; + static final String actionListenerK = Component.actionListenerK; + static final String itemListenerK = Component.itemListenerK; /* * JDK 1.1 serialVersionUID diff --git a/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java b/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java index 353a49c52cf..09bee025b5f 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java +++ b/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java @@ -110,7 +110,7 @@ public class RenderingHints Integer.toHexString(privatekey); } - private synchronized static void recordIdentity(Key k) { + private static synchronized void recordIdentity(Key k) { Object identity = k.getIdentity(); Object otherref = identitymap.get(identity); if (otherref != null) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/SequencedEvent.java b/jdk/src/java.desktop/share/classes/java/awt/SequencedEvent.java index 835c040c85c..678067ab143 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/SequencedEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/SequencedEvent.java @@ -135,7 +135,7 @@ class SequencedEvent extends AWTEvent implements ActiveEvent { /** * true only if event exists and nested source appContext is disposed. */ - private final static boolean isOwnerAppContextDisposed(SequencedEvent se) { + private static final boolean isOwnerAppContextDisposed(SequencedEvent se) { if (se != null) { Object target = se.nested.getSource(); if (target instanceof Component) { @@ -159,14 +159,14 @@ class SequencedEvent extends AWTEvent implements ActiveEvent { return this == getFirstWithContext() || disposed; } - private final synchronized static SequencedEvent getFirst() { + private static final synchronized SequencedEvent getFirst() { return list.getFirst(); } /* Disposes all events from disposed AppContext * return first valid event */ - private final static SequencedEvent getFirstWithContext() { + private static final SequencedEvent getFirstWithContext() { SequencedEvent first = getFirst(); while(isOwnerAppContextDisposed(first)) { first.dispose(); diff --git a/jdk/src/java.desktop/share/classes/java/awt/SplashScreen.java b/jdk/src/java.desktop/share/classes/java/awt/SplashScreen.java index 28ff40eb73c..3cf8ac0a6cd 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/SplashScreen.java +++ b/jdk/src/java.desktop/share/classes/java/awt/SplashScreen.java @@ -411,14 +411,14 @@ public final class SplashScreen { private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.SplashScreen"); - private native static void _update(long splashPtr, int[] data, int x, int y, int width, int height, int scanlineStride); - private native static boolean _isVisible(long splashPtr); - private native static Rectangle _getBounds(long splashPtr); - private native static long _getInstance(); - private native static void _close(long splashPtr); - private native static String _getImageFileName(long splashPtr); - private native static String _getImageJarName(long SplashPtr); - private native static boolean _setImageData(long SplashPtr, byte[] data); - private native static float _getScaleFactor(long SplashPtr); + private static native void _update(long splashPtr, int[] data, int x, int y, int width, int height, int scanlineStride); + private static native boolean _isVisible(long splashPtr); + private static native Rectangle _getBounds(long splashPtr); + private static native long _getInstance(); + private static native void _close(long splashPtr); + private static native String _getImageFileName(long splashPtr); + private static native String _getImageJarName(long SplashPtr); + private static native boolean _setImageData(long SplashPtr, byte[] data); + private static native float _getScaleFactor(long SplashPtr); } diff --git a/jdk/src/java.desktop/share/classes/java/awt/SystemColor.java b/jdk/src/java.desktop/share/classes/java/awt/SystemColor.java index 65b01b2c05b..38a173f339a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/SystemColor.java +++ b/jdk/src/java.desktop/share/classes/java/awt/SystemColor.java @@ -58,187 +58,187 @@ public final class SystemColor extends Color implements java.io.Serializable { * {@link #desktop} system color. * @see SystemColor#desktop */ - @Native public final static int DESKTOP = 0; + @Native public static final int DESKTOP = 0; /** * The array index for the * {@link #activeCaption} system color. * @see SystemColor#activeCaption */ - @Native public final static int ACTIVE_CAPTION = 1; + @Native public static final int ACTIVE_CAPTION = 1; /** * The array index for the * {@link #activeCaptionText} system color. * @see SystemColor#activeCaptionText */ - @Native public final static int ACTIVE_CAPTION_TEXT = 2; + @Native public static final int ACTIVE_CAPTION_TEXT = 2; /** * The array index for the * {@link #activeCaptionBorder} system color. * @see SystemColor#activeCaptionBorder */ - @Native public final static int ACTIVE_CAPTION_BORDER = 3; + @Native public static final int ACTIVE_CAPTION_BORDER = 3; /** * The array index for the * {@link #inactiveCaption} system color. * @see SystemColor#inactiveCaption */ - @Native public final static int INACTIVE_CAPTION = 4; + @Native public static final int INACTIVE_CAPTION = 4; /** * The array index for the * {@link #inactiveCaptionText} system color. * @see SystemColor#inactiveCaptionText */ - @Native public final static int INACTIVE_CAPTION_TEXT = 5; + @Native public static final int INACTIVE_CAPTION_TEXT = 5; /** * The array index for the * {@link #inactiveCaptionBorder} system color. * @see SystemColor#inactiveCaptionBorder */ - @Native public final static int INACTIVE_CAPTION_BORDER = 6; + @Native public static final int INACTIVE_CAPTION_BORDER = 6; /** * The array index for the * {@link #window} system color. * @see SystemColor#window */ - @Native public final static int WINDOW = 7; + @Native public static final int WINDOW = 7; /** * The array index for the * {@link #windowBorder} system color. * @see SystemColor#windowBorder */ - @Native public final static int WINDOW_BORDER = 8; + @Native public static final int WINDOW_BORDER = 8; /** * The array index for the * {@link #windowText} system color. * @see SystemColor#windowText */ - @Native public final static int WINDOW_TEXT = 9; + @Native public static final int WINDOW_TEXT = 9; /** * The array index for the * {@link #menu} system color. * @see SystemColor#menu */ - @Native public final static int MENU = 10; + @Native public static final int MENU = 10; /** * The array index for the * {@link #menuText} system color. * @see SystemColor#menuText */ - @Native public final static int MENU_TEXT = 11; + @Native public static final int MENU_TEXT = 11; /** * The array index for the * {@link #text} system color. * @see SystemColor#text */ - @Native public final static int TEXT = 12; + @Native public static final int TEXT = 12; /** * The array index for the * {@link #textText} system color. * @see SystemColor#textText */ - @Native public final static int TEXT_TEXT = 13; + @Native public static final int TEXT_TEXT = 13; /** * The array index for the * {@link #textHighlight} system color. * @see SystemColor#textHighlight */ - @Native public final static int TEXT_HIGHLIGHT = 14; + @Native public static final int TEXT_HIGHLIGHT = 14; /** * The array index for the * {@link #textHighlightText} system color. * @see SystemColor#textHighlightText */ - @Native public final static int TEXT_HIGHLIGHT_TEXT = 15; + @Native public static final int TEXT_HIGHLIGHT_TEXT = 15; /** * The array index for the * {@link #textInactiveText} system color. * @see SystemColor#textInactiveText */ - @Native public final static int TEXT_INACTIVE_TEXT = 16; + @Native public static final int TEXT_INACTIVE_TEXT = 16; /** * The array index for the * {@link #control} system color. * @see SystemColor#control */ - @Native public final static int CONTROL = 17; + @Native public static final int CONTROL = 17; /** * The array index for the * {@link #controlText} system color. * @see SystemColor#controlText */ - @Native public final static int CONTROL_TEXT = 18; + @Native public static final int CONTROL_TEXT = 18; /** * The array index for the * {@link #controlHighlight} system color. * @see SystemColor#controlHighlight */ - @Native public final static int CONTROL_HIGHLIGHT = 19; + @Native public static final int CONTROL_HIGHLIGHT = 19; /** * The array index for the * {@link #controlLtHighlight} system color. * @see SystemColor#controlLtHighlight */ - @Native public final static int CONTROL_LT_HIGHLIGHT = 20; + @Native public static final int CONTROL_LT_HIGHLIGHT = 20; /** * The array index for the * {@link #controlShadow} system color. * @see SystemColor#controlShadow */ - @Native public final static int CONTROL_SHADOW = 21; + @Native public static final int CONTROL_SHADOW = 21; /** * The array index for the * {@link #controlDkShadow} system color. * @see SystemColor#controlDkShadow */ - @Native public final static int CONTROL_DK_SHADOW = 22; + @Native public static final int CONTROL_DK_SHADOW = 22; /** * The array index for the * {@link #scrollbar} system color. * @see SystemColor#scrollbar */ - @Native public final static int SCROLLBAR = 23; + @Native public static final int SCROLLBAR = 23; /** * The array index for the * {@link #info} system color. * @see SystemColor#info */ - @Native public final static int INFO = 24; + @Native public static final int INFO = 24; /** * The array index for the * {@link #infoText} system color. * @see SystemColor#infoText */ - @Native public final static int INFO_TEXT = 25; + @Native public static final int INFO_TEXT = 25; /** * The number of system colors in the array. */ - @Native public final static int NUM_COLORS = 26; + @Native public static final int NUM_COLORS = 26; /******************************************************************************************/ @@ -280,146 +280,146 @@ public final class SystemColor extends Color implements java.io.Serializable { /** * The color rendered for the background of the desktop. */ - public final static SystemColor desktop = new SystemColor((byte)DESKTOP); + public static final SystemColor desktop = new SystemColor((byte)DESKTOP); /** * The color rendered for the window-title background of the currently active window. */ - public final static SystemColor activeCaption = new SystemColor((byte)ACTIVE_CAPTION); + public static final SystemColor activeCaption = new SystemColor((byte)ACTIVE_CAPTION); /** * The color rendered for the window-title text of the currently active window. */ - public final static SystemColor activeCaptionText = new SystemColor((byte)ACTIVE_CAPTION_TEXT); + public static final SystemColor activeCaptionText = new SystemColor((byte)ACTIVE_CAPTION_TEXT); /** * The color rendered for the border around the currently active window. */ - public final static SystemColor activeCaptionBorder = new SystemColor((byte)ACTIVE_CAPTION_BORDER); + public static final SystemColor activeCaptionBorder = new SystemColor((byte)ACTIVE_CAPTION_BORDER); /** * The color rendered for the window-title background of inactive windows. */ - public final static SystemColor inactiveCaption = new SystemColor((byte)INACTIVE_CAPTION); + public static final SystemColor inactiveCaption = new SystemColor((byte)INACTIVE_CAPTION); /** * The color rendered for the window-title text of inactive windows. */ - public final static SystemColor inactiveCaptionText = new SystemColor((byte)INACTIVE_CAPTION_TEXT); + public static final SystemColor inactiveCaptionText = new SystemColor((byte)INACTIVE_CAPTION_TEXT); /** * The color rendered for the border around inactive windows. */ - public final static SystemColor inactiveCaptionBorder = new SystemColor((byte)INACTIVE_CAPTION_BORDER); + public static final SystemColor inactiveCaptionBorder = new SystemColor((byte)INACTIVE_CAPTION_BORDER); /** * The color rendered for the background of interior regions inside windows. */ - public final static SystemColor window = new SystemColor((byte)WINDOW); + public static final SystemColor window = new SystemColor((byte)WINDOW); /** * The color rendered for the border around interior regions inside windows. */ - public final static SystemColor windowBorder = new SystemColor((byte)WINDOW_BORDER); + public static final SystemColor windowBorder = new SystemColor((byte)WINDOW_BORDER); /** * The color rendered for text of interior regions inside windows. */ - public final static SystemColor windowText = new SystemColor((byte)WINDOW_TEXT); + public static final SystemColor windowText = new SystemColor((byte)WINDOW_TEXT); /** * The color rendered for the background of menus. */ - public final static SystemColor menu = new SystemColor((byte)MENU); + public static final SystemColor menu = new SystemColor((byte)MENU); /** * The color rendered for the text of menus. */ - public final static SystemColor menuText = new SystemColor((byte)MENU_TEXT); + public static final SystemColor menuText = new SystemColor((byte)MENU_TEXT); /** * The color rendered for the background of text control objects, such as * textfields and comboboxes. */ - public final static SystemColor text = new SystemColor((byte)TEXT); + public static final SystemColor text = new SystemColor((byte)TEXT); /** * The color rendered for the text of text control objects, such as textfields * and comboboxes. */ - public final static SystemColor textText = new SystemColor((byte)TEXT_TEXT); + public static final SystemColor textText = new SystemColor((byte)TEXT_TEXT); /** * The color rendered for the background of selected items, such as in menus, * comboboxes, and text. */ - public final static SystemColor textHighlight = new SystemColor((byte)TEXT_HIGHLIGHT); + public static final SystemColor textHighlight = new SystemColor((byte)TEXT_HIGHLIGHT); /** * The color rendered for the text of selected items, such as in menus, comboboxes, * and text. */ - public final static SystemColor textHighlightText = new SystemColor((byte)TEXT_HIGHLIGHT_TEXT); + public static final SystemColor textHighlightText = new SystemColor((byte)TEXT_HIGHLIGHT_TEXT); /** * The color rendered for the text of inactive items, such as in menus. */ - public final static SystemColor textInactiveText = new SystemColor((byte)TEXT_INACTIVE_TEXT); + public static final SystemColor textInactiveText = new SystemColor((byte)TEXT_INACTIVE_TEXT); /** * The color rendered for the background of control panels and control objects, * such as pushbuttons. */ - public final static SystemColor control = new SystemColor((byte)CONTROL); + public static final SystemColor control = new SystemColor((byte)CONTROL); /** * The color rendered for the text of control panels and control objects, * such as pushbuttons. */ - public final static SystemColor controlText = new SystemColor((byte)CONTROL_TEXT); + public static final SystemColor controlText = new SystemColor((byte)CONTROL_TEXT); /** * The color rendered for light areas of 3D control objects, such as pushbuttons. * This color is typically derived from the control background color * to provide a 3D effect. */ - public final static SystemColor controlHighlight = new SystemColor((byte)CONTROL_HIGHLIGHT); + public static final SystemColor controlHighlight = new SystemColor((byte)CONTROL_HIGHLIGHT); /** * The color rendered for highlight areas of 3D control objects, such as pushbuttons. * This color is typically derived from the control background color * to provide a 3D effect. */ - public final static SystemColor controlLtHighlight = new SystemColor((byte)CONTROL_LT_HIGHLIGHT); + public static final SystemColor controlLtHighlight = new SystemColor((byte)CONTROL_LT_HIGHLIGHT); /** * The color rendered for shadow areas of 3D control objects, such as pushbuttons. * This color is typically derived from the control background color * to provide a 3D effect. */ - public final static SystemColor controlShadow = new SystemColor((byte)CONTROL_SHADOW); + public static final SystemColor controlShadow = new SystemColor((byte)CONTROL_SHADOW); /** * The color rendered for dark shadow areas on 3D control objects, such as pushbuttons. * This color is typically derived from the control background color * to provide a 3D effect. */ - public final static SystemColor controlDkShadow = new SystemColor((byte)CONTROL_DK_SHADOW); + public static final SystemColor controlDkShadow = new SystemColor((byte)CONTROL_DK_SHADOW); /** * The color rendered for the background of scrollbars. */ - public final static SystemColor scrollbar = new SystemColor((byte)SCROLLBAR); + public static final SystemColor scrollbar = new SystemColor((byte)SCROLLBAR); /** * The color rendered for the background of tooltips or spot help. */ - public final static SystemColor info = new SystemColor((byte)INFO); + public static final SystemColor info = new SystemColor((byte)INFO); /** * The color rendered for the text of tooltips or spot help. */ - public final static SystemColor infoText = new SystemColor((byte)INFO_TEXT); + public static final SystemColor infoText = new SystemColor((byte)INFO_TEXT); /* * JDK 1.1 serialVersionUID. diff --git a/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java b/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java index e542dfc1712..e61716ee537 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java +++ b/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java @@ -124,7 +124,7 @@ public class SystemTray { private static SystemTray systemTray; private int currentIconID = 0; // each TrayIcon added gets a unique ID - transient private SystemTrayPeer peer; + private transient SystemTrayPeer peer; private static final TrayIcon[] EMPTY_TRAY_ARRAY = new TrayIcon[0]; diff --git a/jdk/src/java.desktop/share/classes/java/awt/TextComponent.java b/jdk/src/java.desktop/share/classes/java/awt/TextComponent.java index ed28e1b0470..9e7c22a49bb 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/TextComponent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/TextComponent.java @@ -110,7 +110,7 @@ public class TextComponent extends Component implements Accessible { /** * A list of listeners that will receive events from this object. */ - transient protected TextListener textListener; + protected transient TextListener textListener; /* * JDK 1.1 serialVersionUID diff --git a/jdk/src/java.desktop/share/classes/java/awt/TexturePaintContext.java b/jdk/src/java.desktop/share/classes/java/awt/TexturePaintContext.java index 12111967c0b..3b96d069408 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/TexturePaintContext.java +++ b/jdk/src/java.desktop/share/classes/java/awt/TexturePaintContext.java @@ -237,7 +237,7 @@ abstract class TexturePaintContext implements PaintContext { private static WeakReference xrgbRasRef; private static WeakReference argbRasRef; - synchronized static WritableRaster makeRaster(ColorModel cm, + static synchronized WritableRaster makeRaster(ColorModel cm, Raster srcRas, int w, int h) { @@ -273,7 +273,7 @@ abstract class TexturePaintContext implements PaintContext { } } - synchronized static void dropRaster(ColorModel cm, Raster outRas) { + static synchronized void dropRaster(ColorModel cm, Raster outRas) { if (outRas == null) { return; } @@ -286,7 +286,7 @@ abstract class TexturePaintContext implements PaintContext { private static WeakReference byteRasRef; - synchronized static WritableRaster makeByteRaster(Raster srcRas, + static synchronized WritableRaster makeByteRaster(Raster srcRas, int w, int h) { if (byteRasRef != null) { @@ -303,7 +303,7 @@ abstract class TexturePaintContext implements PaintContext { return srcRas.createCompatibleWritableRaster(w, h); } - synchronized static void dropByteRaster(Raster outRas) { + static synchronized void dropByteRaster(Raster outRas) { if (outRas == null) { return; } diff --git a/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java b/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java index a51b36c855d..ee020270f19 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java @@ -1722,7 +1722,7 @@ public abstract class Toolkit { * Extracts a "pure" AWTEventListener from a AWTEventListenerProxy, * if the listener is proxied. */ - static private AWTEventListener deProxyAWTEventListener(AWTEventListener l) + private static AWTEventListener deProxyAWTEventListener(AWTEventListener l) { AWTEventListener localL = l; @@ -2007,7 +2007,7 @@ public abstract class Toolkit { } } - static private class ToolkitEventMulticaster extends AWTEventMulticaster + private static class ToolkitEventMulticaster extends AWTEventMulticaster implements AWTEventListener { // Implementation cloned from AWTEventMulticaster. diff --git a/jdk/src/java.desktop/share/classes/java/awt/Transparency.java b/jdk/src/java.desktop/share/classes/java/awt/Transparency.java index 2c8f845a473..42b87caa4c5 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Transparency.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Transparency.java @@ -37,20 +37,20 @@ public interface Transparency { * Represents image data that is guaranteed to be completely opaque, * meaning that all pixels have an alpha value of 1.0. */ - @Native public final static int OPAQUE = 1; + @Native public static final int OPAQUE = 1; /** * Represents image data that is guaranteed to be either completely * opaque, with an alpha value of 1.0, or completely transparent, * with an alpha value of 0.0. */ - @Native public final static int BITMASK = 2; + @Native public static final int BITMASK = 2; /** * Represents image data that contains or might contain arbitrary * alpha values between and including 0.0 and 1.0. */ - @Native public final static int TRANSLUCENT = 3; + @Native public static final int TRANSLUCENT = 3; /** * Returns the type of this Transparency. diff --git a/jdk/src/java.desktop/share/classes/java/awt/TrayIcon.java b/jdk/src/java.desktop/share/classes/java/awt/TrayIcon.java index 5199b0cc064..3c7182afcfa 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/TrayIcon.java +++ b/jdk/src/java.desktop/share/classes/java/awt/TrayIcon.java @@ -92,7 +92,7 @@ public class TrayIcon { private int id; private String actionCommand; - transient private TrayIconPeer peer; + private transient TrayIconPeer peer; transient MouseListener mouseListener; transient MouseMotionListener mouseMotionListener; diff --git a/jdk/src/java.desktop/share/classes/java/awt/WaitDispatchSupport.java b/jdk/src/java.desktop/share/classes/java/awt/WaitDispatchSupport.java index d3a692ab5a8..5ca267f98a9 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/WaitDispatchSupport.java +++ b/jdk/src/java.desktop/share/classes/java/awt/WaitDispatchSupport.java @@ -47,7 +47,7 @@ import sun.util.logging.PlatformLogger; */ class WaitDispatchSupport implements SecondaryLoop { - private final static PlatformLogger log = + private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.event.WaitDispatchSupport"); private EventDispatchThread dispatchThread; @@ -303,7 +303,7 @@ class WaitDispatchSupport implements SecondaryLoop { return false; } - private final static Object getTreeLock() { + private static final Object getTreeLock() { return Component.LOCK; } diff --git a/jdk/src/java.desktop/share/classes/java/awt/Window.java b/jdk/src/java.desktop/share/classes/java/awt/Window.java index 0a03eeddee2..6f834a3f152 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Window.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Window.java @@ -959,7 +959,7 @@ public class Window extends Container implements Accessible { } } - static private final AtomicBoolean + private static final AtomicBoolean beforeFirstWindowShown = new AtomicBoolean(true); final void closeSplashScreen() { diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDropEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDropEvent.java index 32b16e16169..6b197ae6b1f 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDropEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDropEvent.java @@ -267,7 +267,7 @@ public class DropTargetDropEvent extends DropTargetEvent { * fields */ - static final private Point zero = new Point(0,0); + private static final Point zero = new Point(0,0); /** * The location of the drag cursor's hotspot in Component coordinates. diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/InvalidDnDOperationException.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/InvalidDnDOperationException.java index e0727aba3b5..c57573797e0 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/InvalidDnDOperationException.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/InvalidDnDOperationException.java @@ -38,7 +38,7 @@ public class InvalidDnDOperationException extends IllegalStateException { private static final long serialVersionUID = -6062568741193956678L; - static private String dft_msg = "The operation requested cannot be performed by the DnD system since it is not in the appropriate state"; + private static String dft_msg = "The operation requested cannot be performed by the DnD system since it is not in the appropriate state"; /** * Create a default Exception diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java index 2804f2b57ac..de522828a4d 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java @@ -623,7 +623,7 @@ public class MouseEvent extends InputEvent { /* if the button is an extra button and it is released or clicked then in Xsystem its state is not modified. Exclude this button number from ExtModifiers mask.*/ - transient private boolean shouldExcludeButtonFromExtModifiers = false; + private transient boolean shouldExcludeButtonFromExtModifiers = false; /** * {@inheritDoc} diff --git a/jdk/src/java.desktop/share/classes/java/awt/font/OpenType.java b/jdk/src/java.desktop/share/classes/java/awt/font/OpenType.java index ebe6cb39adf..ee0acf6ab4d 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/font/OpenType.java +++ b/jdk/src/java.desktop/share/classes/java/awt/font/OpenType.java @@ -43,307 +43,307 @@ public interface OpenType { * Character to glyph mapping. Table tag "cmap" in the Open * Type Specification. */ - public final static int TAG_CMAP = 0x636d6170; + public static final int TAG_CMAP = 0x636d6170; /** * Font header. Table tag "head" in the Open * Type Specification. */ - public final static int TAG_HEAD = 0x68656164; + public static final int TAG_HEAD = 0x68656164; /** * Naming table. Table tag "name" in the Open * Type Specification. */ - public final static int TAG_NAME = 0x6e616d65; + public static final int TAG_NAME = 0x6e616d65; /** * Glyph data. Table tag "glyf" in the Open * Type Specification. */ - public final static int TAG_GLYF = 0x676c7966; + public static final int TAG_GLYF = 0x676c7966; /** * Maximum profile. Table tag "maxp" in the Open * Type Specification. */ - public final static int TAG_MAXP = 0x6d617870; + public static final int TAG_MAXP = 0x6d617870; /** * CVT preprogram. Table tag "prep" in the Open * Type Specification. */ - public final static int TAG_PREP = 0x70726570; + public static final int TAG_PREP = 0x70726570; /** * Horizontal metrics. Table tag "hmtx" in the Open * Type Specification. */ - public final static int TAG_HMTX = 0x686d7478; + public static final int TAG_HMTX = 0x686d7478; /** * Kerning. Table tag "kern" in the Open * Type Specification. */ - public final static int TAG_KERN = 0x6b65726e; + public static final int TAG_KERN = 0x6b65726e; /** * Horizontal device metrics. Table tag "hdmx" in the Open * Type Specification. */ - public final static int TAG_HDMX = 0x68646d78; + public static final int TAG_HDMX = 0x68646d78; /** * Index to location. Table tag "loca" in the Open * Type Specification. */ - public final static int TAG_LOCA = 0x6c6f6361; + public static final int TAG_LOCA = 0x6c6f6361; /** * PostScript Information. Table tag "post" in the Open * Type Specification. */ - public final static int TAG_POST = 0x706f7374; + public static final int TAG_POST = 0x706f7374; /** * OS/2 and Windows specific metrics. Table tag "OS/2" * in the Open Type Specification. */ - public final static int TAG_OS2 = 0x4f532f32; + public static final int TAG_OS2 = 0x4f532f32; /** * Control value table. Table tag "cvt " * in the Open Type Specification. */ - public final static int TAG_CVT = 0x63767420; + public static final int TAG_CVT = 0x63767420; /** * Grid-fitting and scan conversion procedure. Table tag * "gasp" in the Open Type Specification. */ - public final static int TAG_GASP = 0x67617370; + public static final int TAG_GASP = 0x67617370; /** * Vertical device metrics. Table tag "VDMX" in the Open * Type Specification. */ - public final static int TAG_VDMX = 0x56444d58; + public static final int TAG_VDMX = 0x56444d58; /** * Vertical metrics. Table tag "vmtx" in the Open * Type Specification. */ - public final static int TAG_VMTX = 0x766d7478; + public static final int TAG_VMTX = 0x766d7478; /** * Vertical metrics header. Table tag "vhea" in the Open * Type Specification. */ - public final static int TAG_VHEA = 0x76686561; + public static final int TAG_VHEA = 0x76686561; /** * Horizontal metrics header. Table tag "hhea" in the Open * Type Specification. */ - public final static int TAG_HHEA = 0x68686561; + public static final int TAG_HHEA = 0x68686561; /** * Adobe Type 1 font data. Table tag "typ1" in the Open * Type Specification. */ - public final static int TAG_TYP1 = 0x74797031; + public static final int TAG_TYP1 = 0x74797031; /** * Baseline table. Table tag "bsln" in the Open * Type Specification. */ - public final static int TAG_BSLN = 0x62736c6e; + public static final int TAG_BSLN = 0x62736c6e; /** * Glyph substitution. Table tag "GSUB" in the Open * Type Specification. */ - public final static int TAG_GSUB = 0x47535542; + public static final int TAG_GSUB = 0x47535542; /** * Digital signature. Table tag "DSIG" in the Open * Type Specification. */ - public final static int TAG_DSIG = 0x44534947; + public static final int TAG_DSIG = 0x44534947; /** * Font program. Table tag "fpgm" in the Open * Type Specification. */ - public final static int TAG_FPGM = 0x6670676d; + public static final int TAG_FPGM = 0x6670676d; /** * Font variation. Table tag "fvar" in the Open * Type Specification. */ - public final static int TAG_FVAR = 0x66766172; + public static final int TAG_FVAR = 0x66766172; /** * Glyph variation. Table tag "gvar" in the Open * Type Specification. */ - public final static int TAG_GVAR = 0x67766172; + public static final int TAG_GVAR = 0x67766172; /** * Compact font format (Type1 font). Table tag * "CFF " in the Open Type Specification. */ - public final static int TAG_CFF = 0x43464620; + public static final int TAG_CFF = 0x43464620; /** * Multiple master supplementary data. Table tag * "MMSD" in the Open Type Specification. */ - public final static int TAG_MMSD = 0x4d4d5344; + public static final int TAG_MMSD = 0x4d4d5344; /** * Multiple master font metrics. Table tag * "MMFX" in the Open Type Specification. */ - public final static int TAG_MMFX = 0x4d4d4658; + public static final int TAG_MMFX = 0x4d4d4658; /** * Baseline data. Table tag "BASE" in the Open * Type Specification. */ - public final static int TAG_BASE = 0x42415345; + public static final int TAG_BASE = 0x42415345; /** * Glyph definition. Table tag "GDEF" in the Open * Type Specification. */ - public final static int TAG_GDEF = 0x47444546; + public static final int TAG_GDEF = 0x47444546; /** * Glyph positioning. Table tag "GPOS" in the Open * Type Specification. */ - public final static int TAG_GPOS = 0x47504f53; + public static final int TAG_GPOS = 0x47504f53; /** * Justification. Table tag "JSTF" in the Open * Type Specification. */ - public final static int TAG_JSTF = 0x4a535446; + public static final int TAG_JSTF = 0x4a535446; /** * Embedded bitmap data. Table tag "EBDT" in the Open * Type Specification. */ - public final static int TAG_EBDT = 0x45424454; + public static final int TAG_EBDT = 0x45424454; /** * Embedded bitmap location. Table tag "EBLC" in the Open * Type Specification. */ - public final static int TAG_EBLC = 0x45424c43; + public static final int TAG_EBLC = 0x45424c43; /** * Embedded bitmap scaling. Table tag "EBSC" in the Open * Type Specification. */ - public final static int TAG_EBSC = 0x45425343; + public static final int TAG_EBSC = 0x45425343; /** * Linear threshold. Table tag "LTSH" in the Open * Type Specification. */ - public final static int TAG_LTSH = 0x4c545348; + public static final int TAG_LTSH = 0x4c545348; /** * PCL 5 data. Table tag "PCLT" in the Open * Type Specification. */ - public final static int TAG_PCLT = 0x50434c54; + public static final int TAG_PCLT = 0x50434c54; /** * Accent attachment. Table tag "acnt" in the Open * Type Specification. */ - public final static int TAG_ACNT = 0x61636e74; + public static final int TAG_ACNT = 0x61636e74; /** * Axis variation. Table tag "avar" in the Open * Type Specification. */ - public final static int TAG_AVAR = 0x61766172; + public static final int TAG_AVAR = 0x61766172; /** * Bitmap data. Table tag "bdat" in the Open * Type Specification. */ - public final static int TAG_BDAT = 0x62646174; + public static final int TAG_BDAT = 0x62646174; /** * Bitmap location. Table tag "bloc" in the Open * Type Specification. */ - public final static int TAG_BLOC = 0x626c6f63; + public static final int TAG_BLOC = 0x626c6f63; /** * CVT variation. Table tag "cvar" in the Open * Type Specification. */ - public final static int TAG_CVAR = 0x63766172; + public static final int TAG_CVAR = 0x63766172; /** * Feature name. Table tag "feat" in the Open * Type Specification. */ - public final static int TAG_FEAT = 0x66656174; + public static final int TAG_FEAT = 0x66656174; /** * Font descriptors. Table tag "fdsc" in the Open * Type Specification. */ - public final static int TAG_FDSC = 0x66647363; + public static final int TAG_FDSC = 0x66647363; /** * Font metrics. Table tag "fmtx" in the Open * Type Specification. */ - public final static int TAG_FMTX = 0x666d7478; + public static final int TAG_FMTX = 0x666d7478; /** * Justification. Table tag "just" in the Open * Type Specification. */ - public final static int TAG_JUST = 0x6a757374; + public static final int TAG_JUST = 0x6a757374; /** * Ligature caret. Table tag "lcar" in the Open * Type Specification. */ - public final static int TAG_LCAR = 0x6c636172; + public static final int TAG_LCAR = 0x6c636172; /** * Glyph metamorphosis. Table tag "mort" in the Open * Type Specification. */ - public final static int TAG_MORT = 0x6d6f7274; + public static final int TAG_MORT = 0x6d6f7274; /** * Optical bounds. Table tag "opbd" in the Open * Type Specification. */ - public final static int TAG_OPBD = 0x6F706264; + public static final int TAG_OPBD = 0x6F706264; /** * Glyph properties. Table tag "prop" in the Open * Type Specification. */ - public final static int TAG_PROP = 0x70726f70; + public static final int TAG_PROP = 0x70726f70; /** * Tracking. Table tag "trak" in the Open * Type Specification. */ - public final static int TAG_TRAK = 0x7472616b; + public static final int TAG_TRAK = 0x7472616b; /** * Returns the version of the OpenType font. diff --git a/jdk/src/java.desktop/share/classes/java/awt/geom/Arc2D.java b/jdk/src/java.desktop/share/classes/java/awt/geom/Arc2D.java index be51e8a4bc3..74cad6ef4a5 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/geom/Arc2D.java +++ b/jdk/src/java.desktop/share/classes/java/awt/geom/Arc2D.java @@ -60,7 +60,7 @@ public abstract class Arc2D extends RectangularShape { * connecting the two ends of the arc segment. * @since 1.2 */ - public final static int OPEN = 0; + public static final int OPEN = 0; /** * The closure type for an arc closed by drawing a straight @@ -68,7 +68,7 @@ public abstract class Arc2D extends RectangularShape { * arc segment. * @since 1.2 */ - public final static int CHORD = 1; + public static final int CHORD = 1; /** * The closure type for an arc closed by drawing straight line @@ -76,7 +76,7 @@ public abstract class Arc2D extends RectangularShape { * of the full ellipse and from that point to the end of the arc segment. * @since 1.2 */ - public final static int PIE = 2; + public static final int PIE = 2; /** * This class defines an arc specified in {@code float} precision. diff --git a/jdk/src/java.desktop/share/classes/java/awt/geom/Path2D.java b/jdk/src/java.desktop/share/classes/java/awt/geom/Path2D.java index e05d3579fc1..9ef2bb1bfd8 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/geom/Path2D.java +++ b/jdk/src/java.desktop/share/classes/java/awt/geom/Path2D.java @@ -2675,7 +2675,7 @@ public abstract class Path2D implements Shape, Cloneable { } } - static abstract class Iterator implements PathIterator { + abstract static class Iterator implements PathIterator { int typeIdx; int pointIdx; Path2D path; diff --git a/jdk/src/java.desktop/share/classes/java/awt/im/InputMethodHighlight.java b/jdk/src/java.desktop/share/classes/java/awt/im/InputMethodHighlight.java index df09076410d..fc7b61c4b7b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/im/InputMethodHighlight.java +++ b/jdk/src/java.desktop/share/classes/java/awt/im/InputMethodHighlight.java @@ -71,36 +71,36 @@ public class InputMethodHighlight { /** * Constant for the raw text state. */ - public final static int RAW_TEXT = 0; + public static final int RAW_TEXT = 0; /** * Constant for the converted text state. */ - public final static int CONVERTED_TEXT = 1; + public static final int CONVERTED_TEXT = 1; /** * Constant for the default highlight for unselected raw text. */ - public final static InputMethodHighlight UNSELECTED_RAW_TEXT_HIGHLIGHT = + public static final InputMethodHighlight UNSELECTED_RAW_TEXT_HIGHLIGHT = new InputMethodHighlight(false, RAW_TEXT); /** * Constant for the default highlight for selected raw text. */ - public final static InputMethodHighlight SELECTED_RAW_TEXT_HIGHLIGHT = + public static final InputMethodHighlight SELECTED_RAW_TEXT_HIGHLIGHT = new InputMethodHighlight(true, RAW_TEXT); /** * Constant for the default highlight for unselected converted text. */ - public final static InputMethodHighlight UNSELECTED_CONVERTED_TEXT_HIGHLIGHT = + public static final InputMethodHighlight UNSELECTED_CONVERTED_TEXT_HIGHLIGHT = new InputMethodHighlight(false, CONVERTED_TEXT); /** * Constant for the default highlight for selected converted text. */ - public final static InputMethodHighlight SELECTED_CONVERTED_TEXT_HIGHLIGHT = + public static final InputMethodHighlight SELECTED_CONVERTED_TEXT_HIGHLIGHT = new InputMethodHighlight(true, CONVERTED_TEXT); diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/BufferedImage.java b/jdk/src/java.desktop/share/classes/java/awt/image/BufferedImage.java index 5aeef7c009b..888490d5332 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/image/BufferedImage.java +++ b/jdk/src/java.desktop/share/classes/java/awt/image/BufferedImage.java @@ -281,7 +281,7 @@ public class BufferedImage extends java.awt.Image private static final int DCM_BGR_BLU_MASK = 0xff0000; - static private native void initIDs(); + private static native void initIDs(); static { ColorModel.loadLibraries(); initIDs(); diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/ColorModel.java b/jdk/src/java.desktop/share/classes/java/awt/image/ColorModel.java index 10439c7f835..7440de35e7f 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/image/ColorModel.java +++ b/jdk/src/java.desktop/share/classes/java/awt/image/ColorModel.java @@ -403,7 +403,7 @@ public abstract class ColorModel implements Transparency{ * @return true if alpha is supported in this * ColorModel; false otherwise. */ - final public boolean hasAlpha() { + public final boolean hasAlpha() { return supportsAlpha; } @@ -419,7 +419,7 @@ public abstract class ColorModel implements Transparency{ * in the pixel values to be translated by this * ColorModel; false otherwise. */ - final public boolean isAlphaPremultiplied() { + public final boolean isAlphaPremultiplied() { return isAlphaPremultiplied; } @@ -430,7 +430,7 @@ public abstract class ColorModel implements Transparency{ * @return the transfer type. * @since 1.3 */ - final public int getTransferType() { + public final int getTransferType() { return transferType; } @@ -1512,7 +1512,7 @@ public abstract class ColorModel implements Transparency{ * @return the ColorSpace of this * ColorModel. */ - final public ColorSpace getColorSpace() { + public final ColorSpace getColorSpace() { return colorSpace; } diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/DirectColorModel.java b/jdk/src/java.desktop/share/classes/java/awt/image/DirectColorModel.java index d53f7197487..8588ef7fc71 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/image/DirectColorModel.java +++ b/jdk/src/java.desktop/share/classes/java/awt/image/DirectColorModel.java @@ -266,7 +266,7 @@ public class DirectColorModel extends PackedColorModel { * @return the mask, which indicates which bits of the int * pixel representation contain the red color sample. */ - final public int getRedMask() { + public final int getRedMask() { return maskArray[0]; } @@ -276,7 +276,7 @@ public class DirectColorModel extends PackedColorModel { * @return the mask, which indicates which bits of the int * pixel representation contain the green color sample. */ - final public int getGreenMask() { + public final int getGreenMask() { return maskArray[1]; } @@ -286,7 +286,7 @@ public class DirectColorModel extends PackedColorModel { * @return the mask, which indicates which bits of the int * pixel representation contain the blue color sample. */ - final public int getBlueMask() { + public final int getBlueMask() { return maskArray[2]; } @@ -296,7 +296,7 @@ public class DirectColorModel extends PackedColorModel { * @return the mask, which indicates which bits of the int * pixel representation contain the alpha sample. */ - final public int getAlphaMask() { + public final int getAlphaMask() { if (supportsAlpha) { return maskArray[3]; } else { @@ -365,7 +365,7 @@ public class DirectColorModel extends PackedColorModel { * @return the red color component for the specified pixel, from * 0 to 255 in the sRGB ColorSpace. */ - final public int getRed(int pixel) { + public final int getRed(int pixel) { if (is_sRGB) { return getsRGBComponentFromsRGB(pixel, 0); } else if (is_LinearRGB) { @@ -388,7 +388,7 @@ public class DirectColorModel extends PackedColorModel { * @return the green color component for the specified pixel, from * 0 to 255 in the sRGB ColorSpace. */ - final public int getGreen(int pixel) { + public final int getGreen(int pixel) { if (is_sRGB) { return getsRGBComponentFromsRGB(pixel, 1); } else if (is_LinearRGB) { @@ -411,7 +411,7 @@ public class DirectColorModel extends PackedColorModel { * @return the blue color component for the specified pixel, from * 0 to 255 in the sRGB ColorSpace. */ - final public int getBlue(int pixel) { + public final int getBlue(int pixel) { if (is_sRGB) { return getsRGBComponentFromsRGB(pixel, 2); } else if (is_LinearRGB) { @@ -428,7 +428,7 @@ public class DirectColorModel extends PackedColorModel { * @return the value of the alpha component of pixel * from 0 to 255. */ - final public int getAlpha(int pixel) { + public final int getAlpha(int pixel) { if (!supportsAlpha) return 255; int a = ((pixel & maskArray[3]) >>> maskOffsets[3]); if (scaleFactors[3] != 1.0f) { @@ -450,7 +450,7 @@ public class DirectColorModel extends PackedColorModel { * pixel. * @see ColorModel#getRGBdefault */ - final public int getRGB(int pixel) { + public final int getRGB(int pixel) { if (is_sRGB || is_LinearRGB) { return (getAlpha(pixel) << 24) | (getRed(pixel) << 16) @@ -923,7 +923,7 @@ public class DirectColorModel extends PackedColorModel { * @return an array containing the color and alpha components of the * specified pixel starting at the specified offset. */ - final public int[] getComponents(int pixel, int[] components, int offset) { + public final int[] getComponents(int pixel, int[] components, int offset) { if (components == null) { components = new int[offset+numComponents]; } @@ -974,7 +974,7 @@ public class DirectColorModel extends PackedColorModel { * transferType is not supported by this * color model */ - final public int[] getComponents(Object pixel, int[] components, + public final int[] getComponents(Object pixel, int[] components, int offset) { int intpixel=0; switch (transferType) { @@ -1010,7 +1010,7 @@ public class DirectColorModel extends PackedColorModel { * @see WritableRaster * @see SampleModel */ - final public WritableRaster createCompatibleWritableRaster (int w, + public final WritableRaster createCompatibleWritableRaster (int w, int h) { if ((w <= 0) || (h <= 0)) { throw new IllegalArgumentException("Width (" + w + ") and height (" + h + @@ -1173,7 +1173,7 @@ public class DirectColorModel extends PackedColorModel { * transferType is not supported by this * color model */ - final public ColorModel coerceData (WritableRaster raster, + public final ColorModel coerceData (WritableRaster raster, boolean isAlphaPremultiplied) { if (!supportsAlpha || diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/IndexColorModel.java b/jdk/src/java.desktop/share/classes/java/awt/image/IndexColorModel.java index 16431ebc8af..ae1b85c1453 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/image/IndexColorModel.java +++ b/jdk/src/java.desktop/share/classes/java/awt/image/IndexColorModel.java @@ -135,7 +135,7 @@ public class IndexColorModel extends ColorModel { private static int[] opaqueBits = {8, 8, 8}; private static int[] alphaBits = {8, 8, 8, 8}; - static private native void initIDs(); + private static native void initIDs(); static { ColorModel.loadLibraries(); initIDs(); @@ -634,7 +634,7 @@ public class IndexColorModel extends ColorModel { * IndexColorModel. * @return the size of the color and alpha component arrays. */ - final public int getMapSize() { + public final int getMapSize() { return map_size; } @@ -650,7 +650,7 @@ public class IndexColorModel extends ColorModel { * IndexColorModel object, or -1 if there * is no such pixel */ - final public int getTransparentPixel() { + public final int getTransparentPixel() { return transparent_index; } @@ -661,7 +661,7 @@ public class IndexColorModel extends ColorModel { * @param r the specified array into which the elements of the * array of red color components are copied */ - final public void getReds(byte r[]) { + public final void getReds(byte r[]) { for (int i = 0; i < map_size; i++) { r[i] = (byte) (rgb[i] >> 16); } @@ -674,7 +674,7 @@ public class IndexColorModel extends ColorModel { * @param g the specified array into which the elements of the * array of green color components are copied */ - final public void getGreens(byte g[]) { + public final void getGreens(byte g[]) { for (int i = 0; i < map_size; i++) { g[i] = (byte) (rgb[i] >> 8); } @@ -687,7 +687,7 @@ public class IndexColorModel extends ColorModel { * @param b the specified array into which the elements of the * array of blue color components are copied */ - final public void getBlues(byte b[]) { + public final void getBlues(byte b[]) { for (int i = 0; i < map_size; i++) { b[i] = (byte) rgb[i]; } @@ -700,7 +700,7 @@ public class IndexColorModel extends ColorModel { * @param a the specified array into which the elements of the * array of alpha components are copied */ - final public void getAlphas(byte a[]) { + public final void getAlphas(byte a[]) { for (int i = 0; i < map_size; i++) { a[i] = (byte) (rgb[i] >> 24); } @@ -717,7 +717,7 @@ public class IndexColorModel extends ColorModel { * values from this array of color and alpha components * are copied. */ - final public void getRGBs(int rgb[]) { + public final void getRGBs(int rgb[]) { System.arraycopy(this.rgb, 0, rgb, 0, map_size); } @@ -776,7 +776,7 @@ public class IndexColorModel extends ColorModel { * @param pixel the specified pixel * @return the value of the red color component for the specified pixel */ - final public int getRed(int pixel) { + public final int getRed(int pixel) { return (rgb[pixel & pixel_mask] >> 16) & 0xff; } @@ -791,7 +791,7 @@ public class IndexColorModel extends ColorModel { * @param pixel the specified pixel * @return the value of the green color component for the specified pixel */ - final public int getGreen(int pixel) { + public final int getGreen(int pixel) { return (rgb[pixel & pixel_mask] >> 8) & 0xff; } @@ -806,7 +806,7 @@ public class IndexColorModel extends ColorModel { * @param pixel the specified pixel * @return the value of the blue color component for the specified pixel */ - final public int getBlue(int pixel) { + public final int getBlue(int pixel) { return rgb[pixel & pixel_mask] & 0xff; } @@ -819,7 +819,7 @@ public class IndexColorModel extends ColorModel { * @param pixel the specified pixel * @return the value of the alpha component for the specified pixel */ - final public int getAlpha(int pixel) { + public final int getAlpha(int pixel) { return (rgb[pixel & pixel_mask] >> 24) & 0xff; } @@ -834,7 +834,7 @@ public class IndexColorModel extends ColorModel { * @return the color and alpha components of the specified pixel * @see ColorModel#getRGBdefault */ - final public int getRGB(int pixel) { + public final int getRGB(int pixel) { return rgb[pixel & pixel_mask]; } diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/Kernel.java b/jdk/src/java.desktop/share/classes/java/awt/image/Kernel.java index 71b58094cc0..ef5b547f6a0 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/image/Kernel.java +++ b/jdk/src/java.desktop/share/classes/java/awt/image/Kernel.java @@ -83,7 +83,7 @@ public class Kernel implements Cloneable { * Returns the X origin of this Kernel. * @return the X origin. */ - final public int getXOrigin(){ + public final int getXOrigin(){ return xOrigin; } @@ -91,7 +91,7 @@ public class Kernel implements Cloneable { * Returns the Y origin of this Kernel. * @return the Y origin. */ - final public int getYOrigin() { + public final int getYOrigin() { return yOrigin; } @@ -99,7 +99,7 @@ public class Kernel implements Cloneable { * Returns the width of this Kernel. * @return the width of this Kernel. */ - final public int getWidth() { + public final int getWidth() { return width; } @@ -107,7 +107,7 @@ public class Kernel implements Cloneable { * Returns the height of this Kernel. * @return the height of this Kernel. */ - final public int getHeight() { + public final int getHeight() { return height; } @@ -123,7 +123,7 @@ public class Kernel implements Cloneable { * @throws IllegalArgumentException if data is less * than the size of this Kernel */ - final public float[] getKernelData(float[] data) { + public final float[] getKernelData(float[] data) { if (data == null) { data = new float[this.data.length]; } diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/PackedColorModel.java b/jdk/src/java.desktop/share/classes/java/awt/image/PackedColorModel.java index 1ff6ecd0b10..f084fdda04e 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/image/PackedColorModel.java +++ b/jdk/src/java.desktop/share/classes/java/awt/image/PackedColorModel.java @@ -240,7 +240,7 @@ public abstract class PackedColorModel extends ColorModel { * PackedColorModel or if index is * less than zero */ - final public int getMask(int index) { + public final int getMask(int index) { return maskArray[index]; } @@ -251,7 +251,7 @@ public abstract class PackedColorModel extends ColorModel { * int pixel * representation contain the color or alpha samples. */ - final public int[] getMasks() { + public final int[] getMasks() { return maskArray.clone(); } @@ -415,7 +415,7 @@ public abstract class PackedColorModel extends ColorModel { return true; } - private final static int[] createBitsArray(int[]colorMaskArray, + private static final int[] createBitsArray(int[]colorMaskArray, int alphaMask) { int numColors = colorMaskArray.length; int numAlpha = (alphaMask == 0 ? 0 : 1); @@ -438,7 +438,7 @@ public abstract class PackedColorModel extends ColorModel { return arr; } - private final static int[] createBitsArray(int rmask, int gmask, int bmask, + private static final int[] createBitsArray(int rmask, int gmask, int bmask, int amask) { int[] arr = new int[3 + (amask == 0 ? 0 : 1)]; arr[0] = countBits(rmask); @@ -466,7 +466,7 @@ public abstract class PackedColorModel extends ColorModel { return arr; } - private final static int countBits(int mask) { + private static final int countBits(int mask) { int count = 0; if (mask != 0) { while ((mask & 1) == 0) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/Raster.java b/jdk/src/java.desktop/share/classes/java/awt/image/Raster.java index 2b0592168fa..db350da62ce 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/image/Raster.java +++ b/jdk/src/java.desktop/share/classes/java/awt/image/Raster.java @@ -167,7 +167,7 @@ public class Raster { /** The parent of this Raster, or null. */ protected Raster parent; - static private native void initIDs(); + private static native void initIDs(); static { ColorModel.loadLibraries(); initIDs(); @@ -1139,7 +1139,7 @@ public class Raster { * @return the X translation from the coordinate space of the * Raster's SampleModel to that of the Raster. */ - final public int getSampleModelTranslateX() { + public final int getSampleModelTranslateX() { return sampleModelTranslateX; } @@ -1151,7 +1151,7 @@ public class Raster { * @return the Y translation from the coordinate space of the * Raster's SampleModel to that of the Raster. */ - final public int getSampleModelTranslateY() { + public final int getSampleModelTranslateY() { return sampleModelTranslateY; } @@ -1360,35 +1360,35 @@ public class Raster { /** Returns the minimum valid X coordinate of the Raster. * @return the minimum x coordinate of this Raster. */ - final public int getMinX() { + public final int getMinX() { return minX; } /** Returns the minimum valid Y coordinate of the Raster. * @return the minimum y coordinate of this Raster. */ - final public int getMinY() { + public final int getMinY() { return minY; } /** Returns the width in pixels of the Raster. * @return the width of this Raster. */ - final public int getWidth() { + public final int getWidth() { return width; } /** Returns the height in pixels of the Raster. * @return the height of this Raster. */ - final public int getHeight() { + public final int getHeight() { return height; } /** Returns the number of bands (samples per pixel) in this Raster. * @return the number of bands of this Raster. */ - final public int getNumBands() { + public final int getNumBands() { return numBands; } @@ -1403,7 +1403,7 @@ public class Raster { * as the storage data type of the DataBuffer. * @return the number of data elements. */ - final public int getNumDataElements() { + public final int getNumDataElements() { return sampleModel.getNumDataElements(); } @@ -1419,7 +1419,7 @@ public class Raster { * be one of the types defined in DataBuffer. * @return this transfer type. */ - final public int getTransferType() { + public final int getTransferType() { return sampleModel.getTransferType(); } diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/RescaleOp.java b/jdk/src/java.desktop/share/classes/java/awt/image/RescaleOp.java index 1bf21db2354..b2d09dbe67e 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/image/RescaleOp.java +++ b/jdk/src/java.desktop/share/classes/java/awt/image/RescaleOp.java @@ -142,7 +142,7 @@ public class RescaleOp implements BufferedImageOp, RasterOp { * this RescaleOp * @return the scale factors of this RescaleOp. */ - final public float[] getScaleFactors (float scaleFactors[]) { + public final float[] getScaleFactors (float scaleFactors[]) { if (scaleFactors == null) { return this.scaleFactors.clone(); } @@ -160,7 +160,7 @@ public class RescaleOp implements BufferedImageOp, RasterOp { * this RescaleOp * @return the offsets of this RescaleOp. */ - final public float[] getOffsets(float offsets[]) { + public final float[] getOffsets(float offsets[]) { if (offsets == null) { return this.offsets.clone(); } @@ -176,7 +176,7 @@ public class RescaleOp implements BufferedImageOp, RasterOp { * @return the number of scaling factors and offsets of this * RescaleOp. */ - final public int getNumFactors() { + public final int getNumFactors() { return length; } diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/SampleModel.java b/jdk/src/java.desktop/share/classes/java/awt/image/SampleModel.java index d21b45271b4..5356e70fa75 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/image/SampleModel.java +++ b/jdk/src/java.desktop/share/classes/java/awt/image/SampleModel.java @@ -99,7 +99,7 @@ public abstract class SampleModel */ protected int dataType; - static private native void initIDs(); + private static native void initIDs(); static { ColorModel.loadLibraries(); initIDs(); @@ -153,7 +153,7 @@ public abstract class SampleModel * @return the width in pixels of the region of image data * that this SampleModel describes. */ - final public int getWidth() { + public final int getWidth() { return width; } @@ -161,7 +161,7 @@ public abstract class SampleModel * @return the height in pixels of the region of image data * that this SampleModel describes. */ - final public int getHeight() { + public final int getHeight() { return height; } @@ -169,7 +169,7 @@ public abstract class SampleModel * @return the number of bands of image data that this * SampleModel describes. */ - final public int getNumBands() { + public final int getNumBands() { return numBands; } @@ -193,7 +193,7 @@ public abstract class SampleModel /** Returns the data type of the DataBuffer storing the pixel data. * @return the data type. */ - final public int getDataType() { + public final int getDataType() { return dataType; } diff --git a/jdk/src/java.desktop/share/classes/java/beans/BeanInfo.java b/jdk/src/java.desktop/share/classes/java/beans/BeanInfo.java index 92be1eb81a4..ed40e177c89 100644 --- a/jdk/src/java.desktop/share/classes/java/beans/BeanInfo.java +++ b/jdk/src/java.desktop/share/classes/java/beans/BeanInfo.java @@ -159,20 +159,20 @@ public interface BeanInfo { /** * Constant to indicate a 16 x 16 color icon. */ - final static int ICON_COLOR_16x16 = 1; + static final int ICON_COLOR_16x16 = 1; /** * Constant to indicate a 32 x 32 color icon. */ - final static int ICON_COLOR_32x32 = 2; + static final int ICON_COLOR_32x32 = 2; /** * Constant to indicate a 16 x 16 monochrome icon. */ - final static int ICON_MONO_16x16 = 3; + static final int ICON_MONO_16x16 = 3; /** * Constant to indicate a 32 x 32 monochrome icon. */ - final static int ICON_MONO_32x32 = 4; + static final int ICON_MONO_32x32 = 4; } diff --git a/jdk/src/java.desktop/share/classes/java/beans/Introspector.java b/jdk/src/java.desktop/share/classes/java/beans/Introspector.java index 6b88e9a87fb..12ef918d8c6 100644 --- a/jdk/src/java.desktop/share/classes/java/beans/Introspector.java +++ b/jdk/src/java.desktop/share/classes/java/beans/Introspector.java @@ -102,17 +102,17 @@ public class Introspector { * Flag to indicate to use of all beaninfo. * @since 1.2 */ - public final static int USE_ALL_BEANINFO = 1; + public static final int USE_ALL_BEANINFO = 1; /** * Flag to indicate to ignore immediate beaninfo. * @since 1.2 */ - public final static int IGNORE_IMMEDIATE_BEANINFO = 2; + public static final int IGNORE_IMMEDIATE_BEANINFO = 2; /** * Flag to indicate to ignore all beaninfo. * @since 1.2 */ - public final static int IGNORE_ALL_BEANINFO = 3; + public static final int IGNORE_ALL_BEANINFO = 3; // Static Caches to speed up introspection. private static final WeakCache, Method[]> declaredMethodCache = new WeakCache<>(); @@ -139,7 +139,7 @@ public class Introspector { // events maps from String names to EventSetDescriptors private Map events; - private final static EventSetDescriptor[] EMPTY_EVENTSETDESCRIPTORS = new EventSetDescriptor[0]; + private static final EventSetDescriptor[] EMPTY_EVENTSETDESCRIPTORS = new EventSetDescriptor[0]; static final String ADD_PREFIX = "add"; static final String REMOVE_PREFIX = "remove"; diff --git a/jdk/src/java.desktop/share/classes/java/beans/MetaData.java b/jdk/src/java.desktop/share/classes/java/beans/MetaData.java index ee64475b8c4..40662cf772a 100644 --- a/jdk/src/java.desktop/share/classes/java/beans/MetaData.java +++ b/jdk/src/java.desktop/share/classes/java/beans/MetaData.java @@ -356,7 +356,7 @@ delegates to be registered with concrete classes. * * @author Sergey A. Malenkov */ -private static abstract class java_util_Collections extends PersistenceDelegate { +private abstract static class java_util_Collections extends PersistenceDelegate { protected boolean mutatesTo(Object oldInstance, Object newInstance) { if (!super.mutatesTo(oldInstance, newInstance)) { return false; @@ -1319,7 +1319,7 @@ static final class sun_swing_PrintColorUIResource_PersistenceDelegate extends Pe } @SuppressWarnings("rawtypes") - public synchronized static PersistenceDelegate getPersistenceDelegate(Class type) { + public static synchronized PersistenceDelegate getPersistenceDelegate(Class type) { if (type == null) { return nullPersistenceDelegate; } diff --git a/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleRole.java b/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleRole.java index c7ed50f32d3..d154cf7e933 100644 --- a/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleRole.java +++ b/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleRole.java @@ -588,7 +588,7 @@ public class AccessibleRole extends AccessibleBundle { * * @since 1.5 */ - static public final AccessibleRole EDITBAR = + public static final AccessibleRole EDITBAR = new AccessibleRole("editbar"); /** @@ -597,7 +597,7 @@ public class AccessibleRole extends AccessibleBundle { * * @since 1.5 */ - static public final AccessibleRole PROGRESS_MONITOR = + public static final AccessibleRole PROGRESS_MONITOR = new AccessibleRole("progressMonitor"); diff --git a/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleState.java b/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleState.java index 746f1d97daa..3417d3ecdcf 100644 --- a/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleState.java +++ b/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleState.java @@ -353,7 +353,7 @@ public class AccessibleState extends AccessibleBundle { * * @since 1.5 */ - static public final AccessibleState TRUNCATED + public static final AccessibleState TRUNCATED = new AccessibleState("truncated"); /** diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java b/jdk/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java index 0402993cc5f..8bc873cfabc 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java +++ b/jdk/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java @@ -1252,7 +1252,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { // Standard format descriptor - private synchronized static void createStandardFormat() { + private static synchronized void createStandardFormat() { if (standardFormat == null) { standardFormat = new StandardMetadataFormat(); } diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java index e21d8b52c1e..b6fdbdccb4f 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java @@ -288,7 +288,7 @@ public class MediaSize extends Size2DSyntax implements Attribute { * Class MediaSize.ISO includes {@link MediaSize MediaSize} values for ISO * media. */ - public final static class ISO { + public static final class ISO { /** * Specifies the ISO A0 size, 841 mm by 1189 mm. */ @@ -437,7 +437,7 @@ public class MediaSize extends Size2DSyntax implements Attribute { * Class MediaSize.JIS includes {@link MediaSize MediaSize} values for JIS * (Japanese) media. * */ - public final static class JIS { + public static final class JIS { /** * Specifies the JIS B0 size, 1030 mm by 1456 mm. @@ -601,7 +601,7 @@ public class MediaSize extends Size2DSyntax implements Attribute { * Class MediaSize.NA includes {@link MediaSize MediaSize} values for North * American media. */ - public final static class NA { + public static final class NA { /** * Specifies the North American letter size, 8.5 inches by 11 inches. @@ -721,7 +721,7 @@ public class MediaSize extends Size2DSyntax implements Attribute { * Class MediaSize.Engineering includes {@link MediaSize MediaSize} values * for engineering media. */ - public final static class Engineering { + public static final class Engineering { /** * Specifies the engineering A size, 8.5 inch by 11 inch. @@ -764,7 +764,7 @@ public class MediaSize extends Size2DSyntax implements Attribute { * Class MediaSize.Other includes {@link MediaSize MediaSize} values for * miscellaneous media. */ - public final static class Other { + public static final class Other { /** * Specifies the executive size, 7.25 inches by 10.5 inches. */ diff --git a/jdk/src/java.desktop/share/classes/javax/sound/midi/MetaMessage.java b/jdk/src/java.desktop/share/classes/javax/sound/midi/MetaMessage.java index 2e73cc37ddf..edb326852f3 100644 --- a/jdk/src/java.desktop/share/classes/javax/sound/midi/MetaMessage.java +++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/MetaMessage.java @@ -214,7 +214,7 @@ public class MetaMessage extends MidiMessage { return length; } - private final static long mask = 0x7F; + private static final long mask = 0x7F; private void writeVarInt(byte[] data, int off, long value) { int shift=63; // number of bitwise left-shifts of mask diff --git a/jdk/src/java.desktop/share/classes/javax/swing/AbstractCellEditor.java b/jdk/src/java.desktop/share/classes/javax/swing/AbstractCellEditor.java index 993ca5c200e..9479eb06694 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/AbstractCellEditor.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/AbstractCellEditor.java @@ -60,7 +60,7 @@ public abstract class AbstractCellEditor implements CellEditor, Serializable { /** * The change event. */ - transient protected ChangeEvent changeEvent = null; + protected transient ChangeEvent changeEvent = null; // Force this to be implemented. // public Object getCellEditorValue() diff --git a/jdk/src/java.desktop/share/classes/javax/swing/BorderFactory.java b/jdk/src/java.desktop/share/classes/javax/swing/BorderFactory.java index c1e3ad16679..f1013e50d1b 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/BorderFactory.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/BorderFactory.java @@ -536,7 +536,7 @@ public class BorderFactory titlePosition, titleFont, titleColor); } //// EmptyBorder /////////////////////////////////////////////////////////// - final static Border emptyBorder = new EmptyBorder(0, 0, 0, 0); + static final Border emptyBorder = new EmptyBorder(0, 0, 0, 0); /** * Creates an empty border that takes up no space. (The width diff --git a/jdk/src/java.desktop/share/classes/javax/swing/DefaultButtonModel.java b/jdk/src/java.desktop/share/classes/javax/swing/DefaultButtonModel.java index fe2ddd143cd..ac8216af4a6 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/DefaultButtonModel.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/DefaultButtonModel.java @@ -89,33 +89,33 @@ public class DefaultButtonModel implements ButtonModel, Serializable { * indicates partial commitment towards choosing/triggering * the button. */ - public final static int ARMED = 1 << 0; + public static final int ARMED = 1 << 0; /** * Identifies the "selected" bit in the bitmask, which * indicates that the button has been selected. Only needed for * certain types of buttons - such as radio button or check box. */ - public final static int SELECTED = 1 << 1; + public static final int SELECTED = 1 << 1; /** * Identifies the "pressed" bit in the bitmask, which * indicates that the button is pressed. */ - public final static int PRESSED = 1 << 2; + public static final int PRESSED = 1 << 2; /** * Identifies the "enabled" bit in the bitmask, which * indicates that the button can be selected by * an input device (such as a mouse pointer). */ - public final static int ENABLED = 1 << 3; + public static final int ENABLED = 1 << 3; /** * Identifies the "rollover" bit in the bitmask, which * indicates that the mouse is over the button. */ - public final static int ROLLOVER = 1 << 4; + public static final int ROLLOVER = 1 << 4; /** * {@inheritDoc} diff --git a/jdk/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java b/jdk/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java index 49eecf1e77c..e28f446a5f2 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java @@ -50,11 +50,11 @@ import java.beans.PropertyVetoException; */ @SuppressWarnings("serial") // No Interesting Non-Transient State public class DefaultDesktopManager implements DesktopManager, java.io.Serializable { - final static String HAS_BEEN_ICONIFIED_PROPERTY = "wasIconOnce"; + static final String HAS_BEEN_ICONIFIED_PROPERTY = "wasIconOnce"; - final static int DEFAULT_DRAG_MODE = 0; - final static int OUTLINE_DRAG_MODE = 1; - final static int FASTER_DRAG_MODE = 2; + static final int DEFAULT_DRAG_MODE = 0; + static final int OUTLINE_DRAG_MODE = 1; + static final int FASTER_DRAG_MODE = 2; int dragMode = DEFAULT_DRAG_MODE; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/GroupLayout.java b/jdk/src/java.desktop/share/classes/javax/swing/GroupLayout.java index b1012ce1a8c..40ead7d79df 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/GroupLayout.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/GroupLayout.java @@ -3391,7 +3391,7 @@ public class GroupLayout implements LayoutManager2 { * Represents two springs that should have autopadding inserted between * them. */ - private final static class AutoPreferredGapMatch { + private static final class AutoPreferredGapMatch { public final ComponentSpring source; public final ComponentSpring target; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/ImageIcon.java b/jdk/src/java.desktop/share/classes/javax/swing/ImageIcon.java index 564e173c5c8..8c913e17332 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/ImageIcon.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/ImageIcon.java @@ -74,8 +74,8 @@ public class ImageIcon implements Icon, Serializable, Accessible { * images symbolically rather than including the image data * in the archive. */ - transient private String filename; - transient private URL location; + private transient String filename; + private transient URL location; transient Image image; transient int loadStatus = 0; @@ -88,7 +88,7 @@ public class ImageIcon implements Icon, Serializable, Accessible { * @deprecated since 1.8 */ @Deprecated - protected final static Component component; + protected static final Component component; /** * Do not use this shared media tracker, which is used to load images. @@ -96,7 +96,7 @@ public class ImageIcon implements Icon, Serializable, Accessible { * @deprecated since 1.8 */ @Deprecated - protected final static MediaTracker tracker; + protected static final MediaTracker tracker; static { component = AccessController.doPrivileged(new PrivilegedAction() { @@ -144,7 +144,7 @@ public class ImageIcon implements Icon, Serializable, Accessible { */ private static int mediaTrackerID; - private final static Object TRACKER_KEY = new StringBuilder("TRACKER_KEY"); + private static final Object TRACKER_KEY = new StringBuilder("TRACKER_KEY"); int width = -1; int height = -1; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java b/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java index e716698ae5e..d00d42c8bbb 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java @@ -377,8 +377,8 @@ public abstract class JComponent extends Container implements Serializable, /** * AA text hints. */ - transient private Object aaHint; - transient private Object lcdRenderingHint; + private transient Object aaHint; + private transient Object lcdRenderingHint; static Graphics safelyGetGraphics(Component c) { return safelyGetGraphics(c, SwingUtilities.getRoot(c)); @@ -2805,7 +2805,7 @@ public abstract class JComponent extends Container implements Serializable, * @see #setLocale * @since 1.4 */ - static public Locale getDefaultLocale() { + public static Locale getDefaultLocale() { Locale l = (Locale) SwingUtilities.appContextGet(defaultLocale); if( l == null ) { //REMIND(bcb) choosing the default value is more complicated @@ -2832,7 +2832,7 @@ public abstract class JComponent extends Container implements Serializable, * @see #setLocale * @since 1.4 */ - static public void setDefaultLocale( Locale l ) { + public static void setDefaultLocale( Locale l ) { SwingUtilities.appContextPut(defaultLocale, l); } @@ -3714,7 +3714,7 @@ public abstract class JComponent extends Container implements Serializable, * to add/remove ContainerListener and FocusListener to track * target JComponent's state */ - private volatile transient int propertyListenersCount = 0; + private transient volatile int propertyListenersCount = 0; /** * This field duplicates the function of the accessibleAWTFocusHandler field diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JEditorPane.java b/jdk/src/java.desktop/share/classes/javax/swing/JEditorPane.java index 744535d77b8..cfcd56585be 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JEditorPane.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JEditorPane.java @@ -1537,7 +1537,7 @@ public class JEditorPane extends JTextComponent { private Hashtable pageProperties; /** Should be kept in sync with javax.swing.text.html.FormView counterpart. */ - final static String PostDataProperty = "javax.swing.JEditorPane.postdata"; + static final String PostDataProperty = "javax.swing.JEditorPane.postdata"; /** * Table of registered type handlers for this editor. diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java b/jdk/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java index 3eedeb0a554..e15d327a0f8 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java @@ -860,7 +860,7 @@ public class JFormattedTextField extends JTextField { * doesn't have focus. * @since 1.4 */ - public static abstract class AbstractFormatterFactory { + public abstract static class AbstractFormatterFactory { /** * Returns an AbstractFormatter that can handle formatting * of the passed in JFormattedTextField. @@ -903,7 +903,7 @@ public class JFormattedTextField extends JTextField { * at the appropriate times. * @since 1.4 */ - public static abstract class AbstractFormatter implements Serializable { + public abstract static class AbstractFormatter implements Serializable { private JFormattedTextField ftf; /** diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JInternalFrame.java b/jdk/src/java.desktop/share/classes/javax/swing/JInternalFrame.java index 06aff62f849..8860915a82e 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JInternalFrame.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JInternalFrame.java @@ -198,31 +198,31 @@ public class JInternalFrame extends JComponent implements private Component lastFocusOwner; /** Bound property name. */ - public final static String CONTENT_PANE_PROPERTY = "contentPane"; + public static final String CONTENT_PANE_PROPERTY = "contentPane"; /** Bound property name. */ - public final static String MENU_BAR_PROPERTY = "JMenuBar"; + public static final String MENU_BAR_PROPERTY = "JMenuBar"; /** Bound property name. */ - public final static String TITLE_PROPERTY = "title"; + public static final String TITLE_PROPERTY = "title"; /** Bound property name. */ - public final static String LAYERED_PANE_PROPERTY = "layeredPane"; + public static final String LAYERED_PANE_PROPERTY = "layeredPane"; /** Bound property name. */ - public final static String ROOT_PANE_PROPERTY = "rootPane"; + public static final String ROOT_PANE_PROPERTY = "rootPane"; /** Bound property name. */ - public final static String GLASS_PANE_PROPERTY = "glassPane"; + public static final String GLASS_PANE_PROPERTY = "glassPane"; /** Bound property name. */ - public final static String FRAME_ICON_PROPERTY = "frameIcon"; + public static final String FRAME_ICON_PROPERTY = "frameIcon"; /** * Constrained property name indicated that this frame has * selected status. */ - public final static String IS_SELECTED_PROPERTY = "selected"; + public static final String IS_SELECTED_PROPERTY = "selected"; /** Constrained property name indicating that the internal frame is closed. */ - public final static String IS_CLOSED_PROPERTY = "closed"; + public static final String IS_CLOSED_PROPERTY = "closed"; /** Constrained property name indicating that the internal frame is maximized. */ - public final static String IS_MAXIMUM_PROPERTY = "maximum"; + public static final String IS_MAXIMUM_PROPERTY = "maximum"; /** Constrained property name indicating that the internal frame is iconified. */ - public final static String IS_ICON_PROPERTY = "icon"; + public static final String IS_ICON_PROPERTY = "icon"; private static final Object PROPERTY_CHANGE_LISTENER_KEY = new StringBuilder("InternalFramePropertyChangeListener"); @@ -2159,7 +2159,7 @@ public class JInternalFrame extends JComponent implements * @author David Kloba */ @SuppressWarnings("serial") // Same-version serialization only - static public class JDesktopIcon extends JComponent implements Accessible + public static class JDesktopIcon extends JComponent implements Accessible { JInternalFrame internalFrame; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JLayeredPane.java b/jdk/src/java.desktop/share/classes/javax/swing/JLayeredPane.java index 4a891217e2d..ce5998f8f56 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JLayeredPane.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JLayeredPane.java @@ -159,25 +159,25 @@ import javax.accessibility.*; public class JLayeredPane extends JComponent implements Accessible { /// Watch the values in getObjectForLayer() /** Convenience object defining the Default layer. Equivalent to new Integer(0).*/ - public final static Integer DEFAULT_LAYER = 0; + public static final Integer DEFAULT_LAYER = 0; /** Convenience object defining the Palette layer. Equivalent to new Integer(100).*/ - public final static Integer PALETTE_LAYER = 100; + public static final Integer PALETTE_LAYER = 100; /** Convenience object defining the Modal layer. Equivalent to new Integer(200).*/ - public final static Integer MODAL_LAYER = 200; + public static final Integer MODAL_LAYER = 200; /** Convenience object defining the Popup layer. Equivalent to new Integer(300).*/ - public final static Integer POPUP_LAYER = 300; + public static final Integer POPUP_LAYER = 300; /** Convenience object defining the Drag layer. Equivalent to new Integer(400).*/ - public final static Integer DRAG_LAYER = 400; + public static final Integer DRAG_LAYER = 400; /** Convenience object defining the Frame Content layer. * This layer is normally only use to position the contentPane and menuBar * components of JFrame. * Equivalent to new Integer(-30000). * @see JFrame */ - public final static Integer FRAME_CONTENT_LAYER = new Integer(-30000); + public static final Integer FRAME_CONTENT_LAYER = new Integer(-30000); /** Bound property */ - public final static String LAYER_PROPERTY = "layeredContainerLayer"; + public static final String LAYER_PROPERTY = "layeredContainerLayer"; // Hashtable to store layer values for non-JComponent components private Hashtable componentToLayer; private boolean optimizedDrawingPossible = true; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JList.java b/jdk/src/java.desktop/share/classes/javax/swing/JList.java index 82ba88e3311..14379bd5668 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JList.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JList.java @@ -161,8 +161,8 @@ import static sun.swing.SwingUtilities2.Section.*; * // Display an icon and a string for each object in the list. * * class MyCellRenderer extends JLabel implements ListCellRenderer { - * final static ImageIcon longIcon = new ImageIcon("long.gif"); - * final static ImageIcon shortIcon = new ImageIcon("short.gif"); + * static final ImageIcon longIcon = new ImageIcon("long.gif"); + * static final ImageIcon shortIcon = new ImageIcon("short.gif"); * * // This is the only method defined by ListCellRenderer. * // We just reconfigure the JLabel each time we're called. diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JOptionPane.java b/jdk/src/java.desktop/share/classes/javax/swing/JOptionPane.java index 45fbcceb83f..491fddee12f 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JOptionPane.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JOptionPane.java @@ -394,13 +394,13 @@ public class JOptionPane extends JComponent implements Accessible public static final String WANTS_INPUT_PROPERTY = "wantsInput"; /** Icon used in pane. */ - transient protected Icon icon; + protected transient Icon icon; /** Message to display. */ - transient protected Object message; + protected transient Object message; /** Options to display to the user. */ - transient protected Object[] options; + protected transient Object[] options; /** Value that should be initially selected in options. */ - transient protected Object initialValue; + protected transient Object initialValue; /** Message type. */ protected int messageType; /** @@ -412,7 +412,7 @@ public class JOptionPane extends JComponent implements Accessible protected int optionType; /** Currently selected value, will be a valid option, or * UNINITIALIZED_VALUE or null. */ - transient protected Object value; + protected transient Object value; /** Array of values the user can choose from. Look and feel will * provide the UI component to choose this from. */ protected transient Object[] selectionValues; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JPopupMenu.java b/jdk/src/java.desktop/share/classes/javax/swing/JPopupMenu.java index 89311ba1228..0df8c126308 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JPopupMenu.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JPopupMenu.java @@ -1545,7 +1545,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { * A popup menu-specific separator. */ @SuppressWarnings("serial") - static public class Separator extends JSeparator + public static class Separator extends JSeparator { /** * Constructs a popup menu-specific Separator. diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JProgressBar.java b/jdk/src/java.desktop/share/classes/javax/swing/JProgressBar.java index 4026cb84879..c823176ca36 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JProgressBar.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JProgressBar.java @@ -190,15 +190,15 @@ public class JProgressBar extends JComponent implements SwingConstants, Accessib /** * The default minimum for a progress bar is 0. */ - static final private int defaultMinimum = 0; + private static final int defaultMinimum = 0; /** * The default maximum for a progress bar is 100. */ - static final private int defaultMaximum = 100; + private static final int defaultMaximum = 100; /** * The default orientation for a progress bar is HORIZONTAL. */ - static final private int defaultOrientation = HORIZONTAL; + private static final int defaultOrientation = HORIZONTAL; /** * Only one ChangeEvent is needed per instance since the diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JSplitPane.java b/jdk/src/java.desktop/share/classes/javax/swing/JSplitPane.java index 072fefd8d3a..4b490b76cc4 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JSplitPane.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JSplitPane.java @@ -113,7 +113,7 @@ public class JSplitPane extends JComponent implements Accessible * split along the y axis. For example the two * Components will be split one on top of the other. */ - public final static int VERTICAL_SPLIT = 0; + public static final int VERTICAL_SPLIT = 0; /** * Horizontal split indicates the Components are @@ -121,75 +121,75 @@ public class JSplitPane extends JComponent implements Accessible * Components will be split one to the left of the * other. */ - public final static int HORIZONTAL_SPLIT = 1; + public static final int HORIZONTAL_SPLIT = 1; /** * Used to add a Component to the left of the other * Component. */ - public final static String LEFT = "left"; + public static final String LEFT = "left"; /** * Used to add a Component to the right of the other * Component. */ - public final static String RIGHT = "right"; + public static final String RIGHT = "right"; /** * Used to add a Component above the other * Component. */ - public final static String TOP = "top"; + public static final String TOP = "top"; /** * Used to add a Component below the other * Component. */ - public final static String BOTTOM = "bottom"; + public static final String BOTTOM = "bottom"; /** * Used to add a Component that will represent the divider. */ - public final static String DIVIDER = "divider"; + public static final String DIVIDER = "divider"; /** * Bound property name for orientation (horizontal or vertical). */ - public final static String ORIENTATION_PROPERTY = "orientation"; + public static final String ORIENTATION_PROPERTY = "orientation"; /** * Bound property name for continuousLayout. */ - public final static String CONTINUOUS_LAYOUT_PROPERTY = "continuousLayout"; + public static final String CONTINUOUS_LAYOUT_PROPERTY = "continuousLayout"; /** * Bound property name for border. */ - public final static String DIVIDER_SIZE_PROPERTY = "dividerSize"; + public static final String DIVIDER_SIZE_PROPERTY = "dividerSize"; /** * Bound property for oneTouchExpandable. */ - public final static String ONE_TOUCH_EXPANDABLE_PROPERTY = + public static final String ONE_TOUCH_EXPANDABLE_PROPERTY = "oneTouchExpandable"; /** * Bound property for lastLocation. */ - public final static String LAST_DIVIDER_LOCATION_PROPERTY = + public static final String LAST_DIVIDER_LOCATION_PROPERTY = "lastDividerLocation"; /** * Bound property for the dividerLocation. * @since 1.3 */ - public final static String DIVIDER_LOCATION_PROPERTY = "dividerLocation"; + public static final String DIVIDER_LOCATION_PROPERTY = "dividerLocation"; /** * Bound property for weight. * @since 1.3 */ - public final static String RESIZE_WEIGHT_PROPERTY = "resizeWeight"; + public static final String RESIZE_WEIGHT_PROPERTY = "resizeWeight"; /** * How the views are split. diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JTable.java b/jdk/src/java.desktop/share/classes/javax/swing/JTable.java index 3bcd70467f0..6b83043597e 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JTable.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JTable.java @@ -343,27 +343,27 @@ public class JTable extends JComponent implements TableModelListener, Scrollable protected boolean cellSelectionEnabled; /** If editing, the Component that is handling the editing. */ - transient protected Component editorComp; + protected transient Component editorComp; /** * The active cell editor object, that overwrites the screen real estate * occupied by the current cell and allows the user to change its contents. * {@code null} if the table isn't currently editing. */ - transient protected TableCellEditor cellEditor; + protected transient TableCellEditor cellEditor; /** Identifies the column of the cell being edited. */ - transient protected int editingColumn; + protected transient int editingColumn; /** Identifies the row of the cell being edited. */ - transient protected int editingRow; + protected transient int editingRow; /** * A table of objects that display the contents of a cell, * indexed by class as declared in getColumnClass * in the TableModel interface. */ - transient protected Hashtable defaultRenderersByColumnClass; + protected transient Hashtable defaultRenderersByColumnClass; // Logicaly, the above is a Hashtable, TableCellRenderer>. // It is declared otherwise to accomodate using UIDefaults. @@ -372,7 +372,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * indexed by class as declared in getColumnClass * in the TableModel interface. */ - transient protected Hashtable defaultEditorsByColumnClass; + protected transient Hashtable defaultEditorsByColumnClass; // Logicaly, the above is a Hashtable, TableCellEditor>. // It is declared otherwise to accomodate using UIDefaults. @@ -880,7 +880,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * replaced by new JScrollPane(aTable). */ @Deprecated - static public JScrollPane createScrollPaneForTable(JTable aTable) { + public static JScrollPane createScrollPaneForTable(JTable aTable) { return new JScrollPane(aTable); } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JToolBar.java b/jdk/src/java.desktop/share/classes/javax/swing/JToolBar.java index 6fff218430f..0a7e6fef71d 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JToolBar.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JToolBar.java @@ -593,7 +593,7 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible * A toolbar-specific separator. An object with dimension but * no contents used to divide buttons on a tool bar into groups. */ - static public class Separator extends JSeparator + public static class Separator extends JSeparator { private Dimension separatorSize; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JTree.java b/jdk/src/java.desktop/share/classes/javax/swing/JTree.java index 4cec5c377d7..9d58f86ea09 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JTree.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JTree.java @@ -155,12 +155,12 @@ public class JTree extends JComponent implements Scrollable, Accessible /** * The model that defines the tree displayed by this object. */ - transient protected TreeModel treeModel; + protected transient TreeModel treeModel; /** * Models the set of selected nodes in this tree. */ - transient protected TreeSelectionModel selectionModel; + protected transient TreeSelectionModel selectionModel; /** * True if the root node is displayed, false if its children are @@ -172,7 +172,7 @@ public class JTree extends JComponent implements Scrollable, Accessible * The cell used to draw nodes. If null, the UI uses a default * cellRenderer. */ - transient protected TreeCellRenderer cellRenderer; + protected transient TreeCellRenderer cellRenderer; /** * Height to use for each display row. If this is <= 0 the renderer @@ -189,7 +189,7 @@ public class JTree extends JComponent implements Scrollable, Accessible * information must be determined by visiting all the parent * paths and seeing if they are visible. */ - transient private Hashtable expandedState; + private transient Hashtable expandedState; /** @@ -227,7 +227,7 @@ public class JTree extends JComponent implements Scrollable, Accessible * Editor for the entries. Default is null * (tree is not editable). */ - transient protected TreeCellEditor cellEditor; + protected transient TreeCellEditor cellEditor; /** * Is the tree editable? Default is false. @@ -277,13 +277,13 @@ public class JTree extends JComponent implements Scrollable, Accessible /** * Updates the expandedState. */ - transient protected TreeModelListener treeModelListener; + protected transient TreeModelListener treeModelListener; /** * Used when setExpandedState is invoked, * will be a Stack of Stacks. */ - transient private Stack> expandedStack; + private transient Stack> expandedStack; /** * Lead selection path, may not be null. @@ -459,40 +459,40 @@ public class JTree extends JComponent implements Scrollable, Accessible // Bound property names // /** Bound property name for cellRenderer. */ - public final static String CELL_RENDERER_PROPERTY = "cellRenderer"; + public static final String CELL_RENDERER_PROPERTY = "cellRenderer"; /** Bound property name for treeModel. */ - public final static String TREE_MODEL_PROPERTY = "model"; + public static final String TREE_MODEL_PROPERTY = "model"; /** Bound property name for rootVisible. */ - public final static String ROOT_VISIBLE_PROPERTY = "rootVisible"; + public static final String ROOT_VISIBLE_PROPERTY = "rootVisible"; /** Bound property name for showsRootHandles. */ - public final static String SHOWS_ROOT_HANDLES_PROPERTY = "showsRootHandles"; + public static final String SHOWS_ROOT_HANDLES_PROPERTY = "showsRootHandles"; /** Bound property name for rowHeight. */ - public final static String ROW_HEIGHT_PROPERTY = "rowHeight"; + public static final String ROW_HEIGHT_PROPERTY = "rowHeight"; /** Bound property name for cellEditor. */ - public final static String CELL_EDITOR_PROPERTY = "cellEditor"; + public static final String CELL_EDITOR_PROPERTY = "cellEditor"; /** Bound property name for editable. */ - public final static String EDITABLE_PROPERTY = "editable"; + public static final String EDITABLE_PROPERTY = "editable"; /** Bound property name for largeModel. */ - public final static String LARGE_MODEL_PROPERTY = "largeModel"; + public static final String LARGE_MODEL_PROPERTY = "largeModel"; /** Bound property name for selectionModel. */ - public final static String SELECTION_MODEL_PROPERTY = "selectionModel"; + public static final String SELECTION_MODEL_PROPERTY = "selectionModel"; /** Bound property name for visibleRowCount. */ - public final static String VISIBLE_ROW_COUNT_PROPERTY = "visibleRowCount"; + public static final String VISIBLE_ROW_COUNT_PROPERTY = "visibleRowCount"; /** Bound property name for messagesStopCellEditing. */ - public final static String INVOKES_STOP_CELL_EDITING_PROPERTY = "invokesStopCellEditing"; + public static final String INVOKES_STOP_CELL_EDITING_PROPERTY = "invokesStopCellEditing"; /** Bound property name for scrollsOnExpand. */ - public final static String SCROLLS_ON_EXPAND_PROPERTY = "scrollsOnExpand"; + public static final String SCROLLS_ON_EXPAND_PROPERTY = "scrollsOnExpand"; /** Bound property name for toggleClickCount. */ - public final static String TOGGLE_CLICK_COUNT_PROPERTY = "toggleClickCount"; + public static final String TOGGLE_CLICK_COUNT_PROPERTY = "toggleClickCount"; /** Bound property name for leadSelectionPath. * @since 1.3 */ - public final static String LEAD_SELECTION_PATH_PROPERTY = "leadSelectionPath"; + public static final String LEAD_SELECTION_PATH_PROPERTY = "leadSelectionPath"; /** Bound property name for anchor selection path. * @since 1.3 */ - public final static String ANCHOR_SELECTION_PATH_PROPERTY = "anchorSelectionPath"; + public static final String ANCHOR_SELECTION_PATH_PROPERTY = "anchorSelectionPath"; /** Bound property name for expands selected paths property * @since 1.3 */ - public final static String EXPANDS_SELECTED_PATHS_PROPERTY = "expandsSelectedPaths"; + public static final String EXPANDS_SELECTED_PATHS_PROPERTY = "expandsSelectedPaths"; /** @@ -3322,7 +3322,7 @@ public class JTree extends JComponent implements Scrollable, Accessible * * @return single instance of {@code EmptySelectionModel} */ - static public EmptySelectionModel sharedInstance() { + public static EmptySelectionModel sharedInstance() { return sharedInstance; } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JViewport.java b/jdk/src/java.desktop/share/classes/javax/swing/JViewport.java index 856e172f6f7..8090dc78087 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JViewport.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JViewport.java @@ -139,7 +139,7 @@ public class JViewport extends JComponent implements Accessible protected boolean backingStore = false; /** The view image used for a backing store. */ - transient protected Image backingStoreImage = null; + protected transient Image backingStoreImage = null; /** * The scrollUnderway flag is used for components like diff --git a/jdk/src/java.desktop/share/classes/javax/swing/RowFilter.java b/jdk/src/java.desktop/share/classes/javax/swing/RowFilter.java index bfa413e26f8..167a91239f9 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/RowFilter.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/RowFilter.java @@ -340,7 +340,7 @@ public abstract class RowFilter { * @see javax.swing.DefaultRowSorter#setRowFilter(javax.swing.RowFilter) * @since 1.6 */ - public static abstract class Entry { + public abstract static class Entry { /** * Creates an Entry. */ @@ -409,7 +409,7 @@ public abstract class RowFilter { } - private static abstract class GeneralFilter extends RowFilter { + private abstract static class GeneralFilter extends RowFilter { private int[] columns; GeneralFilter(int[] columns) { diff --git a/jdk/src/java.desktop/share/classes/javax/swing/SortingFocusTraversalPolicy.java b/jdk/src/java.desktop/share/classes/javax/swing/SortingFocusTraversalPolicy.java index 057d4d4a58c..9057e80faad 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/SortingFocusTraversalPolicy.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/SortingFocusTraversalPolicy.java @@ -83,16 +83,16 @@ public class SortingFocusTraversalPolicy * that they need to invoke getFirstComponent or getLastComponent, the * sorted list should be reused if possible. */ - transient private Container cachedRoot; - transient private List cachedCycle; + private transient Container cachedRoot; + private transient List cachedCycle; // Delegate our fitness test to ContainerOrder so that we only have to // code the algorithm once. private static final SwingContainerOrderFocusTraversalPolicy fitnessTestPolicy = new SwingContainerOrderFocusTraversalPolicy(); - final private int FORWARD_TRAVERSAL = 0; - final private int BACKWARD_TRAVERSAL = 1; + private final int FORWARD_TRAVERSAL = 0; + private final int BACKWARD_TRAVERSAL = 1; /* * When true (by default), the legacy merge-sort algo is used to sort an FTP cycle. diff --git a/jdk/src/java.desktop/share/classes/javax/swing/SwingWorker.java b/jdk/src/java.desktop/share/classes/javax/swing/SwingWorker.java index 753ca525ffd..40da1c24a02 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/SwingWorker.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/SwingWorker.java @@ -827,7 +827,7 @@ public abstract class SwingWorker implements RunnableFuture { } private static class DoSubmitAccumulativeRunnable extends AccumulativeRunnable implements ActionListener { - private final static int DELAY = 1000 / 30; + private static final int DELAY = 1000 / 30; @Override protected void run(List args) { for (Runnable runnable : args) { diff --git a/jdk/src/java.desktop/share/classes/javax/swing/Timer.java b/jdk/src/java.desktop/share/classes/javax/swing/Timer.java index e15736c8004..73b5da9c85a 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/Timer.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/Timer.java @@ -172,16 +172,16 @@ public class Timer implements Serializable // notify is set to true when the Timer fires and the Runnable is queued. // It will be set to false after notifying the listeners (if coalesce is // true) or if the developer invokes stop. - private transient final AtomicBoolean notify = new AtomicBoolean(false); + private final transient AtomicBoolean notify = new AtomicBoolean(false); private volatile int initialDelay, delay; private volatile boolean repeats = true, coalesce = true; - private transient final Runnable doPostEvent; + private final transient Runnable doPostEvent; private static volatile boolean logTimers; - private transient final Lock lock = new ReentrantLock(); + private final transient Lock lock = new ReentrantLock(); // This field is maintained by TimerQueue. // eventQueued can also be reset by the TimerQueue, but will only ever diff --git a/jdk/src/java.desktop/share/classes/javax/swing/TimerQueue.java b/jdk/src/java.desktop/share/classes/javax/swing/TimerQueue.java index e2ac94080f7..5f05a3b6beb 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/TimerQueue.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/TimerQueue.java @@ -267,7 +267,7 @@ class TimerQueue implements Runnable } - final public long getDelay(TimeUnit unit) { + public final long getDelay(TimeUnit unit) { return unit.convert(time - now(), TimeUnit.NANOSECONDS); } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/TransferHandler.java b/jdk/src/java.desktop/share/classes/javax/swing/TransferHandler.java index 886b41b7a2c..b342363d638 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/TransferHandler.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/TransferHandler.java @@ -210,7 +210,7 @@ public class TransferHandler implements Serializable { * @see #importData(TransferHandler.TransferSupport) * @since 1.6 */ - public final static class TransferSupport { + public static final class TransferSupport { private boolean isDrop; private Component component; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/UIManager.java b/jdk/src/java.desktop/share/classes/javax/swing/UIManager.java index 7746b9fb389..deca83eecf9 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/UIManager.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/UIManager.java @@ -1074,7 +1074,7 @@ public class UIManager implements Serializable * @see #getAuxiliaryLookAndFeels * @see #getInstalledLookAndFeels */ - static public void addAuxiliaryLookAndFeel(LookAndFeel laf) { + public static void addAuxiliaryLookAndFeel(LookAndFeel laf) { maybeInitialize(); if (!laf.isSupportedLookAndFeel()) { @@ -1115,7 +1115,7 @@ public class UIManager implements Serializable * @see #setLookAndFeel * @see #getInstalledLookAndFeels */ - static public boolean removeAuxiliaryLookAndFeel(LookAndFeel laf) { + public static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf) { maybeInitialize(); boolean result; @@ -1153,7 +1153,7 @@ public class UIManager implements Serializable * @see #setLookAndFeel * @see #getInstalledLookAndFeels */ - static public LookAndFeel[] getAuxiliaryLookAndFeels() { + public static LookAndFeel[] getAuxiliaryLookAndFeels() { maybeInitialize(); Vector v = getLAFState().auxLookAndFeels; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/border/TitledBorder.java b/jdk/src/java.desktop/share/classes/javax/swing/border/TitledBorder.java index dadc36bba45..2732cb9cde3 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/border/TitledBorder.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/border/TitledBorder.java @@ -100,55 +100,55 @@ public class TitledBorder extends AbstractBorder /** * Use the default vertical orientation for the title text. */ - static public final int DEFAULT_POSITION = 0; + public static final int DEFAULT_POSITION = 0; /** Position the title above the border's top line. */ - static public final int ABOVE_TOP = 1; + public static final int ABOVE_TOP = 1; /** Position the title in the middle of the border's top line. */ - static public final int TOP = 2; + public static final int TOP = 2; /** Position the title below the border's top line. */ - static public final int BELOW_TOP = 3; + public static final int BELOW_TOP = 3; /** Position the title above the border's bottom line. */ - static public final int ABOVE_BOTTOM = 4; + public static final int ABOVE_BOTTOM = 4; /** Position the title in the middle of the border's bottom line. */ - static public final int BOTTOM = 5; + public static final int BOTTOM = 5; /** Position the title below the border's bottom line. */ - static public final int BELOW_BOTTOM = 6; + public static final int BELOW_BOTTOM = 6; /** * Use the default justification for the title text. */ - static public final int DEFAULT_JUSTIFICATION = 0; + public static final int DEFAULT_JUSTIFICATION = 0; /** Position title text at the left side of the border line. */ - static public final int LEFT = 1; + public static final int LEFT = 1; /** Position title text in the center of the border line. */ - static public final int CENTER = 2; + public static final int CENTER = 2; /** Position title text at the right side of the border line. */ - static public final int RIGHT = 3; + public static final int RIGHT = 3; /** Position title text at the left side of the border line * for left to right orientation, at the right side of the * border line for right to left orientation. */ - static public final int LEADING = 4; + public static final int LEADING = 4; /** Position title text at the right side of the border line * for left to right orientation, at the left side of the * border line for right to left orientation. */ - static public final int TRAILING = 5; + public static final int TRAILING = 5; /** * Space between the border and the component's edge */ - static protected final int EDGE_SPACING = 2; + protected static final int EDGE_SPACING = 2; /** * Space between the border and text */ - static protected final int TEXT_SPACING = 2; + protected static final int TEXT_SPACING = 2; /** * Horizontal inset of text that is left or right justified */ - static protected final int TEXT_INSET_H = 5; + protected static final int TEXT_INSET_H = 5; /** * Creates a TitledBorder instance. diff --git a/jdk/src/java.desktop/share/classes/javax/swing/event/EventListenerList.java b/jdk/src/java.desktop/share/classes/javax/swing/event/EventListenerList.java index 4e0df90b8c6..f7265cd04be 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/event/EventListenerList.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/event/EventListenerList.java @@ -100,7 +100,7 @@ import sun.reflect.misc.ReflectUtil; @SuppressWarnings("serial") public class EventListenerList implements Serializable { /* A null array to be shared by all empty listener lists*/ - private final static Object[] NULL_ARRAY = new Object[0]; + private static final Object[] NULL_ARRAY = new Object[0]; /** The list of ListenerType - Listener pairs */ protected transient Object[] listenerList = NULL_ARRAY; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java index 0e1aa403fac..1146e469cc3 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java @@ -64,7 +64,7 @@ public class BasicButtonUI extends ButtonUI{ */ protected int defaultTextShiftOffset; - private final static String propertyPrefix = "Button" + "."; + private static final String propertyPrefix = "Button" + "."; private static final Object BASIC_BUTTON_UI_KEY = new Object(); diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java index d0deeb59ca5..37501888a60 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java @@ -54,7 +54,7 @@ public class BasicCheckBoxUI extends BasicRadioButtonUI { private static final Object BASIC_CHECK_BOX_UI_KEY = new Object(); - private final static String propertyPrefix = "CheckBox" + "."; + private static final String propertyPrefix = "CheckBox" + "."; // ******************************** // Create PLAF diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java index 231eced6f52..3fa7f8d5763 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java @@ -57,7 +57,7 @@ implements ListCellRenderer, Serializable { * the setBorder method. */ protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1); - private final static Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1); + private static final Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1); /** * Constructs a new instance of {@code BasicComboBoxRenderer}. diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicIconFactory.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicIconFactory.java index 638885127b2..4db5f6078f8 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicIconFactory.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicIconFactory.java @@ -167,7 +167,7 @@ public class BasicIconFactory implements Serializable private static class CheckBoxIcon implements Icon, Serializable { - final static int csize = 13; + static final int csize = 13; public void paintIcon(Component c, Graphics g, int x, int y) { } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java index f4873750113..ae8827a4f82 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java @@ -167,35 +167,35 @@ public class BasicListUI extends ListUI /** * The bit relates to model changed property. */ - protected final static int modelChanged = 1 << 0; + protected static final int modelChanged = 1 << 0; /** * The bit relates to selection model changed property. */ - protected final static int selectionModelChanged = 1 << 1; + protected static final int selectionModelChanged = 1 << 1; /** * The bit relates to font changed property. */ - protected final static int fontChanged = 1 << 2; + protected static final int fontChanged = 1 << 2; /** * The bit relates to fixed cell width changed property. */ - protected final static int fixedCellWidthChanged = 1 << 3; + protected static final int fixedCellWidthChanged = 1 << 3; /** * The bit relates to fixed cell height changed property. */ - protected final static int fixedCellHeightChanged = 1 << 4; + protected static final int fixedCellHeightChanged = 1 << 4; /** * The bit relates to prototype cell value changed property. */ - protected final static int prototypeCellValueChanged = 1 << 5; + protected static final int prototypeCellValueChanged = 1 << 5; /** * The bit relates to cell renderer changed property. */ - protected final static int cellRendererChanged = 1 << 6; - private final static int layoutOrientationChanged = 1 << 7; - private final static int heightChanged = 1 << 8; - private final static int widthChanged = 1 << 9; - private final static int componentOrientationChanged = 1 << 10; + protected static final int cellRendererChanged = 1 << 6; + private static final int layoutOrientationChanged = 1 << 7; + private static final int heightChanged = 1 << 8; + private static final int widthChanged = 1 << 9; + private static final int componentOrientationChanged = 1 << 10; private static final int DROP_LINE_THICKNESS = 2; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java index 15fc03fd2dc..83e5e7af614 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java @@ -53,7 +53,7 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI private boolean defaults_initialized = false; - private final static String propertyPrefix = "RadioButton" + "."; + private static final String propertyPrefix = "RadioButton" + "."; private KeyListener keyListener = null; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java index 870115cf18f..fdab80f77b8 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java @@ -115,7 +115,7 @@ public class BasicScrollBarUI /** Scroll timer */ protected Timer scrollTimer; - private final static int scrollSpeedThrottle = 60; // delay in milli seconds + private static final int scrollSpeedThrottle = 60; // delay in milli seconds /** * True indicates a middle click will absolutely position the diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java index 0330ee43226..80377239e6e 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java @@ -2542,21 +2542,21 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { } private static class Actions extends UIAction { - final static String NEXT = "navigateNext"; - final static String PREVIOUS = "navigatePrevious"; - final static String RIGHT = "navigateRight"; - final static String LEFT = "navigateLeft"; - final static String UP = "navigateUp"; - final static String DOWN = "navigateDown"; - final static String PAGE_UP = "navigatePageUp"; - final static String PAGE_DOWN = "navigatePageDown"; - final static String REQUEST_FOCUS = "requestFocus"; - final static String REQUEST_FOCUS_FOR_VISIBLE = + static final String NEXT = "navigateNext"; + static final String PREVIOUS = "navigatePrevious"; + static final String RIGHT = "navigateRight"; + static final String LEFT = "navigateLeft"; + static final String UP = "navigateUp"; + static final String DOWN = "navigateDown"; + static final String PAGE_UP = "navigatePageUp"; + static final String PAGE_DOWN = "navigatePageDown"; + static final String REQUEST_FOCUS = "requestFocus"; + static final String REQUEST_FOCUS_FOR_VISIBLE = "requestFocusForVisibleComponent"; - final static String SET_SELECTED = "setSelectedIndex"; - final static String SELECT_FOCUSED = "selectTabWithFocus"; - final static String SCROLL_FORWARD = "scrollTabsForwardAction"; - final static String SCROLL_BACKWARD = "scrollTabsBackwardAction"; + static final String SET_SELECTED = "setSelectedIndex"; + static final String SELECT_FOCUSED = "selectTabWithFocus"; + static final String SCROLL_FORWARD = "scrollTabsForwardAction"; + static final String SCROLL_BACKWARD = "scrollTabsBackwardAction"; Actions(String key) { super(key); diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java index 5f394dbbefb..e28fd6c8e3e 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java @@ -46,7 +46,7 @@ public class BasicToggleButtonUI extends BasicButtonUI { private static final Object BASIC_TOGGLE_BUTTON_UI_KEY = new Object(); - private final static String propertyPrefix = "ToggleButton" + "."; + private static final String propertyPrefix = "ToggleButton" + "."; // ******************************** // Create PLAF diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java index 14e46845031..7216dfe4a4b 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java @@ -61,16 +61,16 @@ public class BasicTreeUI extends TreeUI new StringBuilder("Tree.baselineComponent"); // Old actions forward to an instance of this. - static private final Actions SHARED_ACTION = new Actions(); + private static final Actions SHARED_ACTION = new Actions(); /** * The collapsed icon. */ - transient protected Icon collapsedIcon; + protected transient Icon collapsedIcon; /** * The expanded icon. */ - transient protected Icon expandedIcon; + protected transient Icon expandedIcon; /** * Color used to draw hash marks. If null no hash marks @@ -98,14 +98,14 @@ public class BasicTreeUI extends TreeUI protected JTree tree; /** Renderer that is being used to do the actual cell drawing. */ - transient protected TreeCellRenderer currentCellRenderer; + protected transient TreeCellRenderer currentCellRenderer; /** Set to true if the renderer that is currently in the tree was * created by this instance. */ protected boolean createdRenderer; /** Editor for the tree. */ - transient protected TreeCellEditor cellEditor; + protected transient TreeCellEditor cellEditor; /** Set to true if editor that is currently in the tree was * created by this instance. */ diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java index e18d44a37a0..8e1417d0dbb 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java @@ -60,7 +60,7 @@ public class MetalCheckBoxUI extends MetalRadioButtonUI { private static final Object METAL_CHECK_BOX_UI_KEY = new Object(); - private final static String propertyPrefix = "CheckBox" + "."; + private static final String propertyPrefix = "CheckBox" + "."; private boolean defaults_initialized = false; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java index 0e905398dac..d1b3c1e2166 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java @@ -954,7 +954,7 @@ public class MetalFileChooserUI extends BasicFileChooserUI { } } - final static int space = 10; + static final int space = 10; class IndentIcon implements Icon { Icon icon = null; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalIconFactory.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalIconFactory.java index 8cd0bd04ace..926835fb896 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalIconFactory.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalIconFactory.java @@ -1617,7 +1617,7 @@ public class MetalIconFactory implements Serializable { } // End class TreeFloppyDriveIcon - static private final Dimension folderIcon16Size = new Dimension( 16, 16 ); + private static final Dimension folderIcon16Size = new Dimension( 16, 16 ); /** * Utility class for caching icon images. This is necessary because @@ -1787,7 +1787,7 @@ public class MetalIconFactory implements Serializable { } - static private final Dimension fileIcon16Size = new Dimension( 16, 16 ); + private static final Dimension fileIcon16Size = new Dimension( 16, 16 ); /** *

@@ -1887,7 +1887,7 @@ public class MetalIconFactory implements Serializable { } - static private final Dimension treeControlSize = new Dimension( 18, 18 ); + private static final Dimension treeControlSize = new Dimension( 18, 18 ); /** *

@@ -2052,9 +2052,9 @@ public class MetalIconFactory implements Serializable { // Menu Icons // - static private final Dimension menuArrowIconSize = new Dimension( 4, 8 ); - static private final Dimension menuCheckIconSize = new Dimension( 10, 10 ); - static private final int xOff = 4; + private static final Dimension menuArrowIconSize = new Dimension( 4, 8 ); + private static final Dimension menuCheckIconSize = new Dimension( 10, 10 ); + private static final int xOff = 4; private static class MenuArrowIcon implements Icon, UIResource, Serializable { diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java index 2b92e81e864..15c9fd8eb13 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java @@ -88,7 +88,7 @@ public class MetalToolBarUI extends BasicToolBarUI /** * Registers the specified component. */ - synchronized static void register(JComponent c) { + static synchronized void register(JComponent c) { if (c == null) { // Exception is thrown as convenience for callers that are // typed to throw an NPE. @@ -100,7 +100,7 @@ public class MetalToolBarUI extends BasicToolBarUI /** * Unregisters the specified component. */ - synchronized static void unregister(JComponent c) { + static synchronized void unregister(JComponent c) { for (int counter = components.size() - 1; counter >= 0; counter--) { // Search for the component, removing any flushed references // along the way. @@ -116,7 +116,7 @@ public class MetalToolBarUI extends BasicToolBarUI * Finds a previously registered component of class target * that shares the JRootPane ancestor of from. */ - synchronized static Object findRegisteredComponentOfType(JComponent from, + static synchronized Object findRegisteredComponentOfType(JComponent from, Class target) { JRootPane rp = SwingUtilities.getRootPane(from); if (rp != null) { diff --git a/jdk/src/java.desktop/share/classes/javax/swing/table/DefaultTableColumnModel.java b/jdk/src/java.desktop/share/classes/javax/swing/table/DefaultTableColumnModel.java index af19749c9d3..56af1a11ccf 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/table/DefaultTableColumnModel.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/table/DefaultTableColumnModel.java @@ -73,7 +73,7 @@ public class DefaultTableColumnModel implements TableColumnModel, protected EventListenerList listenerList = new EventListenerList(); /** Change event (only one needed) */ - transient protected ChangeEvent changeEvent = null; + protected transient ChangeEvent changeEvent = null; /** Column selection allowed in this column model */ protected boolean columnSelectionAllowed; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java b/jdk/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java index 12ebf26ee51..546e962c9fa 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java @@ -106,13 +106,13 @@ public class JTableHeader extends JComponent implements TableColumnModelListener protected boolean updateTableInRealTime; /** The index of the column being resized. null if not resizing. */ - transient protected TableColumn resizingColumn; + protected transient TableColumn resizingColumn; /** The index of the column being dragged. null if not dragging. */ - transient protected TableColumn draggedColumn; + protected transient TableColumn draggedColumn; /** The distance from its original position the column has been dragged. */ - transient protected int draggedDistance; + protected transient int draggedDistance; /** * The default renderer to be used when a TableColumn diff --git a/jdk/src/java.desktop/share/classes/javax/swing/table/TableColumn.java b/jdk/src/java.desktop/share/classes/javax/swing/table/TableColumn.java index 8facbc82057..0d54da6d1d7 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/table/TableColumn.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/table/TableColumn.java @@ -92,25 +92,25 @@ public class TableColumn extends Object implements Serializable { * Warning: The value of this constant, "columWidth" is wrong as the * name of the property is "columnWidth". */ - public final static String COLUMN_WIDTH_PROPERTY = "columWidth"; + public static final String COLUMN_WIDTH_PROPERTY = "columWidth"; /** * Obsolete as of Java 2 platform v1.3. Please use string literals to identify * properties. */ - public final static String HEADER_VALUE_PROPERTY = "headerValue"; + public static final String HEADER_VALUE_PROPERTY = "headerValue"; /** * Obsolete as of Java 2 platform v1.3. Please use string literals to identify * properties. */ - public final static String HEADER_RENDERER_PROPERTY = "headerRenderer"; + public static final String HEADER_RENDERER_PROPERTY = "headerRenderer"; /** * Obsolete as of Java 2 platform v1.3. Please use string literals to identify * properties. */ - public final static String CELL_RENDERER_PROPERTY = "cellRenderer"; + public static final String CELL_RENDERER_PROPERTY = "cellRenderer"; // // Instance Variables @@ -173,7 +173,7 @@ public class TableColumn extends Object implements Serializable { * end of the resize. */ @Deprecated - transient protected int resizedPostingDisableCount; + protected transient int resizedPostingDisableCount; /** * If any PropertyChangeListeners have been registered, the diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java b/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java index 191805e16c0..2b87618abd9 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java @@ -1300,7 +1300,7 @@ public abstract class AbstractDocument implements Document, Serializable { * @return the thread actively modifying the document * or null if there are no modifications in progress */ - protected synchronized final Thread getCurrentWriter() { + protected final synchronized Thread getCurrentWriter() { return currWriter; } @@ -1329,7 +1329,7 @@ public abstract class AbstractDocument implements Document, Serializable { * where order of delivery is not guaranteed and all listeners * should be notified before further mutations are allowed. */ - protected synchronized final void writeLock() { + protected final synchronized void writeLock() { try { while ((numReaders > 0) || (currWriter != null)) { if (Thread.currentThread() == currWriter) { @@ -1359,7 +1359,7 @@ public abstract class AbstractDocument implements Document, Serializable { * * @see #writeLock */ - protected synchronized final void writeUnlock() { + protected final synchronized void writeUnlock() { if (--numWriters <= 0) { numWriters = 0; currWriter = null; @@ -1378,7 +1378,7 @@ public abstract class AbstractDocument implements Document, Serializable { * * @see #readUnlock */ - public synchronized final void readLock() { + public final synchronized void readLock() { try { while (currWriter != null) { if (currWriter == Thread.currentThread()) { @@ -1412,7 +1412,7 @@ public abstract class AbstractDocument implements Document, Serializable { * * @see #readLock */ - public synchronized final void readUnlock() { + public final synchronized void readUnlock() { if (currWriter == Thread.currentThread()) { // writer has full read access.... may try to acquire // lock in notification diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractWriter.java b/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractWriter.java index fb07a9533c0..0ca0fecb5a8 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractWriter.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractWriter.java @@ -261,7 +261,7 @@ public abstract class AbstractWriter { * @throws BadLocationException for an invalid location within * the document */ - abstract protected void write() throws IOException, BadLocationException; + protected abstract void write() throws IOException, BadLocationException; /** * Returns the text associated with the element. diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java index f474ac79add..134d94cb1fa 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java @@ -1598,11 +1598,11 @@ public class DefaultCaret extends Rectangle implements Caret, FocusListener, Mou boolean dotLTR; boolean markLTR; transient Handler handler = new Handler(); - transient private int[] flagXPoints = new int[3]; - transient private int[] flagYPoints = new int[3]; + private transient int[] flagXPoints = new int[3]; + private transient int[] flagYPoints = new int[3]; private transient NavigationFilter.FilterBypass filterBypass; - static private transient Action selectWord = null; - static private transient Action selectLine = null; + private static transient Action selectWord = null; + private static transient Action selectLine = null; /** * This is used to indicate if the caret currently owns the selection. * This is always false if the system does not support the system diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultHighlighter.java b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultHighlighter.java index 42d81e952d3..cc423788a0a 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultHighlighter.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultHighlighter.java @@ -352,7 +352,7 @@ public class DefaultHighlighter extends LayeredHighlighter { // ---- member variables -------------------------------------------- - private final static Highlighter.Highlight[] noHighlights = + private static final Highlighter.Highlight[] noHighlights = new Highlighter.Highlight[0]; private Vector highlights = new Vector(); private JTextComponent component; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java index 24e4be19cfd..16fbdfe8315 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java @@ -2650,7 +2650,7 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc } /** Class-specific reference queues. */ - private final static Map, ReferenceQueue> queueMap + private static final Map, ReferenceQueue> queueMap = new HashMap, ReferenceQueue>(); /** A weak reference to the document object. */ diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/DocumentFilter.java b/jdk/src/java.desktop/share/classes/javax/swing/text/DocumentFilter.java index e71502cc66e..2b0c819a480 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/DocumentFilter.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/DocumentFilter.java @@ -129,7 +129,7 @@ public class DocumentFilter { * are invoked from the DocumentFilter. * @since 1.4 */ - public static abstract class FilterBypass { + public abstract static class FilterBypass { /** * Returns the Document the mutation is occurring on. * diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/GapContent.java b/jdk/src/java.desktop/share/classes/javax/swing/text/GapContent.java index 0781815c7c4..282e08f78b2 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/GapContent.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/GapContent.java @@ -332,7 +332,7 @@ public class GapContent extends GapVector implements AbstractDocument.Content, S private transient ReferenceQueue queue; - final static int GROWTH_SIZE = 1024 * 512; + static final int GROWTH_SIZE = 1024 * 512; // --- gap management ------------------------------- diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphView.java b/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphView.java index d29b56bde19..2698c90bc6e 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphView.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphView.java @@ -1153,7 +1153,7 @@ public class GlyphView extends View implements TabableView, Cloneable { * * @since 1.3 */ - public static abstract class GlyphPainter { + public abstract static class GlyphPainter { /** * Determine the span the glyphs given a start location diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/LayeredHighlighter.java b/jdk/src/java.desktop/share/classes/javax/swing/text/LayeredHighlighter.java index a3ee23e214e..d7d35659f97 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/LayeredHighlighter.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/LayeredHighlighter.java @@ -55,7 +55,7 @@ public abstract class LayeredHighlighter implements Highlighter { /** * Layered highlight renderer. */ - static public abstract class LayerPainter implements Highlighter.HighlightPainter { + public abstract static class LayerPainter implements Highlighter.HighlightPainter { /** * @return a shape * @param g Graphics used to draw diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/NavigationFilter.java b/jdk/src/java.desktop/share/classes/javax/swing/text/NavigationFilter.java index 94e76e71a1c..ca59891e884 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/NavigationFilter.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/NavigationFilter.java @@ -120,7 +120,7 @@ public class NavigationFilter { * not callback into the NavigationFilter. * @since 1.4 */ - public static abstract class FilterBypass { + public abstract static class FilterBypass { /** * Returns the Caret that is changing. * diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/ParagraphView.java b/jdk/src/java.desktop/share/classes/javax/swing/text/ParagraphView.java index b42b04997d4..154db5cf7ef 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/ParagraphView.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/ParagraphView.java @@ -1184,11 +1184,11 @@ public class ParagraphView extends FlowView implements TabExpander { lineSpacing); } - final static int SPACE_ADDON = 0; - final static int SPACE_ADDON_LEFTOVER_END = 1; - final static int START_JUSTIFIABLE = 2; + static final int SPACE_ADDON = 0; + static final int SPACE_ADDON_LEFTOVER_END = 1; + static final int START_JUSTIFIABLE = 2; //this should be the last index in justificationData - final static int END_JUSTIFIABLE = 3; + static final int END_JUSTIFIABLE = 3; int justificationData[] = null; } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/TableView.java b/jdk/src/java.desktop/share/classes/javax/swing/text/TableView.java index b74c8574738..cc286d8697a 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/TableView.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/TableView.java @@ -579,7 +579,7 @@ public abstract class TableView extends BoxView { SizeRequirements[] columnRequirements; Vector rows; boolean gridValid; - static final private BitSet EMPTY = new BitSet(); + private static final BitSet EMPTY = new BitSet(); /** * View of a row in a row-centric table. diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/CSS.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/CSS.java index 46fce89a2d1..85cf2a8d16f 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/CSS.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/CSS.java @@ -2433,7 +2433,7 @@ public class CSS implements Serializable { } // CSS.Values are static, don't archive it. - transient private CSS.Value style; + private transient CSS.Value style; } @SuppressWarnings("serial") // Same-version serialization only diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/CSSBorder.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/CSSBorder.java index 5945f34e3d2..e91ea51535e 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/CSSBorder.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/CSSBorder.java @@ -54,13 +54,13 @@ import javax.swing.text.html.CSS.Value; class CSSBorder extends AbstractBorder { /** Indices for the attribute groups. */ - final static int COLOR = 0, STYLE = 1, WIDTH = 2; + static final int COLOR = 0, STYLE = 1, WIDTH = 2; /** Indices for the box sides within the attribute group. */ - final static int TOP = 0, RIGHT = 1, BOTTOM = 2, LEFT = 3; + static final int TOP = 0, RIGHT = 1, BOTTOM = 2, LEFT = 3; /** The attribute groups. */ - final static Attribute[][] ATTRIBUTES = { + static final Attribute[][] ATTRIBUTES = { { Attribute.BORDER_TOP_COLOR, Attribute.BORDER_RIGHT_COLOR, Attribute.BORDER_BOTTOM_COLOR, Attribute.BORDER_LEFT_COLOR, }, { Attribute.BORDER_TOP_STYLE, Attribute.BORDER_RIGHT_STYLE, @@ -70,12 +70,12 @@ class CSSBorder extends AbstractBorder { }; /** Parsers for the border properties. */ - final static CssValue PARSERS[] = { + static final CssValue PARSERS[] = { new ColorValue(), new BorderStyle(), new BorderWidthValue(null, 0), }; /** Default values for the border properties. */ - final static Object[] DEFAULTS = { + static final Object[] DEFAULTS = { Attribute.BORDER_COLOR, // marker: value will be computed on request PARSERS[1].parseCssValue(Attribute.BORDER_STYLE.getDefaultValue()), PARSERS[2].parseCssValue(Attribute.BORDER_WIDTH.getDefaultValue()), diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/FormView.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/FormView.java index ccc9aef6fda..3ca0dd18e0d 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/FormView.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/FormView.java @@ -129,7 +129,7 @@ public class FormView extends ComponentView implements ActionListener { * Document attribute name for storing POST data. JEditorPane.getPostData() * uses the same name, should be kept in sync. */ - final static String PostDataProperty = "javax.swing.JEditorPane.postdata"; + static final String PostDataProperty = "javax.swing.JEditorPane.postdata"; /** * Used to indicate if the maximum span should be the same as the diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java index ec3fe0f5c15..d61d1f8de5b 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java @@ -1885,7 +1885,7 @@ public class HTMLDocument extends DefaultStyledDocument { * its use should be performed under the protection of * Document.render. */ - public static abstract class Iterator { + public abstract static class Iterator { /** * Return the attributes for this tag. diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java index 91a8c4981ff..78157460653 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java @@ -987,7 +987,7 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible { * providing a different parser while reusing some of the * implementation provided by this editor kit. */ - public static abstract class Parser { + public abstract static class Parser { /** * Parse the given stream and drive the given callback * with the results of the parse. This method should @@ -1564,7 +1564,7 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible { * methods may have inconsistent behavior, or return the wrong thing. */ @SuppressWarnings("serial") // Superclass is not serializable across versions - public static abstract class HTMLTextAction extends StyledTextAction { + public abstract static class HTMLTextAction extends StyledTextAction { /** * Creates a new HTMLTextAction from a string action name. @@ -2009,7 +2009,7 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible { /* * Returns the object in an AttributeSet matching a key */ - static private Object getAttrValue(AttributeSet attr, HTML.Attribute key) { + private static Object getAttrValue(AttributeSet attr, HTML.Attribute key) { Enumeration names = attr.getAttributeNames(); while (names.hasMoreElements()) { Object nextKey = names.nextElement(); diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/Map.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/Map.java index c40e237aaf3..cc79b5aeb3b 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/Map.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/Map.java @@ -180,7 +180,7 @@ class Map implements Serializable { * % the returned value with be negative. If a parse error results * from trying to parse one of the numbers null is returned. */ - static protected int[] extractCoords(Object stringCoords) { + protected static int[] extractCoords(Object stringCoords) { if (stringCoords == null || !(stringCoords instanceof String)) { return null; } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java index 52007ba4a8e..07e18dc8765 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java @@ -3196,7 +3196,7 @@ public class StyleSheet extends StyleContext { // ---- Variables --------------------------------------------- - final static int DEFAULT_FONT_SIZE = 3; + static final int DEFAULT_FONT_SIZE = 3; private CSS css; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/TableView.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/TableView.java index 6632b2ea318..ef9cb1db858 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/TableView.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/TableView.java @@ -996,7 +996,7 @@ import javax.swing.text.*; boolean skipComments = false; boolean gridValid; - static final private BitSet EMPTY = new BitSet(); + private static final BitSet EMPTY = new BitSet(); class ColumnIterator implements CSS.LayoutIterator { diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFAttributes.java b/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFAttributes.java index 8b3c74c0a09..99f2822cdcc 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFAttributes.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFAttributes.java @@ -145,7 +145,7 @@ class RTFAttributes /************************************************************************/ /************************************************************************/ - static abstract class GenericAttribute + abstract static class GenericAttribute { int domain; Object swingName; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java b/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java index 4069bad5142..0a67b87b674 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java @@ -76,14 +76,14 @@ class RTFGenerator extends Object /** The default color, used for text without an explicit color * attribute. */ - static public final Color defaultRTFColor = Color.black; + public static final Color defaultRTFColor = Color.black; - static public final float defaultFontSize = 12f; + public static final float defaultFontSize = 12f; - static public final String defaultFontFamily = "Helvetica"; + public static final String defaultFontFamily = "Helvetica"; /* constants so we can avoid allocating objects in inner loops */ - final static private Object MagicToken; + private static final Object MagicToken; /* An array of character-keyword pairs. This could be done as a dictionary (and lookup would be quicker), but that @@ -91,7 +91,7 @@ class RTFGenerator extends Object written (slow!). */ static class CharacterKeywordPair { public char character; public String keyword; } - static protected CharacterKeywordPair[] textKeywords; + protected static CharacterKeywordPair[] textKeywords; static { MagicToken = new Object(); @@ -112,7 +112,7 @@ class RTFGenerator extends Object static final char[] hexdigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; -static public void writeDocument(Document d, OutputStream to) +public static void writeDocument(Document d, OutputStream to) throws IOException { RTFGenerator gen = new RTFGenerator(to); @@ -238,7 +238,7 @@ private Integer findStyleNumber(AttributeSet a, String domain) return null; } -static private Object attrDiff(MutableAttributeSet oldAttrs, +private static Object attrDiff(MutableAttributeSet oldAttrs, AttributeSet newAttrs, Object key, Object dfl) @@ -265,7 +265,7 @@ static private Object attrDiff(MutableAttributeSet oldAttrs, return null; } -static private boolean equalArraysOK(Object a, Object b) +private static boolean equalArraysOK(Object a, Object b) { Object[] aa, bb; if (a == b) @@ -987,7 +987,7 @@ static int[] outputConversionForName(String name) * corresponding byte value (as an int, since bytes are signed). */ /* Not very efficient. TODO. */ -static protected int convertCharacter(int[] conversion, char ch) +protected static int convertCharacter(int[] conversion, char ch) { int index; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java b/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java index 619db880609..703263b8971 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java @@ -86,7 +86,7 @@ class RTFReader extends RTFParser * Unicode character. */ int skippingCharacters; - static private Dictionary straightforwardAttributes; + private static Dictionary straightforwardAttributes; static { straightforwardAttributes = RTFAttributes.attributesByKeyword(); } @@ -1066,7 +1066,7 @@ abstract class AttributeTrackingDestination implements Destination parserState.put("sec", sectionAttributes); } - abstract public void handleText(String text); + public abstract void handleText(String text); public void handleBinaryBlob(byte[] data) { diff --git a/jdk/src/java.desktop/share/classes/javax/swing/tree/AbstractLayoutCache.java b/jdk/src/java.desktop/share/classes/javax/swing/tree/AbstractLayoutCache.java index 280942cbd6b..3d0f4ef9d1f 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/tree/AbstractLayoutCache.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/tree/AbstractLayoutCache.java @@ -513,7 +513,7 @@ public abstract class AbstractLayoutCache implements RowMapper { * Used by AbstractLayoutCache to determine the size * and x origin of a particular node. */ - static public abstract class NodeDimensions { + public abstract static class NodeDimensions { /** * Returns, by reference in bounds, the size and x origin to * place value at. The calling method is responsible for determining diff --git a/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultMutableTreeNode.java b/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultMutableTreeNode.java index 83aa19839f8..dca39cf5155 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultMutableTreeNode.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultMutableTreeNode.java @@ -95,7 +95,7 @@ public class DefaultMutableTreeNode implements Cloneable, * An enumeration that is always empty. This is used when an enumeration * of a leaf node's children is requested. */ - static public final Enumeration EMPTY_ENUMERATION + public static final Enumeration EMPTY_ENUMERATION = Collections.emptyEnumeration(); /** this node's parent, or null if this node has no parent */ @@ -105,7 +105,7 @@ public class DefaultMutableTreeNode implements Cloneable, protected Vector children; /** optional user object */ - transient protected Object userObject; + protected transient Object userObject; /** true if the node is able to have children */ protected boolean allowsChildren; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellEditor.java b/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellEditor.java index fdd8e5c1cc5..0fe4e7eb1cd 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellEditor.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellEditor.java @@ -72,7 +72,7 @@ public class DefaultTreeCellEditor implements ActionListener, TreeCellEditor, * Component used in editing, obtained from the * editingContainer. */ - transient protected Component editingComponent; + protected transient Component editingComponent; /** * As of Java 2 platform v1.4 this field should no longer be used. If diff --git a/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java b/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java index c8784e93c43..c7cdfc366ea 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java @@ -131,13 +131,13 @@ public class DefaultTreeCellRenderer extends JLabel implements TreeCellRenderer // Icons /** Icon used to show non-leaf nodes that aren't expanded. */ - transient protected Icon closedIcon; + protected transient Icon closedIcon; /** Icon used to show leaf nodes. */ - transient protected Icon leafIcon; + protected transient Icon leafIcon; /** Icon used to show non-leaf nodes that are expanded. */ - transient protected Icon openIcon; + protected transient Icon openIcon; // Colors /** Color to use for the foreground for selected nodes. */ diff --git a/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java b/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java index 810262b97f4..755dd99e6c3 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java @@ -78,7 +78,7 @@ public class DefaultTreeSelectionModel implements Cloneable, Serializable, TreeS protected EventListenerList listenerList = new EventListenerList(); /** Provides a row for a given path. */ - transient protected RowMapper rowMapper; + protected transient RowMapper rowMapper; /** Handles maintaining the list selection model. The RowMapper is used * to map from a TreePath to a row, and the value is then placed here. */ diff --git a/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java b/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java index f2b0434090d..fcefccd9893 100644 --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java @@ -72,23 +72,23 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { protected AppletClassLoader loader; /* applet event ids */ - public final static int APPLET_DISPOSE = 0; - public final static int APPLET_LOAD = 1; - public final static int APPLET_INIT = 2; - public final static int APPLET_START = 3; - public final static int APPLET_STOP = 4; - public final static int APPLET_DESTROY = 5; - public final static int APPLET_QUIT = 6; - public final static int APPLET_ERROR = 7; + public static final int APPLET_DISPOSE = 0; + public static final int APPLET_LOAD = 1; + public static final int APPLET_INIT = 2; + public static final int APPLET_START = 3; + public static final int APPLET_STOP = 4; + public static final int APPLET_DESTROY = 5; + public static final int APPLET_QUIT = 6; + public static final int APPLET_ERROR = 7; /* send to the parent to force relayout */ - public final static int APPLET_RESIZE = 51234; + public static final int APPLET_RESIZE = 51234; /* sent to a (distant) parent to indicate that the applet is being * loaded or as completed loading */ - public final static int APPLET_LOADING = 51235; - public final static int APPLET_LOADING_COMPLETED = 51236; + public static final int APPLET_LOADING = 51235; + public static final int APPLET_LOADING_COMPLETED = 51236; /** * The current status. One of: @@ -132,14 +132,14 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { boolean loadAbortRequest = false; /* abstract classes */ - abstract protected String getCode(); - abstract protected String getJarFiles(); + protected abstract String getCode(); + protected abstract String getJarFiles(); @Override - abstract public int getWidth(); + public abstract int getWidth(); @Override - abstract public int getHeight(); - abstract public boolean hasInitialFocus(); + public abstract int getHeight(); + public abstract boolean hasInitialFocus(); private static int threadGroupNumber = 0; @@ -250,11 +250,11 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { private Queue queue = null; - synchronized public void addAppletListener(AppletListener l) { + public synchronized void addAppletListener(AppletListener l) { listeners = AppletEventMulticaster.add(listeners, l); } - synchronized public void removeAppletListener(AppletListener l) { + public synchronized void removeAppletListener(AppletListener l) { listeners = AppletEventMulticaster.remove(listeners, l); } diff --git a/jdk/src/java.desktop/share/classes/sun/applet/AppletViewer.java b/jdk/src/java.desktop/share/classes/sun/applet/AppletViewer.java index 7a0a8752608..b310b277f93 100644 --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletViewer.java +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletViewer.java @@ -1081,7 +1081,7 @@ public class AppletViewer extends Frame implements AppletContext, Printable { static String encoding = null; - static private Reader makeReader(InputStream is) { + private static Reader makeReader(InputStream is) { if (encoding != null) { try { return new BufferedReader(new InputStreamReader(is, encoding)); diff --git a/jdk/src/java.desktop/share/classes/sun/awt/AppContext.java b/jdk/src/java.desktop/share/classes/sun/awt/AppContext.java index c6e0b02b834..e1109ed45df 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/AppContext.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/AppContext.java @@ -148,8 +148,8 @@ public final class AppContext { /* * The keys to store EventQueue push/pop lock and condition. */ - public final static Object EVENT_QUEUE_LOCK_KEY = new StringBuilder("EventQueue.Lock"); - public final static Object EVENT_QUEUE_COND_KEY = new StringBuilder("EventQueue.Condition"); + public static final Object EVENT_QUEUE_LOCK_KEY = new StringBuilder("EventQueue.Lock"); + public static final Object EVENT_QUEUE_COND_KEY = new StringBuilder("EventQueue.Condition"); /* A map of AppContexts, referenced by ThreadGroup. */ @@ -172,7 +172,7 @@ public final class AppContext { private static volatile AppContext mainAppContext = null; private static class GetAppContextLock {}; - private final static Object getAppContextLock = new GetAppContextLock(); + private static final Object getAppContextLock = new GetAppContextLock(); /* * The hash map associated with this AppContext. A private delegate diff --git a/jdk/src/java.desktop/share/classes/sun/awt/DebugSettings.java b/jdk/src/java.desktop/share/classes/sun/awt/DebugSettings.java index 6ed7478c20f..bd75e206d59 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/DebugSettings.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/DebugSettings.java @@ -252,9 +252,9 @@ public final class DebugSettings { private static final String PROP_CTRACE = "ctrace"; private static final int PROP_CTRACE_LEN = PROP_CTRACE.length(); - private native synchronized void setCTracingOn(boolean enabled); - private native synchronized void setCTracingOn(boolean enabled, String file); - private native synchronized void setCTracingOn(boolean enabled, String file, int line); + private synchronized native void setCTracingOn(boolean enabled); + private synchronized native void setCTracingOn(boolean enabled, String file); + private synchronized native void setCTracingOn(boolean enabled, String file, int line); private void loadNativeSettings() { boolean ctracingOn; diff --git a/jdk/src/java.desktop/share/classes/sun/awt/ExtendedKeyCodes.java b/jdk/src/java.desktop/share/classes/sun/awt/ExtendedKeyCodes.java index fc004ba2a28..1e054b9de81 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/ExtendedKeyCodes.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/ExtendedKeyCodes.java @@ -12,16 +12,16 @@ public class ExtendedKeyCodes { * or higher. */ // Keycodes declared in KeyEvent.java with corresponding Unicode values. - private final static HashMap regularKeyCodesMap = + private static final HashMap regularKeyCodesMap = new HashMap(98, 1.0f); // Keycodes derived from Unicode values. Here should be collected codes // for characters appearing on the primary layer of at least one // known keyboard layout. For instance, sterling sign is on the primary layer // of the Mac Italian layout. - private final static HashSet extendedKeyCodesSet = + private static final HashSet extendedKeyCodesSet = new HashSet(501, 1.0f); - final public static int getExtendedKeyCodeForChar( int c ) { + public static final int getExtendedKeyCodeForChar( int c ) { int uc = Character.toUpperCase( c ); int lc = Character.toLowerCase( c ); if (regularKeyCodesMap.containsKey( c )) { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/OSInfo.java b/jdk/src/java.desktop/share/classes/sun/awt/OSInfo.java index 4a515a1734c..57226bef8ca 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/OSInfo.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/OSInfo.java @@ -60,7 +60,7 @@ public class OSInfo { private static final String OS_NAME = "os.name"; private static final String OS_VERSION = "os.version"; - private final static Map windowsVersionMap = new HashMap(); + private static final Map windowsVersionMap = new HashMap(); static { windowsVersionMap.put(WINDOWS_95.toString(), WINDOWS_95); diff --git a/jdk/src/java.desktop/share/classes/sun/awt/SunHints.java b/jdk/src/java.desktop/share/classes/sun/awt/SunHints.java index b82e0564457..560b822de1a 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/SunHints.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/SunHints.java @@ -102,7 +102,7 @@ public class SunHints { private static Value[][] ValueObjects = new Value[NUM_KEYS][VALS_PER_KEY]; - private synchronized static void register(SunHints.Key key, + private static synchronized void register(SunHints.Key key, Value value) { int kindex = key.getIndex(); int vindex = value.getIndex(); diff --git a/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java b/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java index 61df2fa0909..96a475e1c68 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java @@ -113,7 +113,7 @@ public abstract class SunToolkit extends Toolkit * the 4-bytes limit for the int type. (CR 6799099) * One more bit is reserved for FIRST_HIGH_BIT. */ - public final static int MAX_BUTTONS_SUPPORTED = 20; + public static final int MAX_BUTTONS_SUPPORTED = 20; /** * Creates and initializes EventQueue instance for the specified @@ -1820,7 +1820,7 @@ public abstract class SunToolkit extends Toolkit * Returns the value of "sun.awt.disableMixing" property. Default * value is {@code false}. */ - public synchronized static boolean getSunAwtDisableMixing() { + public static synchronized boolean getSunAwtDisableMixing() { if (sunAwtDisableMixing == null) { sunAwtDisableMixing = AccessController.doPrivileged( new GetBooleanAction("sun.awt.disableMixing")); diff --git a/jdk/src/java.desktop/share/classes/sun/awt/UngrabEvent.java b/jdk/src/java.desktop/share/classes/sun/awt/UngrabEvent.java index ed126eee7bb..c9d97b8ed95 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/UngrabEvent.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/UngrabEvent.java @@ -42,7 +42,7 @@ import java.awt.Component; @SuppressWarnings("serial") public class UngrabEvent extends AWTEvent { - private final static int UNGRAB_EVENT_ID = 1998; + private static final int UNGRAB_EVENT_ID = 1998; public UngrabEvent(Component source) { super(source, UNGRAB_EVENT_ID); diff --git a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java index 9808a3af3be..1714fea6113 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java @@ -1080,14 +1080,14 @@ search: return new File(filePath); } - private final static String[] DEPLOYMENT_CACHE_PROPERTIES = { + private static final String[] DEPLOYMENT_CACHE_PROPERTIES = { "deployment.system.cachedir", "deployment.user.cachedir", "deployment.javaws.cachedir", "deployment.javapi.cachedir" }; - private final static ArrayList deploymentCacheDirectoryList = new ArrayList<>(); + private static final ArrayList deploymentCacheDirectoryList = new ArrayList<>(); private static boolean isFileInWebstartedCache(File f) { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java b/jdk/src/java.desktop/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java index 46b4333ff33..d0e5c577b78 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java @@ -81,12 +81,12 @@ public abstract class SunDragSourceContextPeer implements DragSourceContextPeer * dispatch constants */ - protected final static int DISPATCH_ENTER = 1; - protected final static int DISPATCH_MOTION = 2; - protected final static int DISPATCH_CHANGED = 3; - protected final static int DISPATCH_EXIT = 4; - protected final static int DISPATCH_FINISH = 5; - protected final static int DISPATCH_MOUSE_MOVED = 6; + protected static final int DISPATCH_ENTER = 1; + protected static final int DISPATCH_MOTION = 2; + protected static final int DISPATCH_CHANGED = 3; + protected static final int DISPATCH_EXIT = 4; + protected static final int DISPATCH_FINISH = 5; + protected static final int DISPATCH_MOUSE_MOVED = 6; /** * construct a new SunDragSourceContextPeer diff --git a/jdk/src/java.desktop/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java b/jdk/src/java.desktop/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java index 5a89f09c233..7f18fdae537 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java @@ -137,10 +137,10 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer, * constants used by dropAccept() or dropReject() */ - protected final static int STATUS_NONE = 0; // none pending - protected final static int STATUS_WAIT = 1; // drop pending - protected final static int STATUS_ACCEPT = 2; - protected final static int STATUS_REJECT = -1; + protected static final int STATUS_NONE = 0; // none pending + protected static final int STATUS_WAIT = 1; // drop pending + protected static final int STATUS_ACCEPT = 2; + protected static final int STATUS_REJECT = -1; /** * create the peer diff --git a/jdk/src/java.desktop/share/classes/sun/awt/geom/AreaOp.java b/jdk/src/java.desktop/share/classes/sun/awt/geom/AreaOp.java index bdbf2cb2b7e..785ffb2331c 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/geom/AreaOp.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/geom/AreaOp.java @@ -31,7 +31,7 @@ import java.util.Comparator; import java.util.Arrays; public abstract class AreaOp { - public static abstract class CAGOp extends AreaOp { + public abstract static class CAGOp extends AreaOp { boolean inLeft; boolean inRight; boolean inResult; diff --git a/jdk/src/java.desktop/share/classes/sun/awt/geom/Crossings.java b/jdk/src/java.desktop/share/classes/sun/awt/geom/Crossings.java index 0b4b8d8025f..ae330cddedf 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/geom/Crossings.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/geom/Crossings.java @@ -307,7 +307,7 @@ public abstract class Crossings { return false; } - public final static class EvenOdd extends Crossings { + public static final class EvenOdd extends Crossings { public EvenOdd(double xlo, double ylo, double xhi, double yhi) { super(xlo, ylo, xhi, yhi); } @@ -390,7 +390,7 @@ public abstract class Crossings { } } - public final static class NonZero extends Crossings { + public static final class NonZero extends Crossings { private int crosscounts[]; public NonZero(double xlo, double ylo, double xhi, double yhi) { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/im/CompositionArea.java b/jdk/src/java.desktop/share/classes/sun/awt/im/CompositionArea.java index f53713ea7b2..d15de28044b 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/im/CompositionArea.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/im/CompositionArea.java @@ -64,11 +64,11 @@ public final class CompositionArea extends JPanel implements InputMethodListener private TextLayout composedTextLayout; private TextHitInfo caret = null; private JFrame compositionWindow; - private final static int TEXT_ORIGIN_X = 5; - private final static int TEXT_ORIGIN_Y = 15; - private final static int PASSIVE_WIDTH = 480; - private final static int WIDTH_MARGIN=10; - private final static int HEIGHT_MARGIN=3; + private static final int TEXT_ORIGIN_X = 5; + private static final int TEXT_ORIGIN_Y = 15; + private static final int PASSIVE_WIDTH = 480; + private static final int WIDTH_MARGIN=10; + private static final int HEIGHT_MARGIN=3; CompositionArea() { // create composition window with localized title diff --git a/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodContext.java b/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodContext.java index fad9a6bae6d..63cbccbb6ad 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodContext.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodContext.java @@ -66,7 +66,7 @@ public class InputMethodContext private CompositionAreaHandler compositionAreaHandler; private Object compositionAreaHandlerLock = new Object(); - static private boolean belowTheSpotInputRequested; + private static boolean belowTheSpotInputRequested; private boolean inputMethodSupportsBelowTheSpot; static { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/ByteComponentRaster.java b/jdk/src/java.desktop/share/classes/sun/awt/image/ByteComponentRaster.java index 2ac4d180152..673e51d8518 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/image/ByteComponentRaster.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/image/ByteComponentRaster.java @@ -76,7 +76,7 @@ public class ByteComponentRaster extends SunWritableRaster { /** A cached copy of minY + height for use in bounds checks. */ private int maxY; - static private native void initIDs(); + private static native void initIDs(); static { /* ensure that the necessary native libraries are loaded */ NativeLibLoader.loadLibraries(); diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/BytePackedRaster.java b/jdk/src/java.desktop/share/classes/sun/awt/image/BytePackedRaster.java index ef78c83d2ce..f9696c17eb8 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/image/BytePackedRaster.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/image/BytePackedRaster.java @@ -73,7 +73,7 @@ public class BytePackedRaster extends SunWritableRaster { /** A cached copy of minY + height for use in bounds checks. */ private int maxY; - static private native void initIDs(); + private static native void initIDs(); static { /* ensure that the necessary native libraries are loaded */ NativeLibLoader.loadLibraries(); diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/ImageCache.java b/jdk/src/java.desktop/share/classes/sun/awt/image/ImageCache.java index c7088bacf52..cd22ccb7b15 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/image/ImageCache.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/image/ImageCache.java @@ -40,7 +40,7 @@ import sun.awt.AppContext; * The ImageCache must be used from the thread with an AppContext only. * */ -final public class ImageCache { +public final class ImageCache { // Ordered Map keyed by args hash, ordered by most recent accessed entry. private final LinkedHashMap map diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/ImageRepresentation.java b/jdk/src/java.desktop/share/classes/sun/awt/image/ImageRepresentation.java index 90bb2ac6388..3634fac5e3c 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/image/ImageRepresentation.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/image/ImageRepresentation.java @@ -75,7 +75,7 @@ public class ImageRepresentation extends ImageWatched implements ImageConsumer boolean isDefaultBI = false; boolean isSameCM = false; - private native static void initIDs(); + private static native void initIDs(); static { /* ensure that the necessary native libraries are loaded */ diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/ImagingLib.java b/jdk/src/java.desktop/share/classes/sun/awt/image/ImagingLib.java index 683b8fe7e75..55bd33305e4 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/image/ImagingLib.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/image/ImagingLib.java @@ -73,18 +73,18 @@ public class ImagingLib { */ private static native boolean init(); - static public native int transformBI(BufferedImage src, BufferedImage dst, + public static native int transformBI(BufferedImage src, BufferedImage dst, double[] matrix, int interpType); - static public native int transformRaster(Raster src, Raster dst, + public static native int transformRaster(Raster src, Raster dst, double[] matrix, int interpType); - static public native int convolveBI(BufferedImage src, BufferedImage dst, + public static native int convolveBI(BufferedImage src, BufferedImage dst, Kernel kernel, int edgeHint); - static public native int convolveRaster(Raster src, Raster dst, + public static native int convolveRaster(Raster src, Raster dst, Kernel kernel, int edgeHint); - static public native int lookupByteBI(BufferedImage src, BufferedImage dst, + public static native int lookupByteBI(BufferedImage src, BufferedImage dst, byte[][] table); - static public native int lookupByteRaster(Raster src, Raster dst, + public static native int lookupByteRaster(Raster src, Raster dst, byte[][] table); static { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/IntegerComponentRaster.java b/jdk/src/java.desktop/share/classes/sun/awt/image/IntegerComponentRaster.java index a420f95f003..cd84986b77f 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/image/IntegerComponentRaster.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/image/IntegerComponentRaster.java @@ -91,7 +91,7 @@ public class IntegerComponentRaster extends SunWritableRaster { /** A cached copy of minY + height for use in bounds checks. */ private int maxY; - static private native void initIDs(); + private static native void initIDs(); static { /* ensure that the necessary native libraries are loaded */ NativeLibLoader.loadLibraries(); diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/PNGImageDecoder.java b/jdk/src/java.desktop/share/classes/sun/awt/image/PNGImageDecoder.java index 7f78de6e982..0627f91fca3 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/image/PNGImageDecoder.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/image/PNGImageDecoder.java @@ -650,13 +650,13 @@ public class PNGImageDecoder extends ImageDecoder } /* code changed to make it work with ImageDecoder architecture static int ThreadLimit = 10; - private synchronized static void waitTurn() { + private static synchronized void waitTurn() { try { while(ThreadLimit<=0) PNGImageDecoder.class.wait(1000); } catch(InterruptedException e){} ThreadLimit--; } - private synchronized static void endTurn() { + private static synchronized void endTurn() { if(ThreadLimit<=0) PNGImageDecoder.class.notify(); ThreadLimit++; } @@ -771,7 +771,7 @@ public class PNGImageDecoder extends ImageDecoder is the 1's complement of the final running CRC (see the crc() routine below)). */ - static private int update_crc(int crc, byte[] buf, int offset, int len) { + private static int update_crc(int crc, byte[] buf, int offset, int len) { int c = crc; while (--len>=0) c = crc_table[(c ^ buf[offset++]) & 0xff] ^ (c >>> 8); @@ -779,7 +779,7 @@ public class PNGImageDecoder extends ImageDecoder } /* Return the CRC of the bytes buf[0..len-1]. */ - static private int crc(byte[] buf, int offset, int len) { + private static int crc(byte[] buf, int offset, int len) { return update_crc(0xffffffff, buf, offset, len) ^ 0xffffffff; } public static class Chromaticities { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/ShortComponentRaster.java b/jdk/src/java.desktop/share/classes/sun/awt/image/ShortComponentRaster.java index aa1c56a064d..76ab7d75ce4 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/image/ShortComponentRaster.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/image/ShortComponentRaster.java @@ -76,7 +76,7 @@ public class ShortComponentRaster extends SunWritableRaster { /** A cached copy of minY + height for use in bounds checks. */ private int maxY; - static private native void initIDs(); + private static native void initIDs(); static { /* ensure that the necessary native libraries are loaded */ NativeLibLoader.loadLibraries(); diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/SurfaceManager.java b/jdk/src/java.desktop/share/classes/sun/awt/image/SurfaceManager.java index 887ad5ae28d..1b2db0f867f 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/image/SurfaceManager.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/image/SurfaceManager.java @@ -51,7 +51,7 @@ import sun.java2d.loops.CompositeType; */ public abstract class SurfaceManager { - public static abstract class ImageAccessor { + public abstract static class ImageAccessor { public abstract SurfaceManager getSurfaceManager(Image img); public abstract void setSurfaceManager(Image img, SurfaceManager mgr); } diff --git a/jdk/src/java.desktop/share/classes/sun/dc/DuctusRenderingEngine.java b/jdk/src/java.desktop/share/classes/sun/dc/DuctusRenderingEngine.java index 6cba2eb3571..0355813d92d 100644 --- a/jdk/src/java.desktop/share/classes/sun/dc/DuctusRenderingEngine.java +++ b/jdk/src/java.desktop/share/classes/sun/dc/DuctusRenderingEngine.java @@ -359,7 +359,7 @@ public class DuctusRenderingEngine extends RenderingEngine { private static Rasterizer theRasterizer; - public synchronized static Rasterizer getRasterizer() { + public static synchronized Rasterizer getRasterizer() { Rasterizer r = theRasterizer; if (r == null) { r = new Rasterizer(); @@ -369,7 +369,7 @@ public class DuctusRenderingEngine extends RenderingEngine { return r; } - public synchronized static void dropRasterizer(Rasterizer r) { + public static synchronized void dropRasterizer(Rasterizer r) { r.reset(); theRasterizer = r; } diff --git a/jdk/src/java.desktop/share/classes/sun/font/Type1Font.java b/jdk/src/java.desktop/share/classes/sun/font/Type1Font.java index 68bc7eaaeb9..39a1c08d0e0 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/Type1Font.java +++ b/jdk/src/java.desktop/share/classes/sun/font/Type1Font.java @@ -102,8 +102,8 @@ public class Type1Font extends FileFont { private String psName = null; - static private HashMap styleAbbreviationsMapping; - static private HashSet styleNameTokes; + private static HashMap styleAbbreviationsMapping; + private static HashSet styleNameTokes; static { styleAbbreviationsMapping = new HashMap<>(); diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/NullSurfaceData.java b/jdk/src/java.desktop/share/classes/sun/java2d/NullSurfaceData.java index c085da0d537..6b93d81afb6 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/NullSurfaceData.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/NullSurfaceData.java @@ -63,7 +63,7 @@ public class NullSurfaceData extends SurfaceData { return this; } - private final static NullPipe nullpipe = new NullPipe(); + private static final NullPipe nullpipe = new NullPipe(); public void validatePipe(SunGraphics2D sg2d) { sg2d.drawpipe = nullpipe; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/StateTrackableDelegate.java b/jdk/src/java.desktop/share/classes/sun/java2d/StateTrackableDelegate.java index 692f3761dc4..25231aa8f4f 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/StateTrackableDelegate.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/StateTrackableDelegate.java @@ -44,7 +44,7 @@ public final class StateTrackableDelegate implements StateTrackable { * of the StateTrackable interface that is permanently in the * {@link State#UNTRACKABLE UNTRACKABLE} state. */ - public final static StateTrackableDelegate UNTRACKABLE_DELEGATE = + public static final StateTrackableDelegate UNTRACKABLE_DELEGATE = new StateTrackableDelegate(UNTRACKABLE); /** @@ -52,7 +52,7 @@ public final class StateTrackableDelegate implements StateTrackable { * of the StateTrackable interface that is permanently in the * {@link State#IMMUTABLE IMMUTABLE} state. */ - public final static StateTrackableDelegate IMMUTABLE_DELEGATE = + public static final StateTrackableDelegate IMMUTABLE_DELEGATE = new StateTrackableDelegate(IMMUTABLE); /** diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java index 36955e280e5..7ed0e3a7033 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java @@ -252,7 +252,7 @@ public final class SunGraphics2D private FontInfo glyphVectorFontInfo; private FontRenderContext glyphVectorFRC; - private final static int slowTextTransformMask = + private static final int slowTextTransformMask = AffineTransform.TYPE_GENERAL_TRANSFORM | AffineTransform.TYPE_MASK_ROTATION | AffineTransform.TYPE_FLIP; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/SurfaceManagerFactory.java b/jdk/src/java.desktop/share/classes/sun/java2d/SurfaceManagerFactory.java index 80c63a3fc7c..39b6d2e33cf 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/SurfaceManagerFactory.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/SurfaceManagerFactory.java @@ -50,7 +50,7 @@ public abstract class SurfaceManagerFactory { * * @return the surface manager factory */ - public synchronized static SurfaceManagerFactory getInstance() { + public static synchronized SurfaceManagerFactory getInstance() { if (instance == null) { throw new IllegalStateException("No SurfaceManagerFactory set."); @@ -65,7 +65,7 @@ public abstract class SurfaceManagerFactory { * * @param factory the factory to set */ - public synchronized static void setInstance(SurfaceManagerFactory factory) { + public static synchronized void setInstance(SurfaceManagerFactory factory) { if (factory == null) { // We don't want to allow setting this to null at any time. diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMS.java b/jdk/src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMS.java index 2a554db1f3f..a9e6adbbed9 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMS.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMS.java @@ -136,7 +136,7 @@ public class LCMS implements PCMM { private native void setTagDataNative(long ptr, int tagSignature, byte[] data); - public synchronized static native LCMSProfile getProfileID(ICC_Profile profile); + public static synchronized native LCMSProfile getProfileID(ICC_Profile profile); /* Helper method used from LCMSColorTransfrom */ static long createTransform( diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/CompositeType.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/CompositeType.java index 5eeaf85f7ea..a8227cdb739 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/CompositeType.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/CompositeType.java @@ -242,7 +242,7 @@ public final class CompositeType { this.uniqueID = makeUniqueID(desc); } - public synchronized static int makeUniqueID(String desc) { + public static synchronized int makeUniqueID(String desc) { Integer i = compositeUIDMap.get(desc); if (i == null) { diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphList.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphList.java index 09284087fc6..47490290a01 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphList.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphList.java @@ -39,9 +39,9 @@ import sun.font.GlyphList; */ public class DrawGlyphList extends GraphicsPrimitive { - public final static String methodSignature = "DrawGlyphList(...)".toString(); + public static final String methodSignature = "DrawGlyphList(...)".toString(); - public final static int primTypeID = makePrimTypeID(); + public static final int primTypeID = makePrimTypeID(); public static DrawGlyphList locate(SurfaceType srctype, CompositeType comptype, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListAA.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListAA.java index 83aee554241..bd3dc8b08ce 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListAA.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListAA.java @@ -39,9 +39,9 @@ import sun.font.GlyphList; */ public class DrawGlyphListAA extends GraphicsPrimitive { - public final static String methodSignature = "DrawGlyphListAA(...)".toString(); + public static final String methodSignature = "DrawGlyphListAA(...)".toString(); - public final static int primTypeID = makePrimTypeID(); + public static final int primTypeID = makePrimTypeID(); public static DrawGlyphListAA locate(SurfaceType srctype, CompositeType comptype, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListLCD.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListLCD.java index 892dc64f7c5..41722876ee8 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListLCD.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListLCD.java @@ -39,10 +39,10 @@ import sun.font.GlyphList; */ public class DrawGlyphListLCD extends GraphicsPrimitive { - public final static String + public static final String methodSignature = "DrawGlyphListLCD(...)".toString(); - public final static int primTypeID = makePrimTypeID(); + public static final int primTypeID = makePrimTypeID(); public static DrawGlyphListLCD locate(SurfaceType srctype, CompositeType comptype, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawLine.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawLine.java index 6abd9c13f12..2d5e1de7d84 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawLine.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawLine.java @@ -44,9 +44,9 @@ import sun.java2d.SurfaceData; */ public class DrawLine extends GraphicsPrimitive { - public final static String methodSignature = "DrawLine(...)".toString(); + public static final String methodSignature = "DrawLine(...)".toString(); - public final static int primTypeID = makePrimTypeID(); + public static final int primTypeID = makePrimTypeID(); public static DrawLine locate(SurfaceType srctype, CompositeType comptype, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawParallelogram.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawParallelogram.java index a936d49f3d7..6d16e067943 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawParallelogram.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawParallelogram.java @@ -42,10 +42,10 @@ import sun.java2d.SurfaceData; */ public class DrawParallelogram extends GraphicsPrimitive { - public final static String methodSignature = + public static final String methodSignature = "DrawParallelogram(...)".toString(); - public final static int primTypeID = makePrimTypeID(); + public static final int primTypeID = makePrimTypeID(); public static DrawParallelogram locate(SurfaceType srctype, CompositeType comptype, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawPath.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawPath.java index 4da3295b818..571a01a91f8 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawPath.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawPath.java @@ -38,10 +38,10 @@ import java.awt.geom.Path2D; */ public class DrawPath extends GraphicsPrimitive { - public final static String methodSignature = + public static final String methodSignature = "DrawPath(...)".toString(); - public final static int primTypeID = makePrimTypeID(); + public static final int primTypeID = makePrimTypeID(); public static DrawPath locate(SurfaceType srctype, CompositeType comptype, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawPolygons.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawPolygons.java index eecb6337f36..518aeaca44a 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawPolygons.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawPolygons.java @@ -41,9 +41,9 @@ import sun.java2d.SurfaceData; */ public class DrawPolygons extends GraphicsPrimitive { - public final static String methodSignature = "DrawPolygons(...)".toString(); + public static final String methodSignature = "DrawPolygons(...)".toString(); - public final static int primTypeID = makePrimTypeID(); + public static final int primTypeID = makePrimTypeID(); public static DrawPolygons locate(SurfaceType srctype, CompositeType comptype, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawRect.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawRect.java index 17f588d3732..4c38e5e1882 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawRect.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/DrawRect.java @@ -44,9 +44,9 @@ import sun.java2d.SurfaceData; */ public class DrawRect extends GraphicsPrimitive { - public final static String methodSignature = "DrawRect(...)".toString(); + public static final String methodSignature = "DrawRect(...)".toString(); - public final static int primTypeID = makePrimTypeID(); + public static final int primTypeID = makePrimTypeID(); public static DrawRect locate(SurfaceType srctype, CompositeType comptype, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillParallelogram.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillParallelogram.java index 54138340162..b895c0b8737 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillParallelogram.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillParallelogram.java @@ -40,10 +40,10 @@ import sun.java2d.SurfaceData; */ public class FillParallelogram extends GraphicsPrimitive { - public final static String methodSignature = + public static final String methodSignature = "FillParallelogram(...)".toString(); - public final static int primTypeID = makePrimTypeID(); + public static final int primTypeID = makePrimTypeID(); public static FillParallelogram locate(SurfaceType srctype, CompositeType comptype, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillPath.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillPath.java index 95a653e76a4..524240ed4d1 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillPath.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillPath.java @@ -38,10 +38,10 @@ import java.awt.geom.Path2D; */ public class FillPath extends GraphicsPrimitive { - public final static String methodSignature = + public static final String methodSignature = "FillPath(...)".toString(); - public final static int primTypeID = makePrimTypeID(); + public static final int primTypeID = makePrimTypeID(); public static FillPath locate(SurfaceType srctype, CompositeType comptype, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillRect.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillRect.java index 804e7546b84..39ed1cbbf6b 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillRect.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillRect.java @@ -44,9 +44,9 @@ import sun.java2d.SurfaceData; */ public class FillRect extends GraphicsPrimitive { - public final static String methodSignature = "FillRect(...)".toString(); + public static final String methodSignature = "FillRect(...)".toString(); - public final static int primTypeID = makePrimTypeID(); + public static final int primTypeID = makePrimTypeID(); public static FillRect locate(SurfaceType srctype, CompositeType comptype, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillSpans.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillSpans.java index 93c7b17f5e9..199d07c18ff 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillSpans.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/FillSpans.java @@ -45,9 +45,9 @@ import sun.java2d.SurfaceData; */ public class FillSpans extends GraphicsPrimitive { - public final static String methodSignature = "FillSpans(...)".toString(); + public static final String methodSignature = "FillSpans(...)".toString(); - public final static int primTypeID = makePrimTypeID(); + public static final int primTypeID = makePrimTypeID(); public static FillSpans locate(SurfaceType srctype, CompositeType comptype, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitive.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitive.java index 6db75f45f52..38bbaeb5178 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitive.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitive.java @@ -119,14 +119,14 @@ public abstract class GraphicsPrimitive { private long pNativePrim; // Native blit loop info - public synchronized static final int makePrimTypeID() { + public static final synchronized int makePrimTypeID() { if (unusedPrimID > 255) { throw new InternalError("primitive id overflow"); } return unusedPrimID++; } - public synchronized static final int makeUniqueID(int primTypeID, + public static final synchronized int makeUniqueID(int primTypeID, SurfaceType src, CompositeType cmp, SurfaceType dst) @@ -456,7 +456,7 @@ public abstract class GraphicsPrimitive { } } - public synchronized static void tracePrimitive(Object prim) { + public static synchronized void tracePrimitive(Object prim) { if ((traceflags & TRACECOUNTS) != 0) { if (traceMap == null) { traceMap = new HashMap<>(); diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitiveMgr.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitiveMgr.java index 177aa2148aa..6865c3ad1dc 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitiveMgr.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitiveMgr.java @@ -98,7 +98,7 @@ public final class GraphicsPrimitiveMgr { private GraphicsPrimitiveMgr() { } - public synchronized static void register(GraphicsPrimitive[] newPrimitives) + public static synchronized void register(GraphicsPrimitive[] newPrimitives) { GraphicsPrimitive[] devCollection = primitives; int oldSize = 0; @@ -121,7 +121,7 @@ public final class GraphicsPrimitiveMgr { primitives = temp; } - public synchronized static void registerGeneral(GraphicsPrimitive gen) { + public static synchronized void registerGeneral(GraphicsPrimitive gen) { if (generalPrimitives == null) { generalPrimitives = new GraphicsPrimitive[] {gen}; return; @@ -133,7 +133,7 @@ public final class GraphicsPrimitiveMgr { generalPrimitives = newGen; } - public synchronized static GraphicsPrimitive locate(int primTypeID, + public static synchronized GraphicsPrimitive locate(int primTypeID, SurfaceType dsttype) { return locate(primTypeID, @@ -142,7 +142,7 @@ public final class GraphicsPrimitiveMgr { dsttype); } - public synchronized static GraphicsPrimitive locate(int primTypeID, + public static synchronized GraphicsPrimitive locate(int primTypeID, SurfaceType srctype, CompositeType comptype, SurfaceType dsttype) @@ -170,7 +170,7 @@ public final class GraphicsPrimitiveMgr { return prim; } - public synchronized static GraphicsPrimitive + public static synchronized GraphicsPrimitive locatePrim(int primTypeID, SurfaceType srctype, CompositeType comptype, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/loops/ProcessPath.java b/jdk/src/java.desktop/share/classes/sun/java2d/loops/ProcessPath.java index 3ed651e5089..8ee35b2202e 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/loops/ProcessPath.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/loops/ProcessPath.java @@ -45,7 +45,7 @@ public class ProcessPath { /* Public interfaces and methods for drawing and filling general paths */ - public static abstract class DrawHandler { + public abstract static class DrawHandler { public int xMin; public int yMin; public int xMax; @@ -121,7 +121,7 @@ public class ProcessPath { public static final int PH_MODE_DRAW_CLIP = 0; public static final int PH_MODE_FILL_CLIP = 1; - public static abstract class ProcessHandler implements EndSubPathHandler { + public abstract static class ProcessHandler implements EndSubPathHandler { DrawHandler dhnd; int clipMode; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLPaints.java b/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLPaints.java index 1991d82f10b..8416a0daa6c 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLPaints.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLPaints.java @@ -151,7 +151,7 @@ abstract class OGLPaints { /****************** Shared MultipleGradientPaint support ********************/ - private static abstract class MultiGradient extends OGLPaints { + private abstract static class MultiGradient extends OGLPaints { protected MultiGradient() {} /** diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/AAShapePipe.java b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/AAShapePipe.java index 239d134fca0..dcabdbcc3ee 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/AAShapePipe.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/AAShapePipe.java @@ -127,7 +127,7 @@ public class AAShapePipe private static byte[] theTile; - private synchronized static byte[] getAlphaTile(int len) { + private static synchronized byte[] getAlphaTile(int len) { byte[] t = theTile; if (t == null || t.length < len) { t = new byte[len]; @@ -137,7 +137,7 @@ public class AAShapePipe return t; } - private synchronized static void dropAlphaTile(byte[] t) { + private static synchronized void dropAlphaTile(byte[] t) { theTile = t; } diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/LoopPipe.java b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/LoopPipe.java index 9327f45bc0d..93ba37dd96c 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/LoopPipe.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/LoopPipe.java @@ -52,7 +52,7 @@ public class LoopPipe ShapeDrawPipe, LoopBasedPipe { - final static RenderingEngine RenderEngine = RenderingEngine.getInstance(); + static final RenderingEngine RenderEngine = RenderingEngine.getInstance(); public void drawLine(SunGraphics2D sg2d, int x1, int y1, int x2, int y2) diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/SpanShapeRenderer.java b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/SpanShapeRenderer.java index 2715a28bdf6..e740373f856 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/SpanShapeRenderer.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/SpanShapeRenderer.java @@ -42,7 +42,7 @@ import sun.awt.SunHints; * perform the actual rendering. */ public abstract class SpanShapeRenderer implements ShapeDrawPipe { - final static RenderingEngine RenderEngine = RenderingEngine.getInstance(); + static final RenderingEngine RenderEngine = RenderingEngine.getInstance(); public static class Composite extends SpanShapeRenderer { CompositePipe comppipe; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Renderer.java b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Renderer.java index de7740e3356..58cbf181328 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Renderer.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Renderer.java @@ -311,12 +311,12 @@ final class Renderer implements PathConsumer2D { public static final int WIND_NON_ZERO = 1; // Antialiasing - final private int SUBPIXEL_LG_POSITIONS_X; - final private int SUBPIXEL_LG_POSITIONS_Y; - final private int SUBPIXEL_POSITIONS_X; - final private int SUBPIXEL_POSITIONS_Y; - final private int SUBPIXEL_MASK_X; - final private int SUBPIXEL_MASK_Y; + private final int SUBPIXEL_LG_POSITIONS_X; + private final int SUBPIXEL_LG_POSITIONS_Y; + private final int SUBPIXEL_POSITIONS_X; + private final int SUBPIXEL_POSITIONS_Y; + private final int SUBPIXEL_MASK_X; + private final int SUBPIXEL_MASK_Y; final int MAX_AA_ALPHA; // Cache to store RLE-encoded coverage mask of the current primitive diff --git a/jdk/src/java.desktop/share/classes/sun/print/CustomMediaSizeName.java b/jdk/src/java.desktop/share/classes/sun/print/CustomMediaSizeName.java index 5b9b4b19883..1baf9a6755d 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/CustomMediaSizeName.java +++ b/jdk/src/java.desktop/share/classes/sun/print/CustomMediaSizeName.java @@ -43,7 +43,7 @@ class CustomMediaSizeName extends MediaSizeName { } - private synchronized static int nextValue(String name) { + private static synchronized int nextValue(String name) { customStringTable.add(name); return (customStringTable.size()-1); diff --git a/jdk/src/java.desktop/share/classes/sun/print/CustomMediaTray.java b/jdk/src/java.desktop/share/classes/sun/print/CustomMediaTray.java index 7607cd8d118..394aba988c1 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/CustomMediaTray.java +++ b/jdk/src/java.desktop/share/classes/sun/print/CustomMediaTray.java @@ -40,7 +40,7 @@ class CustomMediaTray extends MediaTray { } - private synchronized static int nextValue(String name) { + private static synchronized int nextValue(String name) { customStringTable.add(name); return (customStringTable.size()-1); } diff --git a/jdk/src/java.desktop/share/classes/sun/print/PSStreamPrintJob.java b/jdk/src/java.desktop/share/classes/sun/print/PSStreamPrintJob.java index 63118aa4841..3d848fa5bae 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PSStreamPrintJob.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PSStreamPrintJob.java @@ -66,9 +66,9 @@ import java.awt.print.*; public class PSStreamPrintJob implements CancelablePrintJob { - transient private Vector jobListeners; - transient private Vector attrListeners; - transient private Vector listenedAttributeSets; + private transient Vector jobListeners; + private transient Vector attrListeners; + private transient Vector listenedAttributeSets; private PSStreamPrintService service; private boolean fidelity; diff --git a/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java b/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java index ffa0aabe25d..0e33bf191eb 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java @@ -1885,7 +1885,7 @@ public class PeekGraphics extends Graphics2D return mHeight; } - synchronized private void waitForDimensions(Image img) { + private synchronized void waitForDimensions(Image img) { mHeight = img.getHeight(this); mWidth = img.getWidth(this); while (!badImage && (mWidth < 0 || mHeight < 0)) { @@ -1903,7 +1903,7 @@ public class PeekGraphics extends Graphics2D } } - synchronized public boolean imageUpdate(Image image, int flags, + public synchronized boolean imageUpdate(Image image, int flags, int x, int y, int w, int h) { boolean dontCallMeAgain = (flags & (HEIGHT | ABORT | ERROR)) != 0; diff --git a/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java b/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java index cd3ded43f75..9f14ff7ba03 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java @@ -263,27 +263,27 @@ public class PrintJob2D extends PrintJob implements Printable, Runnable { // The following Strings are maintained for backward-compatibility with // Properties based print control. - private final static String DEST_PROP = "awt.print.destination"; - private final static String PRINTER = "printer"; - private final static String FILE = "file"; + private static final String DEST_PROP = "awt.print.destination"; + private static final String PRINTER = "printer"; + private static final String FILE = "file"; - private final static String PRINTER_PROP = "awt.print.printer"; + private static final String PRINTER_PROP = "awt.print.printer"; - private final static String FILENAME_PROP = "awt.print.fileName"; + private static final String FILENAME_PROP = "awt.print.fileName"; - private final static String NUMCOPIES_PROP = "awt.print.numCopies"; + private static final String NUMCOPIES_PROP = "awt.print.numCopies"; - private final static String OPTIONS_PROP = "awt.print.options"; + private static final String OPTIONS_PROP = "awt.print.options"; - private final static String ORIENT_PROP = "awt.print.orientation"; - private final static String PORTRAIT = "portrait"; - private final static String LANDSCAPE = "landscape"; + private static final String ORIENT_PROP = "awt.print.orientation"; + private static final String PORTRAIT = "portrait"; + private static final String LANDSCAPE = "landscape"; - private final static String PAPERSIZE_PROP = "awt.print.paperSize"; - private final static String LETTER = "letter"; - private final static String LEGAL = "legal"; - private final static String EXECUTIVE = "executive"; - private final static String A4 = "a4"; + private static final String PAPERSIZE_PROP = "awt.print.paperSize"; + private static final String LETTER = "letter"; + private static final String LEGAL = "legal"; + private static final String EXECUTIVE = "executive"; + private static final String A4 = "a4"; private Properties props; diff --git a/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java b/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java index 7a24a722efb..b3225679369 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java +++ b/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java @@ -335,67 +335,67 @@ public abstract class RasterPrinterJob extends PrinterJob { * Returns the resolution in dots per inch across the width * of the page. */ - abstract protected double getXRes(); + protected abstract double getXRes(); /** * Returns the resolution in dots per inch down the height * of the page. */ - abstract protected double getYRes(); + protected abstract double getYRes(); /** * Must be obtained from the current printer. * Value is in device pixels. * Not adjusted for orientation of the paper. */ - abstract protected double getPhysicalPrintableX(Paper p); + protected abstract double getPhysicalPrintableX(Paper p); /** * Must be obtained from the current printer. * Value is in device pixels. * Not adjusted for orientation of the paper. */ - abstract protected double getPhysicalPrintableY(Paper p); + protected abstract double getPhysicalPrintableY(Paper p); /** * Must be obtained from the current printer. * Value is in device pixels. * Not adjusted for orientation of the paper. */ - abstract protected double getPhysicalPrintableWidth(Paper p); + protected abstract double getPhysicalPrintableWidth(Paper p); /** * Must be obtained from the current printer. * Value is in device pixels. * Not adjusted for orientation of the paper. */ - abstract protected double getPhysicalPrintableHeight(Paper p); + protected abstract double getPhysicalPrintableHeight(Paper p); /** * Must be obtained from the current printer. * Value is in device pixels. * Not adjusted for orientation of the paper. */ - abstract protected double getPhysicalPageWidth(Paper p); + protected abstract double getPhysicalPageWidth(Paper p); /** * Must be obtained from the current printer. * Value is in device pixels. * Not adjusted for orientation of the paper. */ - abstract protected double getPhysicalPageHeight(Paper p); + protected abstract double getPhysicalPageHeight(Paper p); /** * Begin a new page. */ - abstract protected void startPage(PageFormat format, Printable painter, + protected abstract void startPage(PageFormat format, Printable painter, int index, boolean paperChanged) throws PrinterException; /** * End a page. */ - abstract protected void endPage(PageFormat format, Printable painter, + protected abstract void endPage(PageFormat format, Printable painter, int index) throws PrinterException; @@ -406,7 +406,7 @@ public abstract class RasterPrinterJob extends PrinterJob { * page. The width and height of the band is * specified by the caller. */ - abstract protected void printBand(byte[] data, int x, int y, + protected abstract void printBand(byte[] data, int x, int y, int width, int height) throws PrinterException; diff --git a/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java b/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java index ece4f48ef97..f4694100cd2 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java +++ b/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java @@ -87,17 +87,17 @@ public class ServiceDialog extends JDialog implements ActionListener { /** * Waiting print status (user response pending). */ - public final static int WAITING = 0; + public static final int WAITING = 0; /** * Approve print status (user activated "Print" or "OK"). */ - public final static int APPROVE = 1; + public static final int APPROVE = 1; /** * Cancel print status (user activated "Cancel"); */ - public final static int CANCEL = 2; + public static final int CANCEL = 2; private static final String strBundle = "sun.print.resources.serviceui"; private static final Insets panelInsets = new Insets(6, 6, 6, 6); diff --git a/jdk/src/java.desktop/share/classes/sun/swing/FilePane.java b/jdk/src/java.desktop/share/classes/sun/swing/FilePane.java index 34af52a315e..778e40cc052 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/FilePane.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/FilePane.java @@ -63,14 +63,14 @@ public class FilePane extends JPanel implements PropertyChangeListener { // Constants for actions. These are used for the actions' ACTION_COMMAND_KEY // and as keys in the action maps for FilePane and the corresponding UI classes - public final static String ACTION_APPROVE_SELECTION = "approveSelection"; - public final static String ACTION_CANCEL = "cancelSelection"; - public final static String ACTION_EDIT_FILE_NAME = "editFileName"; - public final static String ACTION_REFRESH = "refresh"; - public final static String ACTION_CHANGE_TO_PARENT_DIRECTORY = "Go Up"; - public final static String ACTION_NEW_FOLDER = "New Folder"; - public final static String ACTION_VIEW_LIST = "viewTypeList"; - public final static String ACTION_VIEW_DETAILS = "viewTypeDetails"; + public static final String ACTION_APPROVE_SELECTION = "approveSelection"; + public static final String ACTION_CANCEL = "cancelSelection"; + public static final String ACTION_EDIT_FILE_NAME = "editFileName"; + public static final String ACTION_REFRESH = "refresh"; + public static final String ACTION_CHANGE_TO_PARENT_DIRECTORY = "Go Up"; + public static final String ACTION_NEW_FOLDER = "New Folder"; + public static final String ACTION_VIEW_LIST = "viewTypeList"; + public static final String ACTION_VIEW_DETAILS = "viewTypeDetails"; private Action[] actions; diff --git a/jdk/src/java.desktop/share/classes/sun/swing/ImageCache.java b/jdk/src/java.desktop/share/classes/sun/swing/ImageCache.java index 869e30cd8f4..57a8ea095ad 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/ImageCache.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/ImageCache.java @@ -37,7 +37,7 @@ public class ImageCache { // Maximum number of entries to cache private int maxCount; // The entries. - final private LinkedList> entries; + private final LinkedList> entries; public ImageCache(int maxCount) { this.maxCount = maxCount; @@ -102,10 +102,10 @@ public class ImageCache { * Caches set of arguments and Image. */ private static class Entry { - final private GraphicsConfiguration config; - final private int w; - final private int h; - final private Object[] args; + private final GraphicsConfiguration config; + private final int w; + private final int h; + private final Object[] args; private Image image; Entry(GraphicsConfiguration config, int w, int h, Object[] args) { diff --git a/jdk/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java b/jdk/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java index 1f93fa7fc24..6767719797b 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java @@ -228,8 +228,8 @@ public abstract class SynthFileChooserUI extends BasicFileChooserUI implements protected void paint(SynthContext context, Graphics g) { } - abstract public void setFileName(String fileName); - abstract public String getFileName(); + public abstract void setFileName(String fileName); + public abstract String getFileName(); protected void doSelectedFileChanged(PropertyChangeEvent e) { } diff --git a/jdk/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java b/jdk/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java index 4fa7306fdd0..3197fd82cd4 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java @@ -699,7 +699,7 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI { } } - final static int space = 10; + static final int space = 10; class IndentIcon implements Icon { Icon icon = null; diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/InfoWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/InfoWindow.java index 27661ee35d7..42fd317d69d 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/InfoWindow.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/InfoWindow.java @@ -169,12 +169,12 @@ public abstract class InfoWindow extends Window { display(); }}; - private final static int TOOLTIP_SHOW_TIME = 10000; - private final static int TOOLTIP_START_DELAY_TIME = 1000; - private final static int TOOLTIP_MAX_LENGTH = 64; - private final static int TOOLTIP_MOUSE_CURSOR_INDENT = 5; - private final static Color TOOLTIP_BACKGROUND_COLOR = new Color(255, 255, 220); - private final static Font TOOLTIP_TEXT_FONT = XWindow.getDefaultFont(); + private static final int TOOLTIP_SHOW_TIME = 10000; + private static final int TOOLTIP_START_DELAY_TIME = 1000; + private static final int TOOLTIP_MAX_LENGTH = 64; + private static final int TOOLTIP_MOUSE_CURSOR_INDENT = 5; + private static final Color TOOLTIP_BACKGROUND_COLOR = new Color(255, 255, 220); + private static final Font TOOLTIP_TEXT_FONT = XWindow.getDefaultFont(); public Tooltip(Frame parent, Object target, LiveArguments liveArguments) @@ -258,15 +258,15 @@ public abstract class InfoWindow extends Window { private final LiveArguments liveArguments; private final Object target; - private final static int BALLOON_SHOW_TIME = 10000; - private final static int BALLOON_TEXT_MAX_LENGTH = 256; - private final static int BALLOON_WORD_LINE_MAX_LENGTH = 16; - private final static int BALLOON_WORD_LINE_MAX_COUNT = 4; - private final static int BALLOON_ICON_WIDTH = 32; - private final static int BALLOON_ICON_HEIGHT = 32; - private final static int BALLOON_TRAY_ICON_INDENT = 0; - private final static Color BALLOON_CAPTION_BACKGROUND_COLOR = new Color(200, 200 ,255); - private final static Font BALLOON_CAPTION_FONT = new Font(Font.DIALOG, Font.BOLD, 12); + private static final int BALLOON_SHOW_TIME = 10000; + private static final int BALLOON_TEXT_MAX_LENGTH = 256; + private static final int BALLOON_WORD_LINE_MAX_LENGTH = 16; + private static final int BALLOON_WORD_LINE_MAX_COUNT = 4; + private static final int BALLOON_ICON_WIDTH = 32; + private static final int BALLOON_ICON_HEIGHT = 32; + private static final int BALLOON_TRAY_ICON_INDENT = 0; + private static final Color BALLOON_CAPTION_BACKGROUND_COLOR = new Color(200, 200 ,255); + private static final Font BALLOON_CAPTION_FONT = new Font(Font.DIALOG, Font.BOLD, 12); private Panel mainPanel = new Panel(); private Panel captionPanel = new Panel(); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/MWMConstants.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/MWMConstants.java index 72d5f0b94c9..24c2d860257 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/MWMConstants.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/MWMConstants.java @@ -26,7 +26,7 @@ package sun.awt.X11; -final public class MWMConstants { +public final class MWMConstants { private MWMConstants(){} @@ -62,8 +62,8 @@ final public class MWMConstants { /* number of elements of size 32 in _MWM_HINTS */ static final int PROP_MWM_HINTS_ELEMENTS = 5; /* number of elements of size 32 in _MWM_INFO */ - final static int PROP_MOTIF_WM_INFO_ELEMENTS= 2; - final static int PROP_MWM_INFO_ELEMENTS= PROP_MOTIF_WM_INFO_ELEMENTS; + static final int PROP_MOTIF_WM_INFO_ELEMENTS= 2; + static final int PROP_MWM_INFO_ELEMENTS= PROP_MOTIF_WM_INFO_ELEMENTS; static final String MWM_HINTS_ATOM_NAME = "_MOTIF_WM_HINTS"; } diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAwtState.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAwtState.java index b0a8186c77a..5847d7c5133 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAwtState.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAwtState.java @@ -27,7 +27,7 @@ * This class is a placeholder for all internal static objects that represent * system state. We keep our representation up-to-date with actual system * state by tracking events, such as X Focus, Component under cursor etc. - * All attributes should be static private with accessors to simpify change + * All attributes should be private static with accessors to simpify change * tracking. */ package sun.awt.X11; diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseMenuWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseMenuWindow.java index 04948a265b8..85481f55c46 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseMenuWindow.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseMenuWindow.java @@ -41,7 +41,7 @@ import sun.java2d.SunGraphics2D; * The abstract class XBaseMenuWindow is the superclass * of all menu windows. */ -abstract public class XBaseMenuWindow extends XWindow { +public abstract class XBaseMenuWindow extends XWindow { /************************************************ * @@ -89,7 +89,7 @@ abstract public class XBaseMenuWindow extends XWindow { * no other locks should be taken when * thread own this lock. */ - static private Object menuTreeLock = new Object(); + private static Object menuTreeLock = new Object(); /************************************************ * diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java index 1d8804ec9c6..ecca4d3081c 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java @@ -72,8 +72,8 @@ public class XBaseWindow { private XSizeHints hints; private XWMHints wmHints; - final static int MIN_SIZE = 1; - final static int DEF_LOCATION = 1; + static final int MIN_SIZE = 1; + static final int DEF_LOCATION = 1; private static XAtom wm_client_leader; diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XButtonPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XButtonPeer.java index 68d0803000a..2e2bd0ef2a7 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XButtonPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XButtonPeer.java @@ -40,7 +40,7 @@ public class XButtonPeer extends XComponentPeer implements ButtonPeer { private Insets borderInsets; private Insets contentAreaInsets; - private final static String propertyPrefix = "Button" + "."; + private static final String propertyPrefix = "Button" + "."; protected Color focusColor = SystemColor.windowText; private boolean disposed = false; diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java index 95d1364c13c..b38297278c6 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java @@ -50,10 +50,10 @@ public class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelS // at a time in an // unfurled Choice // Description of these constants in ListHelper - public final static int TEXT_SPACE = 1; - public final static int BORDER_WIDTH = 1; - public final static int ITEM_MARGIN = 1; - public final static int SCROLLBAR_WIDTH = 15; + public static final int TEXT_SPACE = 1; + public static final int BORDER_WIDTH = 1; + public static final int ITEM_MARGIN = 1; + public static final int SCROLLBAR_WIDTH = 15; // SHARE THESE! diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java index 3c5d162bd18..5e8937436c0 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java @@ -210,7 +210,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget * Descendants should use this method to determine whether or not native window * has focus. */ - final public boolean hasFocus() { + public final boolean hasFocus() { return bHasFocus; } @@ -242,7 +242,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget private static Class seClass; private static Constructor seCtor; - final static AWTEvent wrapInSequenced(AWTEvent event) { + static final AWTEvent wrapInSequenced(AWTEvent event) { try { if (seClass == null) { seClass = Class.forName("java.awt.SequencedEvent"); @@ -283,7 +283,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget // TODO: consider moving it to KeyboardFocusManagerPeerImpl @SuppressWarnings("deprecation") - final public boolean requestFocus(Component lightweightChild, boolean temporary, + public final boolean requestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XConstants.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XConstants.java index 91c533898b8..ddc4cd10332 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XConstants.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XConstants.java @@ -25,7 +25,7 @@ package sun.awt.X11; -final public class XConstants { +public final class XConstants { private XConstants(){} diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XCursorFontConstants.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XCursorFontConstants.java index 44148f8744f..cb785ee9797 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XCursorFontConstants.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XCursorFontConstants.java @@ -25,7 +25,7 @@ package sun.awt.X11; -final public class XCursorFontConstants { +public final class XCursorFontConstants { private XCursorFontConstants(){} diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java index 966d30a8e81..0df07fb6fd7 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java @@ -904,7 +904,7 @@ abstract class XDecoratedPeer extends XWindowPeer { return getSize().height; } - final public WindowDimensions getDimensions() { + public final WindowDimensions getDimensions() { return dimensions; } diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDragAndDropProtocols.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDragAndDropProtocols.java index 161fc285a02..cb61fad7c88 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDragAndDropProtocols.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDragAndDropProtocols.java @@ -36,8 +36,8 @@ import java.util.List; * @since 1.5 */ final class XDragAndDropProtocols { - private final static List dragProtocols; - private final static List dropProtocols; + private static final List dragProtocols; + private static final List dropProtocols; public static final String XDnD = "XDnD"; public static final String MotifDnD = "MotifDnD"; diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDropTargetContextPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDropTargetContextPeer.java index 7a9826ba63b..1e59ce16e82 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDropTargetContextPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDropTargetContextPeer.java @@ -238,7 +238,7 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer { static final class XDropTargetProtocolListenerImpl implements XDropTargetProtocolListener { - private final static XDropTargetProtocolListener theInstance = + private static final XDropTargetProtocolListener theInstance = new XDropTargetProtocolListenerImpl(); private XDropTargetProtocolListenerImpl() {} diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedHelper.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedHelper.java index 947a3cb543c..f54f4bd9e66 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedHelper.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedHelper.java @@ -38,43 +38,43 @@ import java.awt.event.InputEvent; */ public class XEmbedHelper { private static final PlatformLogger xembedLog = PlatformLogger.getLogger("sun.awt.X11.xembed"); - final static Unsafe unsafe = Unsafe.getUnsafe(); + static final Unsafe unsafe = Unsafe.getUnsafe(); - final static int XEMBED_VERSION = 0, + static final int XEMBED_VERSION = 0, XEMBED_MAPPED = (1 << 0); /* XEMBED messages */ - final static int XEMBED_EMBEDDED_NOTIFY = 0; - final static int XEMBED_WINDOW_ACTIVATE = 1; - final static int XEMBED_WINDOW_DEACTIVATE = 2; - final static int XEMBED_REQUEST_FOCUS =3; - final static int XEMBED_FOCUS_IN = 4; - final static int XEMBED_FOCUS_OUT = 5; - final static int XEMBED_FOCUS_NEXT = 6; - final static int XEMBED_FOCUS_PREV = 7; + static final int XEMBED_EMBEDDED_NOTIFY = 0; + static final int XEMBED_WINDOW_ACTIVATE = 1; + static final int XEMBED_WINDOW_DEACTIVATE = 2; + static final int XEMBED_REQUEST_FOCUS =3; + static final int XEMBED_FOCUS_IN = 4; + static final int XEMBED_FOCUS_OUT = 5; + static final int XEMBED_FOCUS_NEXT = 6; + static final int XEMBED_FOCUS_PREV = 7; /* 8-9 were used for XEMBED_GRAB_KEY/XEMBED_UNGRAB_KEY */ - final static int XEMBED_GRAB_KEY = 8; - final static int XEMBED_UNGRAB_KEY = 9; - final static int XEMBED_MODALITY_ON = 10; - final static int XEMBED_MODALITY_OFF = 11; - final static int XEMBED_REGISTER_ACCELERATOR = 12; - final static int XEMBED_UNREGISTER_ACCELERATOR= 13; - final static int XEMBED_ACTIVATE_ACCELERATOR = 14; + static final int XEMBED_GRAB_KEY = 8; + static final int XEMBED_UNGRAB_KEY = 9; + static final int XEMBED_MODALITY_ON = 10; + static final int XEMBED_MODALITY_OFF = 11; + static final int XEMBED_REGISTER_ACCELERATOR = 12; + static final int XEMBED_UNREGISTER_ACCELERATOR= 13; + static final int XEMBED_ACTIVATE_ACCELERATOR = 14; - final static int NON_STANDARD_XEMBED_GTK_GRAB_KEY = 108; - final static int NON_STANDARD_XEMBED_GTK_UNGRAB_KEY = 109; + static final int NON_STANDARD_XEMBED_GTK_GRAB_KEY = 108; + static final int NON_STANDARD_XEMBED_GTK_UNGRAB_KEY = 109; // A detail code is required for XEMBED_FOCUS_IN. The following values are valid: /* Details for XEMBED_FOCUS_IN: */ - final static int XEMBED_FOCUS_CURRENT = 0; - final static int XEMBED_FOCUS_FIRST = 1; - final static int XEMBED_FOCUS_LAST = 2; + static final int XEMBED_FOCUS_CURRENT = 0; + static final int XEMBED_FOCUS_FIRST = 1; + static final int XEMBED_FOCUS_LAST = 2; // Modifiers bits - final static int XEMBED_MODIFIER_SHIFT = (1 << 0); - final static int XEMBED_MODIFIER_CONTROL = (1 << 1); - final static int XEMBED_MODIFIER_ALT = (1 << 2); - final static int XEMBED_MODIFIER_SUPER = (1 << 3); - final static int XEMBED_MODIFIER_HYPER = (1 << 4); + static final int XEMBED_MODIFIER_SHIFT = (1 << 0); + static final int XEMBED_MODIFIER_CONTROL = (1 << 1); + static final int XEMBED_MODIFIER_ALT = (1 << 2); + static final int XEMBED_MODIFIER_SUPER = (1 << 3); + static final int XEMBED_MODIFIER_HYPER = (1 << 4); static XAtom XEmbedInfo; static XAtom XEmbed; diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XFileDialogPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XFileDialogPeer.java index f88132bf1e9..57d4764d893 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XFileDialogPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XFileDialogPeer.java @@ -862,8 +862,8 @@ class XFileDialogPeer extends XDialogPeer @SuppressWarnings("serial") // JDK-implementation class class Separator extends Canvas { - public final static int HORIZONTAL = 0; - public final static int VERTICAL = 1; + public static final int HORIZONTAL = 0; + public static final int VERTICAL = 1; int orientation; @SuppressWarnings("deprecation") diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XIconWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XIconWindow.java index 07899ef8de4..5736af63870 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XIconWindow.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XIconWindow.java @@ -34,7 +34,7 @@ import sun.awt.image.ImageRepresentation; import sun.util.logging.PlatformLogger; public class XIconWindow extends XBaseWindow { - private final static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XIconWindow"); + private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XIconWindow"); XDecoratedPeer parent; Dimension size; long iconPixmap = 0; diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XLayerProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XLayerProtocol.java index 6c1786b11ad..69e514fad23 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XLayerProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XLayerProtocol.java @@ -28,7 +28,7 @@ package sun.awt.X11; public interface XLayerProtocol { - final static int LAYER_NORMAL = 0, + static final int LAYER_NORMAL = 0, LAYER_ALWAYS_ON_TOP = 1; boolean supportsLayer(int layer); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XListPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XListPeer.java index b744d5e8cbd..e28817f06f8 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XListPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XListPeer.java @@ -42,28 +42,28 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XListPeer"); - public final static int MARGIN = 2; - public final static int SPACE = 1; - public final static int SCROLLBAR_AREA = 17; // Area reserved for the + public static final int MARGIN = 2; + public static final int SPACE = 1; + public static final int SCROLLBAR_AREA = 17; // Area reserved for the // scrollbar - public final static int SCROLLBAR_WIDTH = 13; // Actual width of the + public static final int SCROLLBAR_WIDTH = 13; // Actual width of the // scrollbar - public final static int NONE = -1; - public final static int WINDOW = 0; - public final static int VERSCROLLBAR = 1; - public final static int HORSCROLLBAR = 2; - public final static int DEFAULT_VISIBLE_ROWS = 4; // From java.awt.List, - public final static int HORIZ_SCROLL_AMT = 10; + public static final int NONE = -1; + public static final int WINDOW = 0; + public static final int VERSCROLLBAR = 1; + public static final int HORSCROLLBAR = 2; + public static final int DEFAULT_VISIBLE_ROWS = 4; // From java.awt.List, + public static final int HORIZ_SCROLL_AMT = 10; - private final static int PAINT_VSCROLL = 2; - private final static int PAINT_HSCROLL = 4; - private final static int PAINT_ITEMS = 8; - private final static int PAINT_FOCUS = 16; - private final static int PAINT_BACKGROUND = 32; - private final static int PAINT_HIDEFOCUS = 64; - private final static int PAINT_ALL = + private static final int PAINT_VSCROLL = 2; + private static final int PAINT_HSCROLL = 4; + private static final int PAINT_ITEMS = 8; + private static final int PAINT_FOCUS = 16; + private static final int PAINT_BACKGROUND = 32; + private static final int PAINT_HIDEFOCUS = 64; + private static final int PAINT_ALL = PAINT_VSCROLL | PAINT_HSCROLL | PAINT_ITEMS | PAINT_FOCUS | PAINT_BACKGROUND; - private final static int COPY_AREA = 128; + private static final int COPY_AREA = 128; XVerticalScrollbar vsb; XHorizontalScrollbar hsb; diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuBarPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuBarPeer.java index 256767446e2..2936b2af0c1 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuBarPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuBarPeer.java @@ -56,15 +56,15 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer { /* * dimension constants */ - private final static int BAR_SPACING_TOP = 3; - private final static int BAR_SPACING_BOTTOM = 3; - private final static int BAR_SPACING_LEFT = 3; - private final static int BAR_SPACING_RIGHT = 3; - private final static int BAR_ITEM_SPACING = 2; - private final static int BAR_ITEM_MARGIN_LEFT = 10; - private final static int BAR_ITEM_MARGIN_RIGHT = 10; - private final static int BAR_ITEM_MARGIN_TOP = 2; - private final static int BAR_ITEM_MARGIN_BOTTOM = 2; + private static final int BAR_SPACING_TOP = 3; + private static final int BAR_SPACING_BOTTOM = 3; + private static final int BAR_SPACING_LEFT = 3; + private static final int BAR_SPACING_RIGHT = 3; + private static final int BAR_ITEM_SPACING = 2; + private static final int BAR_ITEM_MARGIN_LEFT = 10; + private static final int BAR_ITEM_MARGIN_RIGHT = 10; + private static final int BAR_ITEM_MARGIN_TOP = 2; + private static final int BAR_ITEM_MARGIN_BOTTOM = 2; /************************************************ * diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuItemPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuItemPeer.java index dd576070ff2..aa1c85d7908 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuItemPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuItemPeer.java @@ -75,8 +75,8 @@ public class XMenuItemPeer implements MenuItemPeer { /* * Size constants */ - private final static int SEPARATOR_WIDTH = 20; - private final static int SEPARATOR_HEIGHT = 5; + private static final int SEPARATOR_WIDTH = 20; + private static final int SEPARATOR_HEIGHT = 5; /************************************************ * diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuWindow.java index a79753facf0..7bd63917663 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuWindow.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuWindow.java @@ -52,16 +52,16 @@ public class XMenuWindow extends XBaseMenuWindow { /* * dimension constants */ - private final static int WINDOW_SPACING_LEFT = 2; - private final static int WINDOW_SPACING_RIGHT = 2; - private final static int WINDOW_SPACING_TOP = 2; - private final static int WINDOW_SPACING_BOTTOM = 2; - private final static int WINDOW_ITEM_INDENT = 15; - private final static int WINDOW_ITEM_MARGIN_LEFT = 2; - private final static int WINDOW_ITEM_MARGIN_RIGHT = 2; - private final static int WINDOW_ITEM_MARGIN_TOP = 2; - private final static int WINDOW_ITEM_MARGIN_BOTTOM = 2; - private final static int WINDOW_SHORTCUT_SPACING = 10; + private static final int WINDOW_SPACING_LEFT = 2; + private static final int WINDOW_SPACING_RIGHT = 2; + private static final int WINDOW_SPACING_TOP = 2; + private static final int WINDOW_SPACING_BOTTOM = 2; + private static final int WINDOW_ITEM_INDENT = 15; + private static final int WINDOW_ITEM_MARGIN_LEFT = 2; + private static final int WINDOW_ITEM_MARGIN_RIGHT = 2; + private static final int WINDOW_ITEM_MARGIN_TOP = 2; + private static final int WINDOW_ITEM_MARGIN_BOTTOM = 2; + private static final int WINDOW_SHORTCUT_SPACING = 10; /* * Checkmark diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XNETProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XNETProtocol.java index 5ba80bbef0f..2d82ace9845 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XNETProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XNETProtocol.java @@ -33,8 +33,8 @@ import sun.util.logging.PlatformLogger; final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProtocol { - private final static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XNETProtocol"); - private final static PlatformLogger iconLog = PlatformLogger.getLogger("sun.awt.X11.icon.XNETProtocol"); + private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XNETProtocol"); + private static final PlatformLogger iconLog = PlatformLogger.getLogger("sun.awt.X11.icon.XNETProtocol"); private static PlatformLogger stateLog = PlatformLogger.getLogger("sun.awt.X11.states.XNETProtocol"); /** @@ -280,9 +280,9 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt XAtom XA_NET_WM_WINDOW_OPACITY = XAtom.get("_NET_WM_WINDOW_OPACITY"); /* For _NET_WM_STATE ClientMessage requests */ - final static int _NET_WM_STATE_REMOVE =0; /* remove/unset property */ - final static int _NET_WM_STATE_ADD =1; /* add/set property */ - final static int _NET_WM_STATE_TOGGLE =2; /* toggle property */ + static final int _NET_WM_STATE_REMOVE =0; /* remove/unset property */ + static final int _NET_WM_STATE_ADD =1; /* add/set property */ + static final int _NET_WM_STATE_TOGGLE =2; /* toggle property */ boolean supportChecked = false; long NetWindow = 0; diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java index 03a4db3f9f9..c510836a2fa 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java @@ -58,8 +58,8 @@ public class XPopupMenuPeer extends XMenuWindow implements PopupMenuPeer { /* * Painting constants */ - private final static int CAPTION_MARGIN_TOP = 4; - private final static int CAPTION_SEPARATOR_HEIGHT = 6; + private static final int CAPTION_MARGIN_TOP = 4; + private static final int CAPTION_SEPARATOR_HEIGHT = 6; /************************************************ * diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XProtocol.java index e4cf2f3e49b..ed3352b9f72 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XProtocol.java @@ -30,7 +30,7 @@ import sun.util.logging.PlatformLogger; import java.util.*; class XProtocol { - private final static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XProtocol"); + private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XProtocol"); private Map atomToList = new HashMap(); private Map atomToAnchor = new HashMap(); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XProtocolConstants.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XProtocolConstants.java index 0b80c5f56a8..89412f48cb9 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XProtocolConstants.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XProtocolConstants.java @@ -25,7 +25,7 @@ package sun.awt.X11; -final public class XProtocolConstants { +public final class XProtocolConstants { private XProtocolConstants(){} diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java index 4a3554816d1..156abd9ce68 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java @@ -107,16 +107,16 @@ class XRobotPeer implements RobotPeer { return pixelArray; } - private static native synchronized void setup(int numberOfButtons, int[] buttonDownMasks); + private static synchronized native void setup(int numberOfButtons, int[] buttonDownMasks); - private static native synchronized void mouseMoveImpl(X11GraphicsConfig xgc, int x, int y); - private static native synchronized void mousePressImpl(int buttons); - private static native synchronized void mouseReleaseImpl(int buttons); - private static native synchronized void mouseWheelImpl(int wheelAmt); + private static synchronized native void mouseMoveImpl(X11GraphicsConfig xgc, int x, int y); + private static synchronized native void mousePressImpl(int buttons); + private static synchronized native void mouseReleaseImpl(int buttons); + private static synchronized native void mouseWheelImpl(int wheelAmt); - private static native synchronized void keyPressImpl(int keycode); - private static native synchronized void keyReleaseImpl(int keycode); + private static synchronized native void keyPressImpl(int keycode); + private static synchronized native void keyReleaseImpl(int keycode); - private static native synchronized void getRGBPixelsImpl(X11GraphicsConfig xgc, + private static synchronized native void getRGBPixelsImpl(X11GraphicsConfig xgc, int x, int y, int width, int height, int pixelArray[], boolean isGtkSupported); } diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollPanePeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollPanePeer.java index 9f2c39ce1e2..80156180b31 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollPanePeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollPanePeer.java @@ -34,13 +34,13 @@ import sun.awt.AWTAccessor; class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollbarClient { - public final static int MARGIN = 1; - public final static int SCROLLBAR; - public final static int SPACE = 2; - public final static int SCROLLBAR_INSET = 2; + public static final int MARGIN = 1; + public static final int SCROLLBAR; + public static final int SPACE = 2; + public static final int SCROLLBAR_INSET = 2; - public final static int VERTICAL = 1 << 0; - public final static int HORIZONTAL = 1 << 1; + public static final int VERTICAL = 1 << 0; + public static final int HORIZONTAL = 1 << 1; static { SCROLLBAR = XToolkit.getUIDefaults().getInt("ScrollBar.defaultWidth"); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbar.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbar.java index 71aa8fe0de4..ca43f7a501b 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbar.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbar.java @@ -51,7 +51,7 @@ abstract class XScrollbar { private XScrollRepeater i_scroller = new XScrollRepeater(null); // Thumb length is always >= MIN_THUMB_H - private final static int MIN_THUMB_H = 5; + private static final int MIN_THUMB_H = 5; private static final int ARROW_IND = 1; @@ -115,7 +115,7 @@ abstract class XScrollbar { } } - abstract protected void rebuildArrows(); + protected abstract void rebuildArrows(); public void setSize(int width, int height) { if (log.isLoggable(PlatformLogger.Level.FINER)) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbarPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbarPeer.java index 7f0aa8c643a..cf32749eea8 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbarPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbarPeer.java @@ -31,7 +31,7 @@ import java.awt.peer.*; import sun.util.logging.PlatformLogger; class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbarClient { - private final static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XScrollbarPeer"); + private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XScrollbarPeer"); private static final int DEFAULT_LENGTH = 50; private static final int DEFAULT_WIDTH_SOLARIS = 19; diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java index 1b890710594..6b97e48a297 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java @@ -67,7 +67,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { //There is 400 ms is set by default on Windows and 500 by default on KDE and GNOME. //We use the same hardcoded constant. - private final static int AWT_MULTICLICK_DEFAULT_TIME = 500; + private static final int AWT_MULTICLICK_DEFAULT_TIME = 500; static final boolean PRIMARY_LOOP = false; static final boolean SECONDARY_LOOP = true; @@ -140,8 +140,8 @@ public final class XToolkit extends UNIXToolkit implements Runnable { */ static native long getTrayIconDisplayTimeout(); - private native static void initIDs(); - native static void waitForEvents(long nextTaskTime); + private static native void initIDs(); + static native void waitForEvents(long nextTaskTime); static Thread toolkitThread; static boolean isToolkitThread() { return Thread.currentThread() == toolkitThread; @@ -1102,7 +1102,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { * Returns the value of "sun.awt.disableGtkFileDialogs" property. Default * value is {@code false}. */ - public synchronized static boolean getSunAwtDisableGtkFileDialogs() { + public static synchronized boolean getSunAwtDisableGtkFileDialogs() { if (sunAwtDisableGtkFileDialogs == null) { sunAwtDisableGtkFileDialogs = AccessController.doPrivileged( new GetBooleanAction("sun.awt.disableGtkFileDialogs")); @@ -1579,8 +1579,8 @@ public final class XToolkit extends UNIXToolkit implements Runnable { return Math.min(XConstants.MAX_BUTTONS, ((SunToolkit) (Toolkit.getDefaultToolkit())).getNumberOfButtons()); } - private final static String prefix = "DnD.Cursor."; - private final static String postfix = ".32x32"; + private static final String prefix = "DnD.Cursor."; + private static final String postfix = ".32x32"; private static final String dndPrefix = "DnD."; @Override diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTrayIconPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTrayIconPeer.java index 39940c48e2f..eba30a7e2af 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTrayIconPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTrayIconPeer.java @@ -63,8 +63,8 @@ public class XTrayIconPeer implements TrayIconPeer, int old_x, old_y; int ex_width, ex_height; - final static int TRAY_ICON_WIDTH = 24; - final static int TRAY_ICON_HEIGHT = 24; + static final int TRAY_ICON_WIDTH = 24; + static final int TRAY_ICON_HEIGHT = 24; XTrayIconPeer(TrayIcon target) throws AWTException diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XUtilConstants.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XUtilConstants.java index 1d2a641e02e..1aeb61e3fff 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XUtilConstants.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XUtilConstants.java @@ -25,7 +25,7 @@ package sun.awt.X11; -final public class XUtilConstants { +public final class XUtilConstants { private XUtilConstants(){} diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWINProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWINProtocol.java index 8932d039268..c4f1f8ea8b3 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWINProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWINProtocol.java @@ -30,7 +30,7 @@ import java.awt.*; import sun.util.logging.PlatformLogger; class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol { - final static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XWINProtocol"); + static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XWINProtocol"); /* Gnome WM spec */ XAtom XA_WIN_SUPPORTING_WM_CHECK = XAtom.get("_WIN_SUPPORTING_WM_CHECK"); @@ -187,15 +187,15 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol { XAtom XA_WIN_LAYER = XAtom.get("_WIN_LAYER"); /* _WIN_STATE bits */ - final static int WIN_STATE_STICKY =(1<<0); /* everyone knows sticky */ - final static int WIN_STATE_MINIMIZED =(1<<1); /* Reserved - definition is unclear */ - final static int WIN_STATE_MAXIMIZED_VERT =(1<<2); /* window in maximized V state */ - final static int WIN_STATE_MAXIMIZED_HORIZ =(1<<3); /* window in maximized H state */ - final static int WIN_STATE_HIDDEN =(1<<4); /* not on taskbar but window visible*/ - final static int WIN_STATE_SHADED =(1<<5); /* shaded (MacOS / Afterstep style) */ + static final int WIN_STATE_STICKY =(1<<0); /* everyone knows sticky */ + static final int WIN_STATE_MINIMIZED =(1<<1); /* Reserved - definition is unclear */ + static final int WIN_STATE_MAXIMIZED_VERT =(1<<2); /* window in maximized V state */ + static final int WIN_STATE_MAXIMIZED_HORIZ =(1<<3); /* window in maximized H state */ + static final int WIN_STATE_HIDDEN =(1<<4); /* not on taskbar but window visible*/ + static final int WIN_STATE_SHADED =(1<<5); /* shaded (MacOS / Afterstep style) */ /* _WIN_LAYER values */ - final static int WIN_LAYER_ONTOP = 6; - final static int WIN_LAYER_NORMAL = 4; + static final int WIN_LAYER_ONTOP = 6; + static final int WIN_LAYER_NORMAL = 4; long WinWindow = 0; boolean supportChecked = false; diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWM.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWM.java index 265cdb7930e..61d2cbc380d 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWM.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWM.java @@ -50,9 +50,9 @@ import sun.util.logging.PlatformLogger; final class XWM { - private final static PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XWM"); - private final static PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XWM"); - private final static PlatformLogger stateLog = PlatformLogger.getLogger("sun.awt.X11.states.XWM"); + private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XWM"); + private static final PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XWM"); + private static final PlatformLogger stateLog = PlatformLogger.getLogger("sun.awt.X11.states.XWM"); static final XAtom XA_MWM_HINTS = new XAtom(); @@ -66,30 +66,30 @@ final class XWM XAtom XA_UTF8_STRING = XAtom.get("UTF8_STRING"); /* like STRING but encoding is UTF-8 */ /* Currently we only care about max_v and max_h in _NET_WM_STATE */ - final static int AWT_NET_N_KNOWN_STATES=2; + static final int AWT_NET_N_KNOWN_STATES=2; /* Enlightenment */ - final static XAtom XA_E_FRAME_SIZE = new XAtom(); + static final XAtom XA_E_FRAME_SIZE = new XAtom(); /* KWin (KDE2) */ - final static XAtom XA_KDE_NET_WM_FRAME_STRUT = new XAtom(); + static final XAtom XA_KDE_NET_WM_FRAME_STRUT = new XAtom(); /* KWM (KDE 1.x) OBSOLETE??? */ - final static XAtom XA_KWM_WIN_ICONIFIED = new XAtom(); - final static XAtom XA_KWM_WIN_MAXIMIZED = new XAtom(); + static final XAtom XA_KWM_WIN_ICONIFIED = new XAtom(); + static final XAtom XA_KWM_WIN_MAXIMIZED = new XAtom(); /* OpenLook */ - final static XAtom XA_OL_DECOR_DEL = new XAtom(); - final static XAtom XA_OL_DECOR_HEADER = new XAtom(); - final static XAtom XA_OL_DECOR_RESIZE = new XAtom(); - final static XAtom XA_OL_DECOR_PIN = new XAtom(); - final static XAtom XA_OL_DECOR_CLOSE = new XAtom(); + static final XAtom XA_OL_DECOR_DEL = new XAtom(); + static final XAtom XA_OL_DECOR_HEADER = new XAtom(); + static final XAtom XA_OL_DECOR_RESIZE = new XAtom(); + static final XAtom XA_OL_DECOR_PIN = new XAtom(); + static final XAtom XA_OL_DECOR_CLOSE = new XAtom(); /* EWMH */ - final static XAtom XA_NET_FRAME_EXTENTS = new XAtom(); - final static XAtom XA_NET_REQUEST_FRAME_EXTENTS = new XAtom(); + static final XAtom XA_NET_FRAME_EXTENTS = new XAtom(); + static final XAtom XA_NET_REQUEST_FRAME_EXTENTS = new XAtom(); - final static int + static final int UNDETERMINED_WM = 1, NO_WM = 2, OTHER_WM = 3, diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWarningWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWarningWindow.java index 0717dee3479..e1fa63e2604 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWarningWindow.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWarningWindow.java @@ -33,14 +33,14 @@ import sun.awt.AWTAccessor; import sun.awt.SunToolkit; class XWarningWindow extends XWindow { - private final static int SHOWING_DELAY = 330; - private final static int HIDING_DELAY = 2000; + private static final int SHOWING_DELAY = 330; + private static final int HIDING_DELAY = 2000; private final Window ownerWindow; private WeakReference ownerPeer; private long parentWindow; - private final static String OWNER = "OWNER"; + private static final String OWNER = "OWNER"; private InfoWindow.Tooltip tooltip; /** diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java index f48ec9cc114..597020da9e3 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java @@ -54,7 +54,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { * allow a smudge factor so that moving the mouse by a small * amount does not wipe out the multi-click state variables. */ - private final static int AWT_MULTICLICK_SMUDGE = 4; + private static final int AWT_MULTICLICK_SMUDGE = 4; // ButtonXXX events stuff static int lastX = 0, lastY = 0; static long lastTime = 0; @@ -123,7 +123,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { native void getWMInsets(long window, long left, long top, long right, long bottom, long border); native long getTopWindow(long window, long rootWin); native void getWindowBounds(long window, long x, long y, long width, long height); - private native static void initIDs(); + private static native void initIDs(); static { initIDs(); @@ -441,7 +441,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { // and one that does not get overridden. The problem is that in postInit // we call setBackground and we don't have all the stuff initialized to // do a full paint for most peers. So we cannot call setBackground in postInit. - final public void xSetBackground(Color c) { + public final void xSetBackground(Color c) { XToolkit.awtLock(); try { winBackground(c); @@ -1046,13 +1046,13 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { return xEventType == XConstants.KeyPress ? java.awt.event.KeyEvent.KEY_PRESSED : xEventType == XConstants.KeyRelease ? java.awt.event.KeyEvent.KEY_RELEASED : 0; } - static private long xkeycodeToKeysym(XKeyEvent ev) { + private static long xkeycodeToKeysym(XKeyEvent ev) { return XKeysym.getKeysym( ev ); } private long xkeycodeToPrimaryKeysym(XKeyEvent ev) { return XKeysym.xkeycode2primary_keysym( ev ); } - static private int primaryUnicode2JavaKeycode(int uni) { + private static int primaryUnicode2JavaKeycode(int uni) { return (uni > 0? sun.awt.ExtendedKeyCodes.getExtendedKeyCodeForChar(uni) : 0); //return (uni > 0? uni + 0x01000000 : 0); } diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java index 4a948698705..fd6464b41d3 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java @@ -429,7 +429,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, } private static ArrayList defaultIconInfo; - protected synchronized static java.util.List getDefaultIconInfo() { + protected static synchronized java.util.List getDefaultIconInfo() { if (defaultIconInfo == null) { defaultIconInfo = new ArrayList(); if (XlibWrapper.dataModel == 32) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XlibWrapper.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XlibWrapper.java index 01d06404ff4..bc9e3667a1f 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XlibWrapper.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XlibWrapper.java @@ -313,7 +313,7 @@ static native String XSetLocaleModifiers(String modifier_list); long delete, long req_type, long actualy_type, long actualy_format, long nitems_ptr, long bytes_after, long data_ptr); - native static void XChangePropertyImpl(long display, long window, long atom, + static native void XChangePropertyImpl(long display, long window, long atom, long type, int format, int mode, long data, int nelements); static void XChangeProperty(long display, long window, long atom, @@ -566,8 +566,8 @@ static native String XSetLocaleModifiers(String modifier_list); /* Global memory area used for X lib parameter passing */ - final static long lbuffer = unsafe.allocateMemory(64); // array to hold 8 longs - final static long ibuffer = unsafe.allocateMemory(32); // array to hold 8 ints + static final long lbuffer = unsafe.allocateMemory(64); // array to hold 8 longs + static final long ibuffer = unsafe.allocateMemory(32); // array to hold 8 ints static final long larg1 = lbuffer; static final long larg2 = larg1+8; diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11InputMethod.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11InputMethod.java index 61df81610c5..0ac2a16243a 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11InputMethod.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11InputMethod.java @@ -125,7 +125,7 @@ public abstract class X11InputMethod extends InputMethodAdapter { // private data (X11InputMethodData structure defined in // awt_InputMethod.c) for native methods // this structure needs to be accessed within AWT_LOCK/UNLOCK - transient private long pData = 0; // accessed by native + private transient long pData = 0; // accessed by native // Initialize highlight mapping table static { diff --git a/jdk/src/java.desktop/unix/classes/sun/font/X11GB18030_0.java b/jdk/src/java.desktop/unix/classes/sun/font/X11GB18030_0.java index 6efa4051de2..1a9ea8f7d3f 100644 --- a/jdk/src/java.desktop/unix/classes/sun/font/X11GB18030_0.java +++ b/jdk/src/java.desktop/unix/classes/sun/font/X11GB18030_0.java @@ -56,7 +56,7 @@ public class X11GB18030_0 extends Charset { protected int encodeSingle(char inputChar) { return -1; } - private final static String innerIndex0= + private static final String innerIndex0= "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ @@ -570,7 +570,7 @@ public class X11GB18030_0 extends Charset { "\uA5F0\uA5F1\uA5F2\uA5F3\uA5F4\uA5F5\uA5F6\u0000"+ "\u0000\u0000\u0000\u0000\uA960\uA963\uA964\u0000"; - private final static String innerIndex1= + private static final String innerIndex1= "\u0000\u0000\u0000\u0000\u0000\uA8C5\uA8C6\uA8C7"+ "\uA8C8\uA8C9\uA8CA\uA8CB\uA8CC\uA8CD\uA8CE\uA8CF"+ "\uA8D0\uA8D1\uA8D2\uA8D3\uA8D4\uA8D5\uA8D6\uA8D7"+ @@ -1084,7 +1084,7 @@ public class X11GB18030_0 extends Charset { "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"; - private final static String innerIndex2= + private static final String innerIndex2= "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ @@ -1598,7 +1598,7 @@ public class X11GB18030_0 extends Charset { "\u8BAF\uE6CD\u8BB0\u8BB1\u8BB2\u8BB3\u8BB4\u8BB5"+ "\u8BB6\u8BB7\u8BB8\u8BB9\u8BBA\u8BBB\u8BBC\u8BBD"; - private final static String innerIndex3= + private static final String innerIndex3= "\u8BBE\u8BBF\u8BC0\u8BC1\u8BC2\u8BC3\u8BC4\u8BC5"+ "\u8BC6\uE6D2\u8BC7\u8BC8\u8BC9\u8BCA\u8BCB\u8BCC"+ "\u8BCD\u8BCE\u8BCF\u8BD0\u8BD1\u8BD2\uE6D4\uE6D3"+ @@ -2112,7 +2112,7 @@ public class X11GB18030_0 extends Charset { "\u99C6\u99C7\u99C8\u99C9\u99CA\u99CB\u99CC\u99CD"+ "\u99CE\u99CF\u99D0\u99D1\u99D2\u99D3\u99D4\u99D5"; - private final static String innerIndex4= + private static final String innerIndex4= "\u99D6\u99D7\u99D8\u99D9\u99DA\u99DB\u99DC\u99DD"+ "\u99DE\u99DF\u99E0\u99E1\u99E2\u99E3\u99E4\u99E5"+ "\u99E6\u99E7\u99E8\u99E9\u99EA\u99EB\u99EC\u99ED"+ @@ -2626,7 +2626,7 @@ public class X11GB18030_0 extends Charset { "\uB87B\uB87C\uB87D\uB87E\uB880\uB881\uB882\uB883"+ "\uB884\uD6F1\uF3C3\uB885\uB886\uF3C4\uB887\uB8CD"; - private final static String innerIndex5= + private static final String innerIndex5= "\uB888\uB889\uB88A\uF3C6\uF3C7\uB88B\uB0CA\uB88C"+ "\uF3C5\uB88D\uF3C9\uCBF1\uB88E\uB88F\uB890\uF3CB"+ "\uB891\uD0A6\uB892\uB893\uB1CA\uF3C8\uB894\uB895"+ @@ -3140,7 +3140,7 @@ public class X11GB18030_0 extends Charset { "\uD64C\uD64D\uD64E\uD64F\uD650\uD651\uD652\uD653"+ "\uD654\uD655\uD656\uD657\uD658\uD659\uD65A\uD65B"; - private final static String innerIndex6= + private static final String innerIndex6= "\uD65C\uD65D\uD65E\uD65F\uD660\uD661\uD662\uE5C0"+ "\uD663\uD664\uD665\uD666\uD667\uD668\uD669\uD66A"+ "\uD66B\uD66C\uD66D\uD66E\uD66F\uD670\uD671\uD672"+ @@ -3654,7 +3654,7 @@ public class X11GB18030_0 extends Charset { "\uF38D\uF38E\uF38F\uF390\uF391\uF392\uF393\uF394"+ "\uF395\uF7DB\uF396\uF7D9\uF397\uF398\uF399\uF39A"; - private final static String innerIndex7= + private static final String innerIndex7= "\uF39B\uF39C\uF39D\uD7D7\uF39E\uF39F\uF3A0\uF440"+ "\uF7DC\uF441\uF442\uF443\uF444\uF445\uF446\uF7DD"+ "\uF447\uF448\uF449\uF7DE\uF44A\uF44B\uF44C\uF44D"+ @@ -4168,7 +4168,7 @@ public class X11GB18030_0 extends Charset { "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"; - private final static String innerIndex8= + private static final String innerIndex8= "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ @@ -4234,7 +4234,7 @@ public class X11GB18030_0 extends Charset { "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"; - private final static short index1[] = { + private static final short index1[] = { 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 13, 14, @@ -4253,7 +4253,7 @@ public class X11GB18030_0 extends Charset { 0, 0, 0, 0, 0, 0, 0, 0, 0, 126, 127, 0, 0, 0, 128, 129 }; - private final static String index2[] = { + private static final String index2[] = { innerIndex0, innerIndex1, innerIndex2, diff --git a/jdk/src/java.desktop/unix/classes/sun/font/X11GB18030_1.java b/jdk/src/java.desktop/unix/classes/sun/font/X11GB18030_1.java index b6c18e5b72c..0d880403887 100644 --- a/jdk/src/java.desktop/unix/classes/sun/font/X11GB18030_1.java +++ b/jdk/src/java.desktop/unix/classes/sun/font/X11GB18030_1.java @@ -55,7 +55,7 @@ public class X11GB18030_1 extends Charset { protected int encodeSingle(char inputChar) { return -1; } - private final static String innerIndex0= + private static final String innerIndex0= "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ @@ -569,7 +569,7 @@ public class X11GB18030_1 extends Charset { "\u0DD2\u0DD3\u0DD4\u0DD5\u0DD6\u0DD7\u0DD8\u0DD9"+ "\u0DDA\u0DDB\u0DDC\u0DDD\u0DDE\u0DDF\u0DE0\u0DE1"; - private final static String innerIndex1= + private static final String innerIndex1= "\u0DE2\u0DE3\u0DE4\u0DE5\u0DE6\u0DE7\u0DE8\u0DE9"+ "\u0DEA\u0DEB\u0DEC\u0DED\u0DEE\u0DEF\u0DF0\u0DF1"+ "\u0DF2\u0DF3\u0DF4\u0DF5\u0DF6\u0DF7\u0DF8\u0DF9"+ @@ -1083,7 +1083,7 @@ public class X11GB18030_1 extends Charset { "\u1DD2\u1DD3\u1DD4\u1DD5\u1DD6\u1DD7\u1DD8\u1DD9"+ "\u1DDA\u1DDB\u1DDC\u1DDD\u1DDE\u1DDF\u1DE0\u1DE1"; - private final static String innerIndex2= + private static final String innerIndex2= "\u1DE2\u1DE3\u1DE4\u1DE5\u1DE6\u1DE7\u1DE8\u1DE9"+ "\u1DEA\u1DEB\u1DEC\u1DED\u1DEE\u1DEF\u1DF0\u1DF1"+ "\u1DF2\u1DF3\u1DF4\u1DF5\u1DF6\u1DF7\u1DF8\u1DF9"+ @@ -1597,7 +1597,7 @@ public class X11GB18030_1 extends Charset { "\u2CA2\u2CA3\u2CA4\u2CA5\u2CA6\u2CA7\u2CA8\u2CA9"+ "\u2CAA\u2CAB\u2CAC\u2CAD\u2CAE\u2CAF\u2CB0\u2CB1"; - private final static String innerIndex3= + private static final String innerIndex3= "\u2CB2\u2CB3\u2CB4\u2CB5\u2CB6\u2CB7\u2CB8\u2CB9"+ "\u2CBA\u2CBB\u2CBC\u2CBD\u2CBE\u2CBF\u2CC0\u2CC1"+ "\u2CC2\u2CC3\u2CC4\u2CC5\u2CC6\u2CC7\u2CC8\u2CC9"+ @@ -2111,7 +2111,7 @@ public class X11GB18030_1 extends Charset { "\u3B79\u3B7A\u3B7B\u3B7C\u3B7D\u3B7E\u3B7F\u3B80"+ "\u3B81\u3B82\u3B83\u3B84\u3B85\u3B86\u3B87\u3B88"; - private final static String innerIndex4= + private static final String innerIndex4= "\u3B89\u3B8A\u3B8B\u3B8C\u3B8D\u3B8E\u3B8F\u3B90"+ "\u3B91\u3B92\u3B93\u3B94\u3B95\u3B96\u3B97\u3B98"+ "\u3B99\u3B9A\u3B9B\u3B9C\u3B9D\u3B9E\u3B9F\u3BA0"+ @@ -2625,7 +2625,7 @@ public class X11GB18030_1 extends Charset { "\u4AAD\u4AAE\u4AAF\u4AB0\u4AB1\u4AB2\u4AB3\u4AB4"+ "\u4AB5\u4AB6\u4AB7\u4AB8\u4AB9\u4ABA\u4ABB\u4ABC"; - private final static String innerIndex5= + private static final String innerIndex5= "\u4ABD\u4ABE\u4ABF\u4AC0\u4AC1\u4AC2\u4AC3\u4AC4"+ "\u4AC5\u4AC6\u4AC7\u4AC8\u4AC9\u4ACA\u4ACB\u4ACC"+ "\u4ACD\u4ACE\u4ACF\u4AD0\u4AD1\u4AD2\u4AD3\u4AD4"+ @@ -3139,7 +3139,7 @@ public class X11GB18030_1 extends Charset { "\u5AAD\u5AAE\u5AAF\u5AB0\u5AB1\u5AB2\u5AB3\u5AB4"+ "\u5AB5\u5AB6\u5AB7\u5AB8\u5AB9\u5ABA\u5ABB\u5ABC"; - private final static String innerIndex6= + private static final String innerIndex6= "\u5ABD\u5ABE\u5ABF\u5AC0\u5AC1\u5AC2\u5AC3\u5AC4"+ "\u5AC5\u5AC6\u5AC7\u5AC8\u5AC9\u5ACA\u5ACB\u5ACC"+ "\u5ACD\u5ACE\u5ACF\u5AD0\u5AD1\u5AD2\u5AD3\u5AD4"+ @@ -3653,7 +3653,7 @@ public class X11GB18030_1 extends Charset { "\u6AAD\u6AAE\u6AAF\u6AB0\u6AB1\u6AB2\u6AB3\u6AB4"+ "\u6AB5\u6AB6\u6AB7\u6AB8\u6AB9\u6ABA\u6ABB\u6ABC"; - private final static String innerIndex7= + private static final String innerIndex7= "\u6ABD\u6ABE\u6ABF\u6AC0\u6AC1\u6AC2\u6AC3\u6AC4"+ "\u6AC5\u6AC6\u6AC7\u6AC8\u6AC9\u6ACA\u6ACB\u6ACC"+ "\u6ACD\u6ACE\u6ACF\u6AD0\u6AD1\u6AD2\u6AD3\u6AD4"+ @@ -4167,7 +4167,7 @@ public class X11GB18030_1 extends Charset { "\u7AAD\u7AAE\u7AAF\u7AB0\u7AB1\u7AB2\u7AB3\u7AB4"+ "\u7AB5\u7AB6\u7AB7\u7AB8\u7AB9\u7ABA\u7ABB\u7ABC"; - private final static String innerIndex8= + private static final String innerIndex8= "\u7ABD\u7ABE\u7ABF\u7AC0\u7AC1\u7AC2\u7AC3\u7AC4"+ "\u7AC5\u7AC6\u7AC7\u7AC8\u7AC9\u7ACA\u7ACB\u7ACC"+ "\u7ACD\u7ACE\u7ACF\u7AD0\u7AD1\u7AD2\u7AD3\u7AD4"+ @@ -4681,7 +4681,7 @@ public class X11GB18030_1 extends Charset { "\u8999\u899A\u899B\u899C\u899D\u899E\u899F\u89A0"+ "\u89A1\u89A2\u89A3\u89A4\u89A5\u89A6\u89A7\u89A8"; - private final static String innerIndex9= + private static final String innerIndex9= "\u89A9\u89AA\u89AB\u89AC\u89AD\u89AE\u89AF\u89B0"+ "\u89B1\u89B2\u89B3\u89B4\u89B5\u89B6\u89B7\u89B8"+ "\u89B9\u89BA\u89BB\u89BC\u89BD\u89BE\u89BF\u89C0"+ @@ -5195,7 +5195,7 @@ public class X11GB18030_1 extends Charset { "\u9950\u9951\u9952\u9953\u9954\u9955\u9956\u9957"+ "\u9958\u9959\u995A\u995B\u995C\u995D\u995E\u995F"; - private final static String innerIndex10= + private static final String innerIndex10= "\u9960\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ @@ -5229,7 +5229,7 @@ public class X11GB18030_1 extends Charset { "\u99EC\u99ED\u99EE\u99EF\u99F0\u99F1\u99F2\u99F3"+ "\u99F4\u99F5\u99F6\u99F7\u99F8\u0000\u99FA\u99FB"; - private final static short index1[] = { + private static final short index1[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, @@ -5248,7 +5248,7 @@ public class X11GB18030_1 extends Charset { 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160 }; - private final static String index2[] = { + private static final String index2[] = { innerIndex0, innerIndex1, innerIndex2, diff --git a/jdk/src/java.desktop/unix/classes/sun/font/X11Johab.java b/jdk/src/java.desktop/unix/classes/sun/font/X11Johab.java index b70b8af4828..814e175483c 100644 --- a/jdk/src/java.desktop/unix/classes/sun/font/X11Johab.java +++ b/jdk/src/java.desktop/unix/classes/sun/font/X11Johab.java @@ -55,7 +55,7 @@ public class X11Johab extends Charset { return true; } - private final static String innerIndex0= + private static final String innerIndex0= "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ @@ -569,7 +569,7 @@ public class X11Johab extends Charset { "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"; - private final static String innerIndex1= + private static final String innerIndex1= "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ @@ -1083,7 +1083,7 @@ public class X11Johab extends Charset { "\uE978\u0000\u0000\u0000\uF866\u0000\uE4F6\u0000"+ "\u0000\u0000\u0000\uF3DA\u0000\uF894\u0000\u0000"; - private final static String innerIndex2= + private static final String innerIndex2= "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEC9F"+ "\u0000\u0000\u0000\u0000\u0000\uE5CF\uE39A\u0000"+ "\u0000\uE1DF\u0000\u0000\uF5CB\u0000\uED92\uE0AB"+ @@ -1597,7 +1597,7 @@ public class X11Johab extends Charset { "\uF6C1\u0000\u0000\uEEB6\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"; - private final static String innerIndex3= + private static final String innerIndex3= "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\uEDC7\uE63C\u0000\u0000\u0000"+ "\u0000\uE957\u0000\u0000\u0000\u0000\u0000\uEBA9"+ @@ -2111,7 +2111,7 @@ public class X11Johab extends Charset { "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\uE1A7\u0000\u0000\uE33C\u0000"; - private final static String innerIndex4= + private static final String innerIndex4= "\uE3BA\u0000\uF3C4\u0000\uEDB3\uF8F5\uEFE1\uF9E0"+ "\uF94C\u0000\uE832\uE833\u0000\uE431\u0000\u0000"+ "\uE491\u0000\u0000\u0000\uEC7D\u0000\u0000\uEA79"+ @@ -2625,7 +2625,7 @@ public class X11Johab extends Charset { "\u0000\u0000\u0000\u0000\uE695\u0000\u0000\u0000"+ "\u0000\u0000\u0000\uE9B8\uE2C5\uEADF\u0000\u0000"; - private final static String innerIndex5= + private static final String innerIndex5= "\u0000\u0000\u0000\u0000\uF44E\uF631\u0000\uF0CB"+ "\uF3FC\u0000\uF4C7\u0000\u0000\uEB7B\u0000\u0000"+ "\u0000\u0000\u0000\uF1FC\u0000\u0000\uEBDB\u0000"+ @@ -3139,7 +3139,7 @@ public class X11Johab extends Charset { "\u0000\u0000\u0000\uE995\uE7B0\u0000\uEE79\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"; - private final static String innerIndex6= + private static final String innerIndex6= "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\uED4C\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ @@ -3653,7 +3653,7 @@ public class X11Johab extends Charset { "\u9E89\u9E8A\u9E8B\u9E8C\u9E8D\u9E8E\u9E8F\u9E90"+ "\u9E91\u9E93\u9E94\u9E95\u9E96\u9E97\u9E98\u9E99"; - private final static String innerIndex7= + private static final String innerIndex7= "\u9E9A\u9E9B\u9E9C\u9E9D\u9EA1\u9EA2\u9EA3\u9EA4"+ "\u9EA5\u9EA6\u9EA7\u9EA8\u9EA9\u9EAA\u9EAB\u9EAC"+ "\u9EAD\u9EAE\u9EAF\u9EB0\u9EB1\u9EB3\u9EB4\u9EB5"+ @@ -4167,7 +4167,7 @@ public class X11Johab extends Charset { "\uBA71\uBA73\uBA74\uBA75\uBA76\uBA77\uBA78\uBA79"+ "\uBA7A\uBA7B\uBA7C\uBA7D\uBA81\uBA82\uBA83\uBA84"; - private final static String innerIndex8= + private static final String innerIndex8= "\uBA85\uBA86\uBA87\uBA88\uBA89\uBA8A\uBA8B\uBA8C"+ "\uBA8D\uBA8E\uBA8F\uBA90\uBA91\uBA93\uBA94\uBA95"+ "\uBA96\uBA97\uBA98\uBA99\uBA9A\uBA9B\uBA9C\uBA9D"+ @@ -4681,7 +4681,7 @@ public class X11Johab extends Charset { "\uF171\uF174\uF177\uF178\uF199\uF19A\uF19C\uF1A1"+ "\uF1A2\uF1A3\uF1EE\uF26B\uF44D\uF49C\uF4B1\uF537"; - private final static String innerIndex9= + private static final String innerIndex9= "\uF57E\uF696\uF698\uF6B8\uF6C8\uF6D3\uF76B\uF792"+ "\uF831\uF832\uF876\uF939\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ @@ -4747,7 +4747,7 @@ public class X11Johab extends Charset { "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"; - private final static short index1[] = { + private static final short index1[] = { 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/jdk/src/java.desktop/unix/classes/sun/font/X11SunUnicode_0.java b/jdk/src/java.desktop/unix/classes/sun/font/X11SunUnicode_0.java index 9c666e0ff29..1ac132f83ab 100644 --- a/jdk/src/java.desktop/unix/classes/sun/font/X11SunUnicode_0.java +++ b/jdk/src/java.desktop/unix/classes/sun/font/X11SunUnicode_0.java @@ -55,7 +55,7 @@ public class X11SunUnicode_0 extends Charset { super(cs, index1, index2); } - private final static String innerIndex0= + private static final String innerIndex0= "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ @@ -121,7 +121,7 @@ public class X11SunUnicode_0 extends Charset { "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+ "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"; - private final static short index1[] = { + private static final short index1[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -140,7 +140,7 @@ public class X11SunUnicode_0 extends Charset { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - private final static String index2[] = { + private static final String index2[] = { innerIndex0 }; diff --git a/jdk/src/java.desktop/unix/classes/sun/java2d/jules/IdleTileCache.java b/jdk/src/java.desktop/unix/classes/sun/java2d/jules/IdleTileCache.java index f7040dacde2..f54d2ad0f29 100644 --- a/jdk/src/java.desktop/unix/classes/sun/java2d/jules/IdleTileCache.java +++ b/jdk/src/java.desktop/unix/classes/sun/java2d/jules/IdleTileCache.java @@ -28,8 +28,8 @@ package sun.java2d.jules; import java.util.*; public class IdleTileCache { - final static int IDLE_TILE_SYNC_GRANULARITY = 16; - final static ArrayList idleBuffers = new ArrayList(); + static final int IDLE_TILE_SYNC_GRANULARITY = 16; + static final ArrayList idleBuffers = new ArrayList(); ArrayList idleTileWorkerCacheList = new ArrayList(); ArrayList idleTileConsumerCacheList = diff --git a/jdk/src/java.desktop/unix/classes/sun/java2d/jules/JulesAATileGenerator.java b/jdk/src/java.desktop/unix/classes/sun/java2d/jules/JulesAATileGenerator.java index 47c91b4f1c1..e22f32ea7f1 100644 --- a/jdk/src/java.desktop/unix/classes/sun/java2d/jules/JulesAATileGenerator.java +++ b/jdk/src/java.desktop/unix/classes/sun/java2d/jules/JulesAATileGenerator.java @@ -33,13 +33,13 @@ import sun.java2d.xr.*; public class JulesAATileGenerator implements AATileGenerator { /* Threading stuff */ - final static ExecutorService rasterThreadPool = + static final ExecutorService rasterThreadPool = Executors.newCachedThreadPool(); - final static int CPU_CNT = Runtime.getRuntime().availableProcessors(); + static final int CPU_CNT = Runtime.getRuntime().availableProcessors(); - final static boolean ENABLE_THREADING = false; - final static int THREAD_MIN = 16; - final static int THREAD_BEGIN = 16; + static final boolean ENABLE_THREADING = false; + static final int THREAD_MIN = 16; + static final int THREAD_BEGIN = 16; IdleTileCache tileCache; TileWorker worker; @@ -47,8 +47,8 @@ public class JulesAATileGenerator implements AATileGenerator { int rasterTileCnt; /* Tiling */ - final static int TILE_SIZE = 32; - final static int TILE_SIZE_FP = 32 << 16; + static final int TILE_SIZE = 32; + static final int TILE_SIZE_FP = 32 << 16; int left, right, top, bottom, width, height; int leftFP, topFP; int tileCnt, tilesX, tilesY; diff --git a/jdk/src/java.desktop/unix/classes/sun/java2d/jules/TileWorker.java b/jdk/src/java.desktop/unix/classes/sun/java2d/jules/TileWorker.java index 871602dfee4..494ccbe27f7 100644 --- a/jdk/src/java.desktop/unix/classes/sun/java2d/jules/TileWorker.java +++ b/jdk/src/java.desktop/unix/classes/sun/java2d/jules/TileWorker.java @@ -28,7 +28,7 @@ package sun.java2d.jules; import java.util.*; public class TileWorker implements Runnable { - final static int RASTERIZED_TILE_SYNC_GRANULARITY = 8; + static final int RASTERIZED_TILE_SYNC_GRANULARITY = 8; final ArrayList rasterizedTileConsumerCache = new ArrayList(); final LinkedList rasterizedBuffers = new LinkedList(); diff --git a/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XIDGenerator.java b/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XIDGenerator.java index a9e132c776f..b99666bb3b0 100644 --- a/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XIDGenerator.java +++ b/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XIDGenerator.java @@ -34,7 +34,7 @@ package sun.java2d.xr; */ public class XIDGenerator { - private final static int XID_BUFFER_SIZE = 512; + private static final int XID_BUFFER_SIZE = 512; int[] xidBuffer = new int[XID_BUFFER_SIZE]; int currentIndex = XID_BUFFER_SIZE; diff --git a/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRBackendNative.java b/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRBackendNative.java index e7cac195001..9f0810e418d 100644 --- a/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRBackendNative.java +++ b/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRBackendNative.java @@ -107,7 +107,7 @@ public class XRBackendNative implements XRBackend { int x1, int y1, int x2, int y2, int numStops, int repeat); - private native static int + private static native int XRCreateRadialGradientPaintNative(float[] fractionsArray, short[] pixelsArray, int numStops, int centerX, int centerY, diff --git a/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRCompositeManager.java b/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRCompositeManager.java index 1b4ff652056..b58e01ef561 100644 --- a/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRCompositeManager.java +++ b/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XRCompositeManager.java @@ -48,9 +48,9 @@ public class XRCompositeManager { private static boolean enableGradCache = true; private static XRCompositeManager instance; - private final static int SOLID = 0; - private final static int TEXTURE = 1; - private final static int GRADIENT = 2; + private static final int SOLID = 0; + private static final int TEXTURE = 1; + private static final int GRADIENT = 2; int srcType; XRSolidSrcPict solidSrc32; diff --git a/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XcbRequestCounter.java b/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XcbRequestCounter.java index 963eb98c03a..3bd4bf4702f 100644 --- a/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XcbRequestCounter.java +++ b/jdk/src/java.desktop/unix/classes/sun/java2d/xr/XcbRequestCounter.java @@ -32,7 +32,7 @@ package sun.java2d.xr; */ public class XcbRequestCounter { - private final static long MAX_UINT = 4294967295L; + private static final long MAX_UINT = 4294967295L; long value; diff --git a/jdk/src/java.desktop/unix/classes/sun/print/IPPPrintService.java b/jdk/src/java.desktop/unix/classes/sun/print/IPPPrintService.java index e077a771b1a..4b482596962 100644 --- a/jdk/src/java.desktop/unix/classes/sun/print/IPPPrintService.java +++ b/jdk/src/java.desktop/unix/classes/sun/print/IPPPrintService.java @@ -83,7 +83,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService { private String printer; private URI myURI; private URL myURL; - transient private ServiceNotifier notifier = null; + private transient ServiceNotifier notifier = null; private static int MAXCOPIES = 1000; private static short MAX_ATTRIBUTE_LENGTH = 255; diff --git a/jdk/src/java.desktop/unix/classes/sun/print/UnixPrintJob.java b/jdk/src/java.desktop/unix/classes/sun/print/UnixPrintJob.java index 46a776e3b3d..a0891b4b4ff 100644 --- a/jdk/src/java.desktop/unix/classes/sun/print/UnixPrintJob.java +++ b/jdk/src/java.desktop/unix/classes/sun/print/UnixPrintJob.java @@ -90,9 +90,9 @@ import java.awt.print.*; public class UnixPrintJob implements CancelablePrintJob { private static String debugPrefix = "UnixPrintJob>> "; - transient private Vector jobListeners; - transient private Vector attrListeners; - transient private Vector listenedAttributeSets; + private transient Vector jobListeners; + private transient Vector attrListeners; + private transient Vector listenedAttributeSets; private PrintService service; private boolean fidelity; diff --git a/jdk/src/java.desktop/unix/classes/sun/print/UnixPrintService.java b/jdk/src/java.desktop/unix/classes/sun/print/UnixPrintService.java index 91f0e2350ca..c02a57cdc3e 100644 --- a/jdk/src/java.desktop/unix/classes/sun/print/UnixPrintService.java +++ b/jdk/src/java.desktop/unix/classes/sun/print/UnixPrintService.java @@ -192,8 +192,8 @@ public class UnixPrintService implements PrintService, AttributeUpdater, private PrinterName name; private boolean isInvalid; - transient private PrintServiceAttributeSet lastSet; - transient private ServiceNotifier notifier = null; + private transient PrintServiceAttributeSet lastSet; + private transient ServiceNotifier notifier = null; UnixPrintService(String name) { if (name == null) { diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WComponentPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WComponentPeer.java index 6c40c230120..51e16b0a1f1 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WComponentPeer.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WComponentPeer.java @@ -233,7 +233,7 @@ public abstract class WComponentPeer extends WObjectPeer paintArea.paint(target, shouldClearRectBeforePaint()); } - native synchronized void updateWindow(); + synchronized native void updateWindow(); @Override public void paint(Graphics g) { @@ -566,7 +566,7 @@ public abstract class WComponentPeer extends WObjectPeer } // fallback default font object - final static Font defaultFont = new Font(Font.DIALOG, Font.PLAIN, 12); + static final Font defaultFont = new Font(Font.DIALOG, Font.PLAIN, 12); @Override public Graphics getGraphics() { diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WDialogPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WDialogPeer.java index fea3588ffec..86c708006c1 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WDialogPeer.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WDialogPeer.java @@ -35,7 +35,7 @@ final class WDialogPeer extends WWindowPeer implements DialogPeer { // Platform default background for dialogs. Gets set on target if // target has none explicitly specified. - final static Color defaultBackground = SystemColor.control; + static final Color defaultBackground = SystemColor.control; // If target doesn't have its background color set, we set its // background to platform default. diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WFramePeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WFramePeer.java index 37486e18eba..b60fb0b082b 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WFramePeer.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WFramePeer.java @@ -195,7 +195,7 @@ class WFramePeer extends WWindowPeer implements FramePeer { setState(target.getExtendedState()); } - private native static int getSysMenuHeight(); + private static native int getSysMenuHeight(); native void pSetIMMOption(String option); void notifyIMMOptionChange(){ diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java index aaf2df9c5d0..4bd8f7b5e98 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java @@ -67,23 +67,23 @@ final class WInputMethod extends InputMethodAdapter private boolean statusWindowHidden = false; // attribute definition in Win32 (in IMM.H) - public final static byte ATTR_INPUT = 0x00; - public final static byte ATTR_TARGET_CONVERTED = 0x01; - public final static byte ATTR_CONVERTED = 0x02; - public final static byte ATTR_TARGET_NOTCONVERTED = 0x03; - public final static byte ATTR_INPUT_ERROR = 0x04; + public static final byte ATTR_INPUT = 0x00; + public static final byte ATTR_TARGET_CONVERTED = 0x01; + public static final byte ATTR_CONVERTED = 0x02; + public static final byte ATTR_TARGET_NOTCONVERTED = 0x03; + public static final byte ATTR_INPUT_ERROR = 0x04; // cmode definition in Win32 (in IMM.H) - public final static int IME_CMODE_ALPHANUMERIC = 0x0000; - public final static int IME_CMODE_NATIVE = 0x0001; - public final static int IME_CMODE_KATAKANA = 0x0002; - public final static int IME_CMODE_LANGUAGE = 0x0003; - public final static int IME_CMODE_FULLSHAPE = 0x0008; - public final static int IME_CMODE_HANJACONVERT = 0x0040; - public final static int IME_CMODE_ROMAN = 0x0010; + public static final int IME_CMODE_ALPHANUMERIC = 0x0000; + public static final int IME_CMODE_NATIVE = 0x0001; + public static final int IME_CMODE_KATAKANA = 0x0002; + public static final int IME_CMODE_LANGUAGE = 0x0003; + public static final int IME_CMODE_FULLSHAPE = 0x0008; + public static final int IME_CMODE_HANJACONVERT = 0x0040; + public static final int IME_CMODE_ROMAN = 0x0010; // flag values for endCompositionNative() behavior - private final static boolean COMMIT_INPUT = true; - private final static boolean DISCARD_INPUT = false; + private static final boolean COMMIT_INPUT = true; + private static final boolean DISCARD_INPUT = false; private static Map [] highlightStyles; diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WObjectPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WObjectPeer.java index 83f7c586f2a..c456df27dd9 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WObjectPeer.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WObjectPeer.java @@ -66,7 +66,7 @@ abstract class WObjectPeer { * Subclasses should override disposeImpl() instead of dispose(). Client * code should always invoke dispose(), never disposeImpl(). */ - abstract protected void disposeImpl(); + protected abstract void disposeImpl(); public final void dispose() { boolean call_disposeImpl = false; diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WScrollPanePeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WScrollPanePeer.java index 4b083475db9..325da0f8d06 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WScrollPanePeer.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WScrollPanePeer.java @@ -78,7 +78,7 @@ final class WScrollPanePeer extends WPanelPeer implements ScrollPanePeer { private native void setInsets(); @Override - public native synchronized void setScrollPosition(int x, int y); + public synchronized native void setScrollPosition(int x, int y); @Override public int getHScrollbarHeight() { @@ -112,7 +112,7 @@ final class WScrollPanePeer extends WPanelPeer implements ScrollPanePeer { setInsets(); } - native synchronized void setSpans(int viewWidth, int viewHeight, + synchronized native void setSpans(int viewWidth, int viewHeight, int childWidth, int childHeight); /** diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java index e4e6675acde..970ab07f843 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java @@ -832,7 +832,7 @@ public final class WToolkit extends SunToolkit implements Runnable { * Have Win32GraphicsEnvironment execute the display change code on the * Event thread. */ - static public void displayChanged() { + public static void displayChanged() { EventQueue.invokeLater(new Runnable() { @Override public void run() { @@ -1127,7 +1127,7 @@ public final class WToolkit extends SunToolkit implements Runnable { return areExtraMouseButtonsEnabled; } - private native synchronized int getNumberOfButtonsImpl(); + private synchronized native int getNumberOfButtonsImpl(); @Override public int getNumberOfButtons(){ diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java index e88411d6537..09b564f194e 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java @@ -40,9 +40,9 @@ import sun.awt.SunToolkit; import sun.awt.image.IntegerComponentRaster; final class WTrayIconPeer extends WObjectPeer implements TrayIconPeer { - final static int TRAY_ICON_WIDTH = 16; - final static int TRAY_ICON_HEIGHT = 16; - final static int TRAY_ICON_MASK_SIZE = (TRAY_ICON_WIDTH * TRAY_ICON_HEIGHT) / 8; + static final int TRAY_ICON_WIDTH = 16; + static final int TRAY_ICON_HEIGHT = 16; + static final int TRAY_ICON_MASK_SIZE = (TRAY_ICON_WIDTH * TRAY_ICON_HEIGHT) / 8; IconObserver observer = new IconObserver(); boolean firstUpdate = true; diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java index 1a8c8de70bb..5605ecd04bd 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java @@ -59,7 +59,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, * is a list of windows, sorted by the time of activation: later a window is * activated, greater its index is in the list. */ - private final static StringBuffer ACTIVE_WINDOWS_KEY = + private static final StringBuffer ACTIVE_WINDOWS_KEY = new StringBuffer("active_windows_list"); /* @@ -72,7 +72,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, /* * The object is a listener for the AppContext.GUI_DISPOSED property. */ - private final static PropertyChangeListener guiDisposedListener = + private static final PropertyChangeListener guiDisposedListener = new GuiDisposedListener(); /* diff --git a/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DPaints.java b/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DPaints.java index b328ce3a083..7d5bd4423ea 100644 --- a/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DPaints.java +++ b/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DPaints.java @@ -158,7 +158,7 @@ abstract class D3DPaints { /****************** Shared MultipleGradientPaint support ********************/ - private static abstract class MultiGradient extends D3DPaints { + private abstract static class MultiGradient extends D3DPaints { /** * Note that this number is lower than the MULTI_MAX_FRACTIONS diff --git a/jdk/src/java.desktop/windows/classes/sun/print/Win32MediaTray.java b/jdk/src/java.desktop/windows/classes/sun/print/Win32MediaTray.java index 79198ec4655..43ce6a19d6a 100644 --- a/jdk/src/java.desktop/windows/classes/sun/print/Win32MediaTray.java +++ b/jdk/src/java.desktop/windows/classes/sun/print/Win32MediaTray.java @@ -59,7 +59,7 @@ public class Win32MediaTray extends MediaTray { winID = id; } - private synchronized static int nextValue(String name) { + private static synchronized int nextValue(String name) { winStringTable.add(name); return (getTraySize()-1); } diff --git a/jdk/src/java.desktop/windows/classes/sun/print/Win32PrintJob.java b/jdk/src/java.desktop/windows/classes/sun/print/Win32PrintJob.java index df8b9923a5e..1933f8b659f 100644 --- a/jdk/src/java.desktop/windows/classes/sun/print/Win32PrintJob.java +++ b/jdk/src/java.desktop/windows/classes/sun/print/Win32PrintJob.java @@ -79,9 +79,9 @@ import java.awt.print.*; public class Win32PrintJob implements CancelablePrintJob { - transient private Vector jobListeners; - transient private Vector attrListeners; - transient private Vector listenedAttributeSets; + private transient Vector jobListeners; + private transient Vector attrListeners; + private transient Vector listenedAttributeSets; private Win32PrintService service; private boolean fidelity; diff --git a/jdk/src/java.desktop/windows/classes/sun/print/Win32PrintService.java b/jdk/src/java.desktop/windows/classes/sun/print/Win32PrintService.java index d99fee887db..cdb18138ed3 100644 --- a/jdk/src/java.desktop/windows/classes/sun/print/Win32PrintService.java +++ b/jdk/src/java.desktop/windows/classes/sun/print/Win32PrintService.java @@ -195,8 +195,8 @@ public class Win32PrintService implements PrintService, AttributeUpdater, private PrinterName name; private String port; - transient private PrintServiceAttributeSet lastSet; - transient private ServiceNotifier notifier = null; + private transient PrintServiceAttributeSet lastSet; + private transient ServiceNotifier notifier = null; private MediaSizeName[] mediaSizeNames; private MediaPrintableArea[] mediaPrintables; @@ -1734,7 +1734,7 @@ class Win32MediaSize extends MediaSizeName { } - private synchronized static int nextValue(String name) { + private static synchronized int nextValue(String name) { winStringTable.add(name); return (winStringTable.size()-1); } From 69e41447a6f459441fa5de95bad783ec0e56b7fd Mon Sep 17 00:00:00 2001 From: Renjith Alexander Date: Tue, 22 Sep 2015 12:26:50 +0300 Subject: [PATCH 09/81] 8132380: Do not create LaF instance in javax/swing/plaf/windows/6921687/bug6921687.java Reviewed-by: yan, ssadetsky --- .../plaf/windows/6921687/bug6921687.java | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/jdk/test/javax/swing/plaf/windows/6921687/bug6921687.java b/jdk/test/javax/swing/plaf/windows/6921687/bug6921687.java index 73e0e3d82e5..37c641cad2b 100644 --- a/jdk/test/javax/swing/plaf/windows/6921687/bug6921687.java +++ b/jdk/test/javax/swing/plaf/windows/6921687/bug6921687.java @@ -21,22 +21,27 @@ * questions. */ -/* @test - @bug 6921687 8079428 - @summary Mnemonic disappears after repeated attempts to open menu items using - mnemonics - @author Semyon Sadetsky - @library /lib/testlibrary - @build jdk.testlibrary.OSInfo - @run main bug6921687 - */ - - -import jdk.testlibrary.OSInfo; -import javax.swing.*; -import java.awt.*; +/* + * @test + * @bug 6921687 8079428 + * @summary Mnemonic disappears after repeated attempts to open menu items using + * mnemonics + * @author Semyon Sadetsky + * @library /lib/testlibrary + * @build jdk.testlibrary.Platform + * @requires (os.family == "windows") + * @modules java.desktop/com.sun.java.swing.plaf.windows + * @run main bug6921687 + */ +import java.awt.Robot; import java.awt.event.KeyEvent; - +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import jdk.testlibrary.Platform; public class bug6921687 { @@ -44,24 +49,24 @@ public class bug6921687 { private static JFrame frame; public static void main(String[] args) throws Exception { - if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) { + if (!Platform.isWindows()) { System.out.println("Only Windows platform test. Test is skipped."); System.out.println("ok"); return; } - lafClass = Class.forName(UIManager.getSystemLookAndFeelClassName()); - UIManager.setLookAndFeel((LookAndFeel) lafClass.newInstance()); + final String lafClassName = UIManager.getSystemLookAndFeelClassName(); + lafClass = Class.forName(lafClassName); + UIManager.setLookAndFeel(lafClassName); try { - SwingUtilities.invokeAndWait(new Runnable() { - public void run() { - frame = new JFrame(); - frame.setUndecorated(true); - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - setup(frame); - } + SwingUtilities.invokeAndWait(() -> { + frame = new JFrame(); + frame.setUndecorated(true); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setup(frame); }); final Robot robot = new Robot(); + robot.waitForIdle(); robot.setAutoDelay(20); robot.keyPress(KeyEvent.VK_ALT); robot.keyPress(KeyEvent.VK_F); @@ -108,6 +113,5 @@ public class bug6921687 { frame.setSize(350, 250); frame.setVisible(true); - } } From 2c3b2dd68ee917b08e28ba05315285076778ed2d Mon Sep 17 00:00:00 2001 From: Alexander Scherbatiy Date: Tue, 22 Sep 2015 14:05:37 +0400 Subject: [PATCH 10/81] 8133453: Deprecate AWTKeyStroke.registerSubclass(Class) method Reviewed-by: serb, azvegint --- .../share/classes/java/awt/AWTKeyStroke.java | 125 ++------------- .../share/classes/javax/swing/KeyStroke.java | 17 +- .../classes/sun/swing/SwingAccessor.java | 30 ++++ .../RegisterKeyStroke/TestAWTKeyStroke.java | 148 ++++++++++++++++++ .../event/KeyEvent/RegisterKeyStroke/policy | 2 + 5 files changed, 201 insertions(+), 121 deletions(-) create mode 100644 jdk/test/java/awt/event/KeyEvent/RegisterKeyStroke/TestAWTKeyStroke.java create mode 100644 jdk/test/java/awt/event/KeyEvent/RegisterKeyStroke/policy diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java b/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java index 67eff6256fb..f49b16badd2 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java @@ -32,12 +32,9 @@ import java.util.HashMap; import java.util.Map; import java.util.StringTokenizer; import java.io.Serializable; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Modifier; import java.lang.reflect.Field; +import sun.swing.SwingAccessor; /** * An AWTKeyStroke represents a key action on the @@ -80,21 +77,6 @@ public class AWTKeyStroke implements Serializable { //A key withing the cache private static AWTKeyStroke APP_CONTEXT_KEYSTROKE_KEY = new AWTKeyStroke(); - /* - * Reads keystroke class from AppContext and if null, puts there the - * AWTKeyStroke class. - * Must be called under locked AWTKeyStroke - */ - private static Class getAWTKeyStrokeClass() { - @SuppressWarnings("unchecked") - Class clazz = (Class)AppContext.getAppContext().get(AWTKeyStroke.class); - if (clazz == null) { - clazz = AWTKeyStroke.class; - AppContext.getAppContext().put(AWTKeyStroke.class, AWTKeyStroke.class); - } - return clazz; - } - private char keyChar = KeyEvent.CHAR_UNDEFINED; private int keyCode = KeyEvent.VK_UNDEFINED; private int modifiers; @@ -160,92 +142,15 @@ public class AWTKeyStroke implements Serializable { } /** - * Registers a new class which the factory methods in - * AWTKeyStroke will use when generating new - * instances of AWTKeyStrokes. After invoking this - * method, the factory methods will return instances of the specified - * Class. The specified Class must be either AWTKeyStroke - * or derived from AWTKeyStroke, and it must have a - * no-arg constructor. The constructor can be of any accessibility, - * including private. This operation - * flushes the current AWTKeyStroke cache. + * The method has no effect and is only left present to avoid introducing + * a binary incompatibility. * * @param subclass the new Class of which the factory methods should create * instances - * @throws IllegalArgumentException if subclass is null, - * or if subclass does not have a no-arg constructor - * @throws ClassCastException if subclass is not - * AWTKeyStroke, or a class derived from - * AWTKeyStroke + * @deprecated */ + @Deprecated protected static void registerSubclass(Class subclass) { - if (subclass == null) { - throw new IllegalArgumentException("subclass cannot be null"); - } - synchronized (AWTKeyStroke.class) { - @SuppressWarnings("unchecked") - Class keyStrokeClass = (Class)AppContext.getAppContext().get(AWTKeyStroke.class); - if (keyStrokeClass != null && keyStrokeClass.equals(subclass)){ - // Already registered - return; - } - } - if (!AWTKeyStroke.class.isAssignableFrom(subclass)) { - throw new ClassCastException("subclass is not derived from AWTKeyStroke"); - } - - Constructor ctor = getCtor(subclass); - - String couldNotInstantiate = "subclass could not be instantiated"; - - if (ctor == null) { - throw new IllegalArgumentException(couldNotInstantiate); - } - try { - AWTKeyStroke stroke = (AWTKeyStroke)ctor.newInstance((Object[]) null); - if (stroke == null) { - throw new IllegalArgumentException(couldNotInstantiate); - } - } catch (NoSuchMethodError e) { - throw new IllegalArgumentException(couldNotInstantiate); - } catch (ExceptionInInitializerError e) { - throw new IllegalArgumentException(couldNotInstantiate); - } catch (InstantiationException e) { - throw new IllegalArgumentException(couldNotInstantiate); - } catch (IllegalAccessException e) { - throw new IllegalArgumentException(couldNotInstantiate); - } catch (InvocationTargetException e) { - throw new IllegalArgumentException(couldNotInstantiate); - } - - synchronized (AWTKeyStroke.class) { - AppContext.getAppContext().put(AWTKeyStroke.class, subclass); - AppContext.getAppContext().remove(APP_CONTEXT_CACHE_KEY); - AppContext.getAppContext().remove(APP_CONTEXT_KEYSTROKE_KEY); - } - } - - /* returns no-arg Constructor for class with accessible flag. No security - threat as accessible flag is set only for this Constructor object, - not for Class constructor. - */ - private static Constructor getCtor(final Class clazz) - { - Constructor ctor = AccessController.doPrivileged(new PrivilegedAction>() { - public Constructor run() { - try { - Constructor ctor = clazz.getDeclaredConstructor((Class[]) null); - if (ctor != null) { - ctor.setAccessible(true); - } - return ctor; - } catch (SecurityException e) { - } catch (NoSuchMethodException e) { - } - return null; - } - }); - return ctor; } private static synchronized AWTKeyStroke getCachedStroke @@ -261,18 +166,10 @@ public class AWTKeyStroke implements Serializable { } if (cacheKey == null) { - try { - Class clazz = getAWTKeyStrokeClass(); - cacheKey = (AWTKeyStroke)getCtor(clazz).newInstance((Object[]) null); - AppContext.getAppContext().put(APP_CONTEXT_KEYSTROKE_KEY, cacheKey); - } catch (InstantiationException e) { - assert(false); - } catch (IllegalAccessException e) { - assert(false); - } catch (InvocationTargetException e) { - assert(false); - } + cacheKey = SwingAccessor.getKeyStrokeAccessor().create(); + AppContext.getAppContext().put(APP_CONTEXT_KEYSTROKE_KEY, cacheKey); } + cacheKey.keyChar = keyChar; cacheKey.keyCode = keyCode; cacheKey.modifiers = mapNewModifiers(mapOldModifiers(modifiers)); @@ -806,11 +703,9 @@ public class AWTKeyStroke implements Serializable { */ protected Object readResolve() throws java.io.ObjectStreamException { synchronized (AWTKeyStroke.class) { - if (getClass().equals(getAWTKeyStrokeClass())) { - return getCachedStroke(keyChar, keyCode, modifiers, onKeyRelease); - } + + return getCachedStroke(keyChar, keyCode, modifiers, onKeyRelease); } - return this; } private static int mapOldModifiers(int modifiers) { diff --git a/jdk/src/java.desktop/share/classes/javax/swing/KeyStroke.java b/jdk/src/java.desktop/share/classes/javax/swing/KeyStroke.java index 24969f76aec..ebe6a126e55 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/KeyStroke.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/KeyStroke.java @@ -26,6 +26,7 @@ package javax.swing; import java.awt.AWTKeyStroke; import java.awt.event.KeyEvent; +import sun.swing.SwingAccessor; /** * A KeyStroke represents a key action on the keyboard, or equivalent input @@ -70,6 +71,16 @@ public class KeyStroke extends AWTKeyStroke { */ private static final long serialVersionUID = -9060180771037902530L; + static { + SwingAccessor.setKeyStrokeAccessor(new SwingAccessor.KeyStrokeAccessor() { + + @Override + public KeyStroke create() { + return new KeyStroke(); + } + }); + } + private KeyStroke() { } private KeyStroke(char keyChar, int keyCode, int modifiers, @@ -87,7 +98,6 @@ public class KeyStroke extends AWTKeyStroke { */ public static KeyStroke getKeyStroke(char keyChar) { synchronized (AWTKeyStroke.class) { - registerSubclass(KeyStroke.class); return (KeyStroke)getAWTKeyStroke(keyChar); } } @@ -148,7 +158,6 @@ public class KeyStroke extends AWTKeyStroke { */ public static KeyStroke getKeyStroke(Character keyChar, int modifiers) { synchronized (AWTKeyStroke.class) { - registerSubclass(KeyStroke.class); return (KeyStroke)getAWTKeyStroke(keyChar, modifiers); } } @@ -199,7 +208,6 @@ public class KeyStroke extends AWTKeyStroke { public static KeyStroke getKeyStroke(int keyCode, int modifiers, boolean onKeyRelease) { synchronized (AWTKeyStroke.class) { - registerSubclass(KeyStroke.class); return (KeyStroke)getAWTKeyStroke(keyCode, modifiers, onKeyRelease); } @@ -247,7 +255,6 @@ public class KeyStroke extends AWTKeyStroke { */ public static KeyStroke getKeyStroke(int keyCode, int modifiers) { synchronized (AWTKeyStroke.class) { - registerSubclass(KeyStroke.class); return (KeyStroke)getAWTKeyStroke(keyCode, modifiers); } } @@ -266,7 +273,6 @@ public class KeyStroke extends AWTKeyStroke { */ public static KeyStroke getKeyStrokeForEvent(KeyEvent anEvent) { synchronized (AWTKeyStroke.class) { - registerSubclass(KeyStroke.class); return (KeyStroke)getAWTKeyStrokeForEvent(anEvent); } } @@ -307,7 +313,6 @@ public class KeyStroke extends AWTKeyStroke { return null; } synchronized (AWTKeyStroke.class) { - registerSubclass(KeyStroke.class); try { return (KeyStroke)getAWTKeyStroke(s); } catch (IllegalArgumentException e) { diff --git a/jdk/src/java.desktop/share/classes/sun/swing/SwingAccessor.java b/jdk/src/java.desktop/share/classes/sun/swing/SwingAccessor.java index 37aa744a69b..da637f0625c 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/SwingAccessor.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/SwingAccessor.java @@ -97,6 +97,14 @@ public final class SwingAccessor { int ownerX, int ownerY); } + /* + * An accessor for the KeyStroke class + */ + public interface KeyStrokeAccessor { + + KeyStroke create(); + } + /** * The javax.swing.text.JTextComponent class accessor object. */ @@ -185,4 +193,26 @@ public final class SwingAccessor { public static void setPopupFactoryAccessor(PopupFactoryAccessor popupFactoryAccessor) { SwingAccessor.popupFactoryAccessor = popupFactoryAccessor; } + + /** + * The KeyStroke class accessor object. + */ + private static KeyStrokeAccessor keyStrokeAccessor; + + /** + * Retrieve the accessor object for the KeyStroke class. + */ + public static KeyStrokeAccessor getKeyStrokeAccessor() { + if (keyStrokeAccessor == null) { + unsafe.ensureClassInitialized(KeyStroke.class); + } + return keyStrokeAccessor; + } + + /* + * Set the accessor object for the KeyStroke class. + */ + public static void setKeyStrokeAccessor(KeyStrokeAccessor accessor) { + SwingAccessor.keyStrokeAccessor = accessor; + } } diff --git a/jdk/test/java/awt/event/KeyEvent/RegisterKeyStroke/TestAWTKeyStroke.java b/jdk/test/java/awt/event/KeyEvent/RegisterKeyStroke/TestAWTKeyStroke.java new file mode 100644 index 00000000000..a6221b480c5 --- /dev/null +++ b/jdk/test/java/awt/event/KeyEvent/RegisterKeyStroke/TestAWTKeyStroke.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.AWTKeyStroke; +import java.awt.event.InputEvent; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInput; +import java.io.ObjectInputStream; +import java.io.ObjectOutput; +import java.io.ObjectOutputStream; +import javax.swing.KeyStroke; + +/* + * @test + * @bug 8133453 + * @summary Remove AWTKeyStroke.registerSubclass(Class) method + * @author Alexander Scherbatiy + * @run main/othervm TestAWTKeyStroke + * @run main/othervm/policy=policy -Djava.security.manager TestAWTKeyStroke + */ +public class TestAWTKeyStroke { + + public static void main(String[] args) throws Exception { + + int modifiers = InputEvent.CTRL_MASK | InputEvent.CTRL_DOWN_MASK; + checkAWTKeyStroke('A', modifiers, true); + checkKeyStroke('B', modifiers, false); + checkAWTKeyStroke('C', modifiers, false); + checkKeyStroke('D', modifiers, true); + checkSerializedKeyStrokes('E', modifiers, true); + } + + private static void checkAWTKeyStroke(int keyCode, int modifiers, + boolean onKeyRelease) throws Exception { + + AWTKeyStroke awtKeyStroke1 = AWTKeyStroke.getAWTKeyStroke( + keyCode, modifiers, onKeyRelease); + + checkAWTKeyStroke(awtKeyStroke1, keyCode, modifiers, onKeyRelease); + + AWTKeyStroke awtKeyStroke2 = AWTKeyStroke.getAWTKeyStroke( + keyCode, modifiers, onKeyRelease); + + if (awtKeyStroke1 != awtKeyStroke2) { + throw new RuntimeException("AWTKeyStroke is not cached!"); + } + + checkSerializedKeyStroke(awtKeyStroke1); + } + + private static void checkKeyStroke(int keyCode, int modifiers, + boolean onKeyRelease) throws Exception { + + KeyStroke keyStroke1 = KeyStroke.getKeyStroke( + keyCode, modifiers, onKeyRelease); + checkAWTKeyStroke(keyStroke1, keyCode, modifiers, onKeyRelease); + + KeyStroke keyStroke2 = KeyStroke.getKeyStroke( + keyCode, modifiers, onKeyRelease); + + if (keyStroke1 != keyStroke2) { + throw new RuntimeException("KeyStroke is not cached!"); + } + + checkSerializedKeyStroke(keyStroke1); + } + + private static void checkSerializedKeyStrokes(int keyCode, int modifiers, + boolean onKeyRelease) throws Exception { + + AWTKeyStroke awtKeyStroke = AWTKeyStroke.getAWTKeyStroke( + keyCode, modifiers, onKeyRelease); + + KeyStroke keyStroke = KeyStroke.getKeyStroke( + keyCode, modifiers, onKeyRelease); + + if (awtKeyStroke != getSerializedAWTKeyStroke(awtKeyStroke)) { + throw new RuntimeException("Serialized AWTKeyStroke is not cached!"); + } + + awtKeyStroke = AWTKeyStroke.getAWTKeyStroke( + keyCode, modifiers, !onKeyRelease); + + if (!keyStroke.equals(getSerializedAWTKeyStroke(keyStroke))) { + throw new RuntimeException("Serialized KeyStroke is not cached!"); + } + } + + private static void checkAWTKeyStroke(AWTKeyStroke awtKeyStroke, + int keyCode, int modifiers, boolean onKeyRelease) { + + if (awtKeyStroke.getKeyCode() != keyCode) { + throw new RuntimeException("Wrong key code!"); + } + + if (awtKeyStroke.getModifiers() != modifiers) { + throw new RuntimeException("Wrong modifiers!"); + } + + if (awtKeyStroke.isOnKeyRelease() != onKeyRelease) { + throw new RuntimeException("Wrong on key release!"); + } + } + + private static void checkSerializedKeyStroke(AWTKeyStroke keyStroke) + throws Exception { + if (keyStroke != getSerializedAWTKeyStroke(keyStroke)) { + throw new RuntimeException("New instance is returned during" + + " serialization!"); + } + } + + private static AWTKeyStroke getSerializedAWTKeyStroke(AWTKeyStroke keyStroke) + throws Exception { + + try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutput out = new ObjectOutputStream(bos)) { + out.writeObject(keyStroke); + byte[] bytes = bos.toByteArray(); + + try (ByteArrayInputStream bis = new ByteArrayInputStream(bytes); + ObjectInput in = new ObjectInputStream(bis)) { + return (AWTKeyStroke) in.readObject(); + } + } + } +} diff --git a/jdk/test/java/awt/event/KeyEvent/RegisterKeyStroke/policy b/jdk/test/java/awt/event/KeyEvent/RegisterKeyStroke/policy new file mode 100644 index 00000000000..e89913b9f24 --- /dev/null +++ b/jdk/test/java/awt/event/KeyEvent/RegisterKeyStroke/policy @@ -0,0 +1,2 @@ +grant { +}; From f3e43267475798a0e5c77d8b4c225c62ef8f35e7 Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Tue, 29 Sep 2015 17:26:14 +0300 Subject: [PATCH 11/81] 8137230: TEST_BUG: java/nio/channels/FileChannel/LoopingTruncate.java timed out Reviewed-by: rriggs --- .../channels/FileChannel/LoopingTruncate.java | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/jdk/test/java/nio/channels/FileChannel/LoopingTruncate.java b/jdk/test/java/nio/channels/FileChannel/LoopingTruncate.java index 13286a2cf8f..f81712c1f97 100644 --- a/jdk/test/java/nio/channels/FileChannel/LoopingTruncate.java +++ b/jdk/test/java/nio/channels/FileChannel/LoopingTruncate.java @@ -23,32 +23,39 @@ /** * @test - * @bug 8137121 + * @bug 8137121 8137230 * @summary (fc) Infinite loop FileChannel.truncate + * @library /lib/testlibrary + * @build jdk.testlibrary.Utils * @run main/othervm LoopingTruncate */ import java.nio.ByteBuffer; import java.nio.channels.FileChannel; +import java.nio.channels.ClosedByInterruptException; import java.nio.file.Files; import java.nio.file.Path; import static java.nio.file.StandardOpenOption.*; +import static jdk.testlibrary.Utils.adjustTimeout; public class LoopingTruncate { // (int)FATEFUL_SIZE == -3 == IOStatus.INTERRUPTED static long FATEFUL_SIZE = 0x1FFFFFFFDL; - static long TIMEOUT = 10_000; // 10 seconds + // At least 20 seconds + static long TIMEOUT = adjustTimeout(20_000); public static void main(String[] args) throws Throwable { Path path = Files.createTempFile("LoopingTruncate.tmp", null); - try { + try (FileChannel fc = FileChannel.open(path, CREATE, WRITE)) { + fc.position(FATEFUL_SIZE + 1L); + fc.write(ByteBuffer.wrap(new byte[] {0})); + Thread th = new Thread(() -> { - try (FileChannel fc = FileChannel.open(path, CREATE, WRITE)) { - fc.position(FATEFUL_SIZE + 1L); - fc.write(ByteBuffer.wrap(new byte[] {0})); + try { fc.truncate(FATEFUL_SIZE); + } catch (ClosedByInterruptException ignore) { } catch (Exception e) { throw new RuntimeException(e); }}); @@ -56,7 +63,14 @@ public class LoopingTruncate { th.join(TIMEOUT); if (th.isAlive()) { + System.err.println("=== Stack trace of the guilty thread:"); + for (StackTraceElement el : th.getStackTrace()) { + System.err.println("\t" + el); + } + System.err.println("==="); + th.interrupt(); + th.join(); throw new RuntimeException("Failed to complete on time"); } } finally { From b47b3ceb6ebfbc7168f78d02e29a68b8e1b9dee5 Mon Sep 17 00:00:00 2001 From: Artem Smotrakov Date: Tue, 29 Sep 2015 18:01:33 +0300 Subject: [PATCH 12/81] 8136600: KinitConfPlusProps.java test intermittently fails because PortUnreachableException is missing Reviewed-by: weijun --- jdk/test/sun/security/krb5/auto/tools/KinitConfPlusProps.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/jdk/test/sun/security/krb5/auto/tools/KinitConfPlusProps.java b/jdk/test/sun/security/krb5/auto/tools/KinitConfPlusProps.java index d80224bc9b5..208fcd84db6 100644 --- a/jdk/test/sun/security/krb5/auto/tools/KinitConfPlusProps.java +++ b/jdk/test/sun/security/krb5/auto/tools/KinitConfPlusProps.java @@ -22,7 +22,6 @@ */ import java.io.File; -import java.net.PortUnreachableException; import java.util.HashMap; import java.util.Map; import jdk.testlibrary.ProcessTools; @@ -86,7 +85,6 @@ public class KinitConfPlusProps { try { OutputAnalyzer out = ProcessTools.executeCommand(command); out.shouldHaveExitValue(-1); - out.shouldContain(PortUnreachableException.class.getName()); } catch(Throwable e) { System.out.println("Unexpected exception: " + e); e.printStackTrace(System.out); From df66629e12a4f65780940c5e8f321ec4e9777099 Mon Sep 17 00:00:00 2001 From: Doug Lea Date: Tue, 29 Sep 2015 16:44:29 +0100 Subject: [PATCH 13/81] 8134854: Bulk integration of java.util.concurrent.atomic classes Reviewed-by: martin, psandoz, chegar --- .../util/concurrent/atomic/AtomicBoolean.java | 28 ++-- .../util/concurrent/atomic/AtomicInteger.java | 38 ++--- .../concurrent/atomic/AtomicIntegerArray.java | 32 ++--- .../atomic/AtomicIntegerFieldUpdater.java | 32 ++--- .../util/concurrent/atomic/AtomicLong.java | 40 +++--- .../concurrent/atomic/AtomicLongArray.java | 31 ++-- .../atomic/AtomicLongFieldUpdater.java | 46 +++--- .../atomic/AtomicMarkableReference.java | 29 ++-- .../concurrent/atomic/AtomicReference.java | 22 +-- .../atomic/AtomicReferenceArray.java | 50 +++---- .../atomic/AtomicReferenceFieldUpdater.java | 30 ++-- .../atomic/AtomicStampedReference.java | 29 ++-- .../concurrent/atomic/DoubleAccumulator.java | 45 +++--- .../util/concurrent/atomic/DoubleAdder.java | 27 ++-- .../concurrent/atomic/LongAccumulator.java | 43 +++--- .../util/concurrent/atomic/LongAdder.java | 29 ++-- .../util/concurrent/atomic/Striped64.java | 132 ++++++++---------- .../util/concurrent/atomic/package-info.java | 19 +-- 18 files changed, 345 insertions(+), 357 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java index bb2dd42e730..b2a23903c22 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java @@ -34,7 +34,6 @@ */ package java.util.concurrent.atomic; -import sun.misc.Unsafe; /** * A {@code boolean} value that may be updated atomically. See the @@ -49,15 +48,17 @@ import sun.misc.Unsafe; */ public class AtomicBoolean implements java.io.Serializable { private static final long serialVersionUID = 4654671469794556979L; - // setup to use Unsafe.compareAndSwapInt for updates - private static final Unsafe unsafe = Unsafe.getUnsafe(); - private static final long valueOffset; + + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); + private static final long VALUE; static { try { - valueOffset = unsafe.objectFieldOffset + VALUE = U.objectFieldOffset (AtomicBoolean.class.getDeclaredField("value")); - } catch (Exception ex) { throw new Error(ex); } + } catch (ReflectiveOperationException e) { + throw new Error(e); + } } private volatile int value; @@ -96,9 +97,9 @@ public class AtomicBoolean implements java.io.Serializable { * the actual value was not equal to the expected value. */ public final boolean compareAndSet(boolean expect, boolean update) { - int e = expect ? 1 : 0; - int u = update ? 1 : 0; - return unsafe.compareAndSwapInt(this, valueOffset, e, u); + return U.compareAndSwapInt(this, VALUE, + (expect ? 1 : 0), + (update ? 1 : 0)); } /** @@ -114,9 +115,9 @@ public class AtomicBoolean implements java.io.Serializable { * @return {@code true} if successful */ public boolean weakCompareAndSet(boolean expect, boolean update) { - int e = expect ? 1 : 0; - int u = update ? 1 : 0; - return unsafe.compareAndSwapInt(this, valueOffset, e, u); + return U.compareAndSwapInt(this, VALUE, + (expect ? 1 : 0), + (update ? 1 : 0)); } /** @@ -135,8 +136,7 @@ public class AtomicBoolean implements java.io.Serializable { * @since 1.6 */ public final void lazySet(boolean newValue) { - int v = newValue ? 1 : 0; - unsafe.putOrderedInt(this, valueOffset, v); + U.putOrderedInt(this, VALUE, (newValue ? 1 : 0)); } /** diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java index c67e42f3bf1..19b341819b9 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java @@ -34,9 +34,9 @@ */ package java.util.concurrent.atomic; -import java.util.function.IntUnaryOperator; + import java.util.function.IntBinaryOperator; -import sun.misc.Unsafe; +import java.util.function.IntUnaryOperator; /** * An {@code int} value that may be updated atomically. See the @@ -50,19 +50,20 @@ import sun.misc.Unsafe; * * @since 1.5 * @author Doug Lea -*/ + */ public class AtomicInteger extends Number implements java.io.Serializable { private static final long serialVersionUID = 6214790243416807050L; - // setup to use Unsafe.compareAndSwapInt for updates - private static final Unsafe unsafe = Unsafe.getUnsafe(); - private static final long valueOffset; + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); + private static final long VALUE; static { try { - valueOffset = unsafe.objectFieldOffset + VALUE = U.objectFieldOffset (AtomicInteger.class.getDeclaredField("value")); - } catch (Exception ex) { throw new Error(ex); } + } catch (ReflectiveOperationException e) { + throw new Error(e); + } } private volatile int value; @@ -107,7 +108,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @since 1.6 */ public final void lazySet(int newValue) { - unsafe.putOrderedInt(this, valueOffset, newValue); + U.putOrderedInt(this, VALUE, newValue); } /** @@ -117,7 +118,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @return the previous value */ public final int getAndSet(int newValue) { - return unsafe.getAndSetInt(this, valueOffset, newValue); + return U.getAndSetInt(this, VALUE, newValue); } /** @@ -130,7 +131,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * the actual value was not equal to the expected value. */ public final boolean compareAndSet(int expect, int update) { - return unsafe.compareAndSwapInt(this, valueOffset, expect, update); + return U.compareAndSwapInt(this, VALUE, expect, update); } /** @@ -146,7 +147,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @return {@code true} if successful */ public final boolean weakCompareAndSet(int expect, int update) { - return unsafe.compareAndSwapInt(this, valueOffset, expect, update); + return U.compareAndSwapInt(this, VALUE, expect, update); } /** @@ -155,7 +156,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @return the previous value */ public final int getAndIncrement() { - return unsafe.getAndAddInt(this, valueOffset, 1); + return U.getAndAddInt(this, VALUE, 1); } /** @@ -164,7 +165,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @return the previous value */ public final int getAndDecrement() { - return unsafe.getAndAddInt(this, valueOffset, -1); + return U.getAndAddInt(this, VALUE, -1); } /** @@ -174,7 +175,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @return the previous value */ public final int getAndAdd(int delta) { - return unsafe.getAndAddInt(this, valueOffset, delta); + return U.getAndAddInt(this, VALUE, delta); } /** @@ -183,7 +184,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @return the updated value */ public final int incrementAndGet() { - return unsafe.getAndAddInt(this, valueOffset, 1) + 1; + return U.getAndAddInt(this, VALUE, 1) + 1; } /** @@ -192,7 +193,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @return the updated value */ public final int decrementAndGet() { - return unsafe.getAndAddInt(this, valueOffset, -1) - 1; + return U.getAndAddInt(this, VALUE, -1) - 1; } /** @@ -202,7 +203,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @return the updated value */ public final int addAndGet(int delta) { - return unsafe.getAndAddInt(this, valueOffset, delta) + delta; + return U.getAndAddInt(this, VALUE, delta) + delta; } /** @@ -301,6 +302,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { /** * Returns the value of this {@code AtomicInteger} as an {@code int}. + * Equivalent to {@link #get()}. */ public int intValue() { return get(); diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java index 3cbf3f4b446..2ea9a272008 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java @@ -34,9 +34,9 @@ */ package java.util.concurrent.atomic; -import java.util.function.IntUnaryOperator; + import java.util.function.IntBinaryOperator; -import sun.misc.Unsafe; +import java.util.function.IntUnaryOperator; /** * An {@code int} array in which elements may be updated atomically. @@ -49,16 +49,17 @@ import sun.misc.Unsafe; public class AtomicIntegerArray implements java.io.Serializable { private static final long serialVersionUID = 2862133569453604235L; - private static final Unsafe unsafe = Unsafe.getUnsafe(); - private static final int base = unsafe.arrayBaseOffset(int[].class); - private static final int shift; + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); + private static final int ABASE; + private static final int ASHIFT; private final int[] array; static { - int scale = unsafe.arrayIndexScale(int[].class); + ABASE = U.arrayBaseOffset(int[].class); + int scale = U.arrayIndexScale(int[].class); if ((scale & (scale - 1)) != 0) - throw new Error("data type scale not a power of two"); - shift = 31 - Integer.numberOfLeadingZeros(scale); + throw new Error("array index scale not a power of two"); + ASHIFT = 31 - Integer.numberOfLeadingZeros(scale); } private long checkedByteOffset(int i) { @@ -69,7 +70,7 @@ public class AtomicIntegerArray implements java.io.Serializable { } private static long byteOffset(int i) { - return ((long) i << shift) + base; + return ((long) i << ASHIFT) + ABASE; } /** @@ -114,7 +115,7 @@ public class AtomicIntegerArray implements java.io.Serializable { } private int getRaw(long offset) { - return unsafe.getIntVolatile(array, offset); + return U.getIntVolatile(array, offset); } /** @@ -124,7 +125,7 @@ public class AtomicIntegerArray implements java.io.Serializable { * @param newValue the new value */ public final void set(int i, int newValue) { - unsafe.putIntVolatile(array, checkedByteOffset(i), newValue); + U.putIntVolatile(array, checkedByteOffset(i), newValue); } /** @@ -135,7 +136,7 @@ public class AtomicIntegerArray implements java.io.Serializable { * @since 1.6 */ public final void lazySet(int i, int newValue) { - unsafe.putOrderedInt(array, checkedByteOffset(i), newValue); + U.putOrderedInt(array, checkedByteOffset(i), newValue); } /** @@ -147,7 +148,7 @@ public class AtomicIntegerArray implements java.io.Serializable { * @return the previous value */ public final int getAndSet(int i, int newValue) { - return unsafe.getAndSetInt(array, checkedByteOffset(i), newValue); + return U.getAndSetInt(array, checkedByteOffset(i), newValue); } /** @@ -165,7 +166,7 @@ public class AtomicIntegerArray implements java.io.Serializable { } private boolean compareAndSetRaw(long offset, int expect, int update) { - return unsafe.compareAndSwapInt(array, offset, expect, update); + return U.compareAndSwapInt(array, offset, expect, update); } /** @@ -213,7 +214,7 @@ public class AtomicIntegerArray implements java.io.Serializable { * @return the previous value */ public final int getAndAdd(int i, int delta) { - return unsafe.getAndAddInt(array, checkedByteOffset(i), delta); + return U.getAndAddInt(array, checkedByteOffset(i), delta); } /** @@ -247,7 +248,6 @@ public class AtomicIntegerArray implements java.io.Serializable { return getAndAdd(i, delta) + delta; } - /** * Atomically updates the element at index {@code i} with the results * of applying the given function, returning the previous value. The diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java index a60b7ce621b..06e517d1a2b 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java @@ -34,14 +34,14 @@ */ package java.util.concurrent.atomic; -import java.util.function.IntUnaryOperator; -import java.util.function.IntBinaryOperator; -import sun.misc.Unsafe; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.security.AccessController; -import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.util.function.IntBinaryOperator; +import java.util.function.IntUnaryOperator; import sun.reflect.CallerSensitive; import sun.reflect.Reflection; @@ -363,11 +363,11 @@ public abstract class AtomicIntegerFieldUpdater { } /** - * Standard hotspot implementation using intrinsics + * Standard hotspot implementation using intrinsics. */ private static class AtomicIntegerFieldUpdaterImpl extends AtomicIntegerFieldUpdater { - private static final Unsafe unsafe = Unsafe.getUnsafe(); + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); private final long offset; private final Class tclass; private final Class cclass; @@ -391,7 +391,7 @@ public abstract class AtomicIntegerFieldUpdater { ClassLoader ccl = caller.getClassLoader(); if ((ccl != null) && (ccl != cl) && ((cl == null) || !isAncestor(cl, ccl))) { - sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); + sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); } } catch (PrivilegedActionException pae) { throw new RuntimeException(pae.getException()); @@ -409,7 +409,7 @@ public abstract class AtomicIntegerFieldUpdater { this.cclass = (Modifier.isProtected(modifiers) && caller != tclass) ? caller : null; this.tclass = tclass; - offset = unsafe.objectFieldOffset(field); + offset = U.objectFieldOffset(field); } /** @@ -437,32 +437,32 @@ public abstract class AtomicIntegerFieldUpdater { public boolean compareAndSet(T obj, int expect, int update) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.compareAndSwapInt(obj, offset, expect, update); + return U.compareAndSwapInt(obj, offset, expect, update); } public boolean weakCompareAndSet(T obj, int expect, int update) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.compareAndSwapInt(obj, offset, expect, update); + return U.compareAndSwapInt(obj, offset, expect, update); } public void set(T obj, int newValue) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - unsafe.putIntVolatile(obj, offset, newValue); + U.putIntVolatile(obj, offset, newValue); } public void lazySet(T obj, int newValue) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - unsafe.putOrderedInt(obj, offset, newValue); + U.putOrderedInt(obj, offset, newValue); } public final int get(T obj) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.getIntVolatile(obj, offset); + return U.getIntVolatile(obj, offset); } public int getAndSet(T obj, int newValue) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.getAndSetInt(obj, offset, newValue); + return U.getAndSetInt(obj, offset, newValue); } public int getAndIncrement(T obj) { @@ -475,7 +475,7 @@ public abstract class AtomicIntegerFieldUpdater { public int getAndAdd(T obj, int delta) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.getAndAddInt(obj, offset, delta); + return U.getAndAddInt(obj, offset, delta); } public int incrementAndGet(T obj) { @@ -483,7 +483,7 @@ public abstract class AtomicIntegerFieldUpdater { } public int decrementAndGet(T obj) { - return getAndAdd(obj, -1) - 1; + return getAndAdd(obj, -1) - 1; } public int addAndGet(T obj, int delta) { diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java index 85ea910a96c..b919f1e3c7a 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java @@ -34,9 +34,9 @@ */ package java.util.concurrent.atomic; -import java.util.function.LongUnaryOperator; + import java.util.function.LongBinaryOperator; -import sun.misc.Unsafe; +import java.util.function.LongUnaryOperator; /** * A {@code long} value that may be updated atomically. See the @@ -54,9 +54,8 @@ import sun.misc.Unsafe; public class AtomicLong extends Number implements java.io.Serializable { private static final long serialVersionUID = 1927816293512124184L; - // setup to use Unsafe.compareAndSwapLong for updates - private static final Unsafe unsafe = Unsafe.getUnsafe(); - private static final long valueOffset; + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); + private static final long VALUE; /** * Records whether the underlying JVM supports lockless @@ -74,9 +73,11 @@ public class AtomicLong extends Number implements java.io.Serializable { static { try { - valueOffset = unsafe.objectFieldOffset + VALUE = U.objectFieldOffset (AtomicLong.class.getDeclaredField("value")); - } catch (Exception ex) { throw new Error(ex); } + } catch (ReflectiveOperationException e) { + throw new Error(e); + } } private volatile long value; @@ -111,7 +112,9 @@ public class AtomicLong extends Number implements java.io.Serializable { * @param newValue the new value */ public final void set(long newValue) { - value = newValue; + // Use putLongVolatile instead of ordinary volatile store when + // using compareAndSwapLong, for sake of some 32bit systems. + U.putLongVolatile(this, VALUE, newValue); } /** @@ -121,7 +124,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @since 1.6 */ public final void lazySet(long newValue) { - unsafe.putOrderedLong(this, valueOffset, newValue); + U.putOrderedLong(this, VALUE, newValue); } /** @@ -131,7 +134,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @return the previous value */ public final long getAndSet(long newValue) { - return unsafe.getAndSetLong(this, valueOffset, newValue); + return U.getAndSetLong(this, VALUE, newValue); } /** @@ -144,7 +147,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * the actual value was not equal to the expected value. */ public final boolean compareAndSet(long expect, long update) { - return unsafe.compareAndSwapLong(this, valueOffset, expect, update); + return U.compareAndSwapLong(this, VALUE, expect, update); } /** @@ -160,7 +163,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @return {@code true} if successful */ public final boolean weakCompareAndSet(long expect, long update) { - return unsafe.compareAndSwapLong(this, valueOffset, expect, update); + return U.compareAndSwapLong(this, VALUE, expect, update); } /** @@ -169,7 +172,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @return the previous value */ public final long getAndIncrement() { - return unsafe.getAndAddLong(this, valueOffset, 1L); + return U.getAndAddLong(this, VALUE, 1L); } /** @@ -178,7 +181,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @return the previous value */ public final long getAndDecrement() { - return unsafe.getAndAddLong(this, valueOffset, -1L); + return U.getAndAddLong(this, VALUE, -1L); } /** @@ -188,7 +191,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @return the previous value */ public final long getAndAdd(long delta) { - return unsafe.getAndAddLong(this, valueOffset, delta); + return U.getAndAddLong(this, VALUE, delta); } /** @@ -197,7 +200,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @return the updated value */ public final long incrementAndGet() { - return unsafe.getAndAddLong(this, valueOffset, 1L) + 1L; + return U.getAndAddLong(this, VALUE, 1L) + 1L; } /** @@ -206,7 +209,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @return the updated value */ public final long decrementAndGet() { - return unsafe.getAndAddLong(this, valueOffset, -1L) - 1L; + return U.getAndAddLong(this, VALUE, -1L) - 1L; } /** @@ -216,7 +219,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @return the updated value */ public final long addAndGet(long delta) { - return unsafe.getAndAddLong(this, valueOffset, delta) + delta; + return U.getAndAddLong(this, VALUE, delta) + delta; } /** @@ -324,6 +327,7 @@ public class AtomicLong extends Number implements java.io.Serializable { /** * Returns the value of this {@code AtomicLong} as a {@code long}. + * Equivalent to {@link #get()}. */ public long longValue() { return get(); diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java index 28174a586ff..d1af039aa61 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java @@ -34,9 +34,9 @@ */ package java.util.concurrent.atomic; -import java.util.function.LongUnaryOperator; + import java.util.function.LongBinaryOperator; -import sun.misc.Unsafe; +import java.util.function.LongUnaryOperator; /** * A {@code long} array in which elements may be updated atomically. @@ -48,16 +48,17 @@ import sun.misc.Unsafe; public class AtomicLongArray implements java.io.Serializable { private static final long serialVersionUID = -2308431214976778248L; - private static final Unsafe unsafe = Unsafe.getUnsafe(); - private static final int base = unsafe.arrayBaseOffset(long[].class); - private static final int shift; + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); + private static final int ABASE; + private static final int ASHIFT; private final long[] array; static { - int scale = unsafe.arrayIndexScale(long[].class); + ABASE = U.arrayBaseOffset(long[].class); + int scale = U.arrayIndexScale(long[].class); if ((scale & (scale - 1)) != 0) - throw new Error("data type scale not a power of two"); - shift = 31 - Integer.numberOfLeadingZeros(scale); + throw new Error("array index scale not a power of two"); + ASHIFT = 31 - Integer.numberOfLeadingZeros(scale); } private long checkedByteOffset(int i) { @@ -68,7 +69,7 @@ public class AtomicLongArray implements java.io.Serializable { } private static long byteOffset(int i) { - return ((long) i << shift) + base; + return ((long) i << ASHIFT) + ABASE; } /** @@ -113,7 +114,7 @@ public class AtomicLongArray implements java.io.Serializable { } private long getRaw(long offset) { - return unsafe.getLongVolatile(array, offset); + return U.getLongVolatile(array, offset); } /** @@ -123,7 +124,7 @@ public class AtomicLongArray implements java.io.Serializable { * @param newValue the new value */ public final void set(int i, long newValue) { - unsafe.putLongVolatile(array, checkedByteOffset(i), newValue); + U.putLongVolatile(array, checkedByteOffset(i), newValue); } /** @@ -134,7 +135,7 @@ public class AtomicLongArray implements java.io.Serializable { * @since 1.6 */ public final void lazySet(int i, long newValue) { - unsafe.putOrderedLong(array, checkedByteOffset(i), newValue); + U.putOrderedLong(array, checkedByteOffset(i), newValue); } /** @@ -146,7 +147,7 @@ public class AtomicLongArray implements java.io.Serializable { * @return the previous value */ public final long getAndSet(int i, long newValue) { - return unsafe.getAndSetLong(array, checkedByteOffset(i), newValue); + return U.getAndSetLong(array, checkedByteOffset(i), newValue); } /** @@ -164,7 +165,7 @@ public class AtomicLongArray implements java.io.Serializable { } private boolean compareAndSetRaw(long offset, long expect, long update) { - return unsafe.compareAndSwapLong(array, offset, expect, update); + return U.compareAndSwapLong(array, offset, expect, update); } /** @@ -212,7 +213,7 @@ public class AtomicLongArray implements java.io.Serializable { * @return the previous value */ public final long getAndAdd(int i, long delta) { - return unsafe.getAndAddLong(array, checkedByteOffset(i), delta); + return U.getAndAddLong(array, checkedByteOffset(i), delta); } /** diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java index aae2b248a12..5cb20197126 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java @@ -34,14 +34,14 @@ */ package java.util.concurrent.atomic; -import java.util.function.LongUnaryOperator; -import java.util.function.LongBinaryOperator; -import sun.misc.Unsafe; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.security.AccessController; -import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.util.function.LongBinaryOperator; +import java.util.function.LongUnaryOperator; import sun.reflect.CallerSensitive; import sun.reflect.Reflection; @@ -366,7 +366,7 @@ public abstract class AtomicLongFieldUpdater { } private static class CASUpdater extends AtomicLongFieldUpdater { - private static final Unsafe unsafe = Unsafe.getUnsafe(); + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); private final long offset; private final Class tclass; private final Class cclass; @@ -389,7 +389,7 @@ public abstract class AtomicLongFieldUpdater { ClassLoader ccl = caller.getClassLoader(); if ((ccl != null) && (ccl != cl) && ((cl == null) || !isAncestor(cl, ccl))) { - sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); + sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); } } catch (PrivilegedActionException pae) { throw new RuntimeException(pae.getException()); @@ -407,7 +407,7 @@ public abstract class AtomicLongFieldUpdater { this.cclass = (Modifier.isProtected(modifiers) && caller != tclass) ? caller : null; this.tclass = tclass; - offset = unsafe.objectFieldOffset(field); + offset = U.objectFieldOffset(field); } private void fullCheck(T obj) { @@ -419,32 +419,32 @@ public abstract class AtomicLongFieldUpdater { public boolean compareAndSet(T obj, long expect, long update) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.compareAndSwapLong(obj, offset, expect, update); + return U.compareAndSwapLong(obj, offset, expect, update); } public boolean weakCompareAndSet(T obj, long expect, long update) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.compareAndSwapLong(obj, offset, expect, update); + return U.compareAndSwapLong(obj, offset, expect, update); } public void set(T obj, long newValue) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - unsafe.putLongVolatile(obj, offset, newValue); + U.putLongVolatile(obj, offset, newValue); } public void lazySet(T obj, long newValue) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - unsafe.putOrderedLong(obj, offset, newValue); + U.putOrderedLong(obj, offset, newValue); } public long get(T obj) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.getLongVolatile(obj, offset); + return U.getLongVolatile(obj, offset); } public long getAndSet(T obj, long newValue) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.getAndSetLong(obj, offset, newValue); + return U.getAndSetLong(obj, offset, newValue); } public long getAndIncrement(T obj) { @@ -457,7 +457,7 @@ public abstract class AtomicLongFieldUpdater { public long getAndAdd(T obj, long delta) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.getAndAddLong(obj, offset, delta); + return U.getAndAddLong(obj, offset, delta); } public long incrementAndGet(T obj) { @@ -465,7 +465,7 @@ public abstract class AtomicLongFieldUpdater { } public long decrementAndGet(T obj) { - return getAndAdd(obj, -1) - 1; + return getAndAdd(obj, -1) - 1; } public long addAndGet(T obj, long delta) { @@ -490,7 +490,7 @@ public abstract class AtomicLongFieldUpdater { private static class LockedUpdater extends AtomicLongFieldUpdater { - private static final Unsafe unsafe = Unsafe.getUnsafe(); + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); private final long offset; private final Class tclass; private final Class cclass; @@ -513,7 +513,7 @@ public abstract class AtomicLongFieldUpdater { ClassLoader ccl = caller.getClassLoader(); if ((ccl != null) && (ccl != cl) && ((cl == null) || !isAncestor(cl, ccl))) { - sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); + sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); } } catch (PrivilegedActionException pae) { throw new RuntimeException(pae.getException()); @@ -531,7 +531,7 @@ public abstract class AtomicLongFieldUpdater { this.cclass = (Modifier.isProtected(modifiers) && caller != tclass) ? caller : null; this.tclass = tclass; - offset = unsafe.objectFieldOffset(field); + offset = U.objectFieldOffset(field); } private void fullCheck(T obj) { @@ -544,10 +544,10 @@ public abstract class AtomicLongFieldUpdater { public boolean compareAndSet(T obj, long expect, long update) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); synchronized (this) { - long v = unsafe.getLong(obj, offset); + long v = U.getLong(obj, offset); if (v != expect) return false; - unsafe.putLong(obj, offset, update); + U.putLong(obj, offset, update); return true; } } @@ -559,7 +559,7 @@ public abstract class AtomicLongFieldUpdater { public void set(T obj, long newValue) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); synchronized (this) { - unsafe.putLong(obj, offset, newValue); + U.putLong(obj, offset, newValue); } } @@ -570,7 +570,7 @@ public abstract class AtomicLongFieldUpdater { public long get(T obj) { if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); synchronized (this) { - return unsafe.getLong(obj, offset); + return U.getLong(obj, offset); } } @@ -595,7 +595,7 @@ public abstract class AtomicLongFieldUpdater { * classloader's delegation chain. * Equivalent to the inaccessible: first.isAncestor(second). */ - private static boolean isAncestor(ClassLoader first, ClassLoader second) { + static boolean isAncestor(ClassLoader first, ClassLoader second) { ClassLoader acl = first; do { acl = acl.getParent(); diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java index f7becccb13a..b49118b1c60 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java @@ -97,7 +97,7 @@ public class AtomicMarkableReference { * Typical usage is {@code boolean[1] holder; ref = v.get(holder); }. * * @param markHolder an array of size of at least one. On return, - * {@code markholder[0]} will hold the value of the mark. + * {@code markHolder[0]} will hold the value of the mark. * @return the current value of the reference */ public V get(boolean[] markHolder) { @@ -190,23 +190,18 @@ public class AtomicMarkableReference { // Unsafe mechanics - private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe(); - private static final long pairOffset = - objectFieldOffset(UNSAFE, "pair", AtomicMarkableReference.class); - - private boolean casPair(Pair cmp, Pair val) { - return UNSAFE.compareAndSwapObject(this, pairOffset, cmp, val); - } - - static long objectFieldOffset(sun.misc.Unsafe UNSAFE, - String field, Class klazz) { + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); + private static final long PAIR; + static { try { - return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field)); - } catch (NoSuchFieldException e) { - // Convert Exception to corresponding Error - NoSuchFieldError error = new NoSuchFieldError(field); - error.initCause(e); - throw error; + PAIR = U.objectFieldOffset + (AtomicMarkableReference.class.getDeclaredField("pair")); + } catch (ReflectiveOperationException e) { + throw new Error(e); } } + + private boolean casPair(Pair cmp, Pair val) { + return U.compareAndSwapObject(this, PAIR, cmp, val); + } } diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java index 04fbe52effa..dbc668582f7 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java @@ -34,9 +34,9 @@ */ package java.util.concurrent.atomic; -import java.util.function.UnaryOperator; + import java.util.function.BinaryOperator; -import sun.misc.Unsafe; +import java.util.function.UnaryOperator; /** * An object reference that may be updated atomically. See the {@link @@ -49,14 +49,16 @@ import sun.misc.Unsafe; public class AtomicReference implements java.io.Serializable { private static final long serialVersionUID = -1848883965231344442L; - private static final Unsafe unsafe = Unsafe.getUnsafe(); - private static final long valueOffset; + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); + private static final long VALUE; static { try { - valueOffset = unsafe.objectFieldOffset + VALUE = U.objectFieldOffset (AtomicReference.class.getDeclaredField("value")); - } catch (Exception ex) { throw new Error(ex); } + } catch (ReflectiveOperationException e) { + throw new Error(e); + } } private volatile V value; @@ -101,7 +103,7 @@ public class AtomicReference implements java.io.Serializable { * @since 1.6 */ public final void lazySet(V newValue) { - unsafe.putOrderedObject(this, valueOffset, newValue); + U.putOrderedObject(this, VALUE, newValue); } /** @@ -113,7 +115,7 @@ public class AtomicReference implements java.io.Serializable { * the actual value was not equal to the expected value. */ public final boolean compareAndSet(V expect, V update) { - return unsafe.compareAndSwapObject(this, valueOffset, expect, update); + return U.compareAndSwapObject(this, VALUE, expect, update); } /** @@ -129,7 +131,7 @@ public class AtomicReference implements java.io.Serializable { * @return {@code true} if successful */ public final boolean weakCompareAndSet(V expect, V update) { - return unsafe.compareAndSwapObject(this, valueOffset, expect, update); + return U.compareAndSwapObject(this, VALUE, expect, update); } /** @@ -140,7 +142,7 @@ public class AtomicReference implements java.io.Serializable { */ @SuppressWarnings("unchecked") public final V getAndSet(V newValue) { - return (V)unsafe.getAndSetObject(this, valueOffset, newValue); + return (V)U.getAndSetObject(this, VALUE, newValue); } /** diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java index 4500bdf2fcb..a6695a92d9f 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java @@ -34,11 +34,11 @@ */ package java.util.concurrent.atomic; -import java.util.function.UnaryOperator; -import java.util.function.BinaryOperator; -import java.util.Arrays; + import java.lang.reflect.Array; -import sun.misc.Unsafe; +import java.util.Arrays; +import java.util.function.BinaryOperator; +import java.util.function.UnaryOperator; /** * An array of object references in which elements may be updated @@ -52,23 +52,22 @@ import sun.misc.Unsafe; public class AtomicReferenceArray implements java.io.Serializable { private static final long serialVersionUID = -6209656149925076980L; - private static final Unsafe unsafe; - private static final int base; - private static final int shift; - private static final long arrayFieldOffset; + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); + private static final int ABASE; + private static final int ASHIFT; + private static final long ARRAY; private final Object[] array; // must have exact type Object[] static { try { - unsafe = Unsafe.getUnsafe(); - arrayFieldOffset = unsafe.objectFieldOffset + ARRAY = U.objectFieldOffset (AtomicReferenceArray.class.getDeclaredField("array")); - base = unsafe.arrayBaseOffset(Object[].class); - int scale = unsafe.arrayIndexScale(Object[].class); + ABASE = U.arrayBaseOffset(Object[].class); + int scale = U.arrayIndexScale(Object[].class); if ((scale & (scale - 1)) != 0) - throw new Error("data type scale not a power of two"); - shift = 31 - Integer.numberOfLeadingZeros(scale); - } catch (Exception e) { + throw new Error("array index scale not a power of two"); + ASHIFT = 31 - Integer.numberOfLeadingZeros(scale); + } catch (ReflectiveOperationException e) { throw new Error(e); } } @@ -81,7 +80,7 @@ public class AtomicReferenceArray implements java.io.Serializable { } private static long byteOffset(int i) { - return ((long) i << shift) + base; + return ((long) i << ASHIFT) + ABASE; } /** @@ -127,7 +126,7 @@ public class AtomicReferenceArray implements java.io.Serializable { @SuppressWarnings("unchecked") private E getRaw(long offset) { - return (E) unsafe.getObjectVolatile(array, offset); + return (E) U.getObjectVolatile(array, offset); } /** @@ -137,7 +136,7 @@ public class AtomicReferenceArray implements java.io.Serializable { * @param newValue the new value */ public final void set(int i, E newValue) { - unsafe.putObjectVolatile(array, checkedByteOffset(i), newValue); + U.putObjectVolatile(array, checkedByteOffset(i), newValue); } /** @@ -148,7 +147,7 @@ public class AtomicReferenceArray implements java.io.Serializable { * @since 1.6 */ public final void lazySet(int i, E newValue) { - unsafe.putOrderedObject(array, checkedByteOffset(i), newValue); + U.putOrderedObject(array, checkedByteOffset(i), newValue); } /** @@ -161,7 +160,7 @@ public class AtomicReferenceArray implements java.io.Serializable { */ @SuppressWarnings("unchecked") public final E getAndSet(int i, E newValue) { - return (E)unsafe.getAndSetObject(array, checkedByteOffset(i), newValue); + return (E)U.getAndSetObject(array, checkedByteOffset(i), newValue); } /** @@ -179,7 +178,7 @@ public class AtomicReferenceArray implements java.io.Serializable { } private boolean compareAndSetRaw(long offset, E expect, E update) { - return unsafe.compareAndSwapObject(array, offset, expect, update); + return U.compareAndSwapObject(array, offset, expect, update); } /** @@ -314,17 +313,20 @@ public class AtomicReferenceArray implements java.io.Serializable { /** * Reconstitutes the instance from a stream (that is, deserializes it). + * @param s the stream + * @throws ClassNotFoundException if the class of a serialized object + * could not be found + * @throws java.io.IOException if an I/O error occurs */ private void readObject(java.io.ObjectInputStream s) - throws java.io.IOException, ClassNotFoundException, - java.io.InvalidObjectException { + throws java.io.IOException, ClassNotFoundException { // Note: This must be changed if any additional fields are defined Object a = s.readFields().get("array", null); if (a == null || !a.getClass().isArray()) throw new java.io.InvalidObjectException("Not array type"); if (a.getClass() != Object[].class) a = Arrays.copyOf((Object[])a, Array.getLength(a), Object[].class); - unsafe.putObjectVolatile(this, arrayFieldOffset, a); + U.putObjectVolatile(this, ARRAY, a); } } diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java index 4408ff3b1d7..f33498c8f9f 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java @@ -34,14 +34,14 @@ */ package java.util.concurrent.atomic; -import java.util.function.UnaryOperator; -import java.util.function.BinaryOperator; -import sun.misc.Unsafe; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.security.AccessController; -import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.util.function.BinaryOperator; +import java.util.function.UnaryOperator; import sun.reflect.CallerSensitive; import sun.reflect.Reflection; @@ -53,7 +53,7 @@ import sun.reflect.Reflection; * independently subject to atomic updates. For example, a tree node * might be declared as * - *

 {@code
+ * 
 {@code
  * class Node {
  *   private volatile Node left, right;
  *
@@ -62,7 +62,7 @@ import sun.reflect.Reflection;
  *   private static AtomicReferenceFieldUpdater rightUpdater =
  *     AtomicReferenceFieldUpdater.newUpdater(Node.class, Node.class, "right");
  *
- *   Node getLeft() { return left;  }
+ *   Node getLeft() { return left; }
  *   boolean compareAndSetLeft(Node expect, Node update) {
  *     return leftUpdater.compareAndSet(this, expect, update);
  *   }
@@ -284,7 +284,7 @@ public abstract class AtomicReferenceFieldUpdater {
 
     private static final class AtomicReferenceFieldUpdaterImpl
         extends AtomicReferenceFieldUpdater {
-        private static final Unsafe unsafe = Unsafe.getUnsafe();
+        private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
         private final long offset;
         private final Class tclass;
         private final Class vclass;
@@ -323,7 +323,7 @@ public abstract class AtomicReferenceFieldUpdater {
                 ClassLoader ccl = caller.getClassLoader();
                 if ((ccl != null) && (ccl != cl) &&
                     ((cl == null) || !isAncestor(cl, ccl))) {
-                  sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+                    sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
                 }
                 fieldClass = field.getType();
             } catch (PrivilegedActionException pae) {
@@ -347,7 +347,7 @@ public abstract class AtomicReferenceFieldUpdater {
                 this.vclass = null;
             else
                 this.vclass = vclass;
-            offset = unsafe.objectFieldOffset(field);
+            offset = U.objectFieldOffset(field);
         }
 
         /**
@@ -386,7 +386,7 @@ public abstract class AtomicReferenceFieldUpdater {
                 (update != null && vclass != null &&
                  vclass != update.getClass()))
                 updateCheck(obj, update);
-            return unsafe.compareAndSwapObject(obj, offset, expect, update);
+            return U.compareAndSwapObject(obj, offset, expect, update);
         }
 
         public boolean weakCompareAndSet(T obj, V expect, V update) {
@@ -395,7 +395,7 @@ public abstract class AtomicReferenceFieldUpdater {
                 (update != null && vclass != null &&
                  vclass != update.getClass()))
                 updateCheck(obj, update);
-            return unsafe.compareAndSwapObject(obj, offset, expect, update);
+            return U.compareAndSwapObject(obj, offset, expect, update);
         }
 
         public void set(T obj, V newValue) {
@@ -403,7 +403,7 @@ public abstract class AtomicReferenceFieldUpdater {
                 (newValue != null && vclass != null &&
                  vclass != newValue.getClass()))
                 updateCheck(obj, newValue);
-            unsafe.putObjectVolatile(obj, offset, newValue);
+            U.putObjectVolatile(obj, offset, newValue);
         }
 
         public void lazySet(T obj, V newValue) {
@@ -411,14 +411,14 @@ public abstract class AtomicReferenceFieldUpdater {
                 (newValue != null && vclass != null &&
                  vclass != newValue.getClass()))
                 updateCheck(obj, newValue);
-            unsafe.putOrderedObject(obj, offset, newValue);
+            U.putOrderedObject(obj, offset, newValue);
         }
 
         @SuppressWarnings("unchecked")
         public V get(T obj) {
             if (obj == null || obj.getClass() != tclass || cclass != null)
                 targetCheck(obj);
-            return (V)unsafe.getObjectVolatile(obj, offset);
+            return (V)U.getObjectVolatile(obj, offset);
         }
 
         @SuppressWarnings("unchecked")
@@ -427,7 +427,7 @@ public abstract class AtomicReferenceFieldUpdater {
                 (newValue != null && vclass != null &&
                  vclass != newValue.getClass()))
                 updateCheck(obj, newValue);
-            return (V)unsafe.getAndSetObject(obj, offset, newValue);
+            return (V)U.getAndSetObject(obj, offset, newValue);
         }
 
         private void ensureProtectedAccess(T obj) {
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java
index 56feb2febe7..40ceeb2650f 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java
@@ -97,7 +97,7 @@ public class AtomicStampedReference {
      * Typical usage is {@code int[1] holder; ref = v.get(holder); }.
      *
      * @param stampHolder an array of size of at least one.  On return,
-     * {@code stampholder[0]} will hold the value of the stamp.
+     * {@code stampHolder[0]} will hold the value of the stamp.
      * @return the current value of the reference
      */
     public V get(int[] stampHolder) {
@@ -190,23 +190,18 @@ public class AtomicStampedReference {
 
     // Unsafe mechanics
 
-    private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
-    private static final long pairOffset =
-        objectFieldOffset(UNSAFE, "pair", AtomicStampedReference.class);
-
-    private boolean casPair(Pair cmp, Pair val) {
-        return UNSAFE.compareAndSwapObject(this, pairOffset, cmp, val);
-    }
-
-    static long objectFieldOffset(sun.misc.Unsafe UNSAFE,
-                                  String field, Class klazz) {
+    private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+    private static final long PAIR;
+    static {
         try {
-            return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
-        } catch (NoSuchFieldException e) {
-            // Convert Exception to corresponding Error
-            NoSuchFieldError error = new NoSuchFieldError(field);
-            error.initCause(e);
-            throw error;
+            PAIR = U.objectFieldOffset
+                (AtomicStampedReference.class.getDeclaredField("pair"));
+        } catch (ReflectiveOperationException e) {
+            throw new Error(e);
         }
     }
+
+    private boolean casPair(Pair cmp, Pair val) {
+        return U.compareAndSwapObject(this, PAIR, cmp, val);
+    }
 }
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java
index 929818d9cdb..f3e3531dbd9 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java
@@ -34,6 +34,7 @@
  */
 
 package java.util.concurrent.atomic;
+
 import java.io.Serializable;
 import java.util.function.DoubleBinaryOperator;
 
@@ -126,14 +127,13 @@ public class DoubleAccumulator extends Striped64 implements Serializable {
      * @return the current value
      */
     public double get() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         double result = Double.longBitsToDouble(base);
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
+            for (Cell a : as)
+                if (a != null)
                     result = function.applyAsDouble
                         (result, Double.longBitsToDouble(a.value));
-            }
         }
         return result;
     }
@@ -147,13 +147,12 @@ public class DoubleAccumulator extends Striped64 implements Serializable {
      * updating.
      */
     public void reset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         base = identity;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
-                    a.value = identity;
-            }
+            for (Cell a : as)
+                if (a != null)
+                    a.reset(identity);
         }
     }
 
@@ -168,14 +167,14 @@ public class DoubleAccumulator extends Striped64 implements Serializable {
      * @return the value before reset
      */
     public double getThenReset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         double result = Double.longBitsToDouble(base);
         base = identity;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null) {
+            for (Cell a : as) {
+                if (a != null) {
                     double v = Double.longBitsToDouble(a.value);
-                    a.value = identity;
+                    a.reset(identity);
                     result = function.applyAsDouble(result, v);
                 }
             }
@@ -237,21 +236,27 @@ public class DoubleAccumulator extends Striped64 implements Serializable {
          * @serial
          */
         private final double value;
+
         /**
          * The function used for updates.
          * @serial
          */
         private final DoubleBinaryOperator function;
+
         /**
-         * The identity value
+         * The identity value, represented as a long, as converted by
+         * {@link Double#doubleToRawLongBits}.  The original identity
+         * can be recovered using {@link Double#longBitsToDouble}.
          * @serial
          */
         private final long identity;
 
-        SerializationProxy(DoubleAccumulator a) {
-            function = a.function;
-            identity = a.identity;
-            value = a.get();
+        SerializationProxy(double value,
+                           DoubleBinaryOperator function,
+                           long identity) {
+            this.value = value;
+            this.function = function;
+            this.identity = identity;
         }
 
         /**
@@ -259,7 +264,7 @@ public class DoubleAccumulator extends Striped64 implements Serializable {
          * held by this proxy.
          *
          * @return a {@code DoubleAccumulator} object with initial state
-         * held by this proxy.
+         * held by this proxy
          */
         private Object readResolve() {
             double d = Double.longBitsToDouble(identity);
@@ -279,7 +284,7 @@ public class DoubleAccumulator extends Striped64 implements Serializable {
      * representing the state of this instance
      */
     private Object writeReplace() {
-        return new SerializationProxy(this);
+        return new SerializationProxy(get(), function, identity);
     }
 
     /**
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAdder.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAdder.java
index f548d219ec5..57bd8c581a4 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAdder.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAdder.java
@@ -34,6 +34,7 @@
  */
 
 package java.util.concurrent.atomic;
+
 import java.io.Serializable;
 
 /**
@@ -114,13 +115,12 @@ public class DoubleAdder extends Striped64 implements Serializable {
      * @return the sum
      */
     public double sum() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         double sum = Double.longBitsToDouble(base);
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
+            for (Cell a : as)
+                if (a != null)
                     sum += Double.longBitsToDouble(a.value);
-            }
         }
         return sum;
     }
@@ -133,13 +133,12 @@ public class DoubleAdder extends Striped64 implements Serializable {
      * known that no threads are concurrently updating.
      */
     public void reset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         base = 0L; // relies on fact that double 0 must have same rep as long
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
-                    a.value = 0L;
-            }
+            for (Cell a : as)
+                if (a != null)
+                    a.reset();
         }
     }
 
@@ -154,14 +153,14 @@ public class DoubleAdder extends Striped64 implements Serializable {
      * @return the sum
      */
     public double sumThenReset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         double sum = Double.longBitsToDouble(base);
         base = 0L;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null) {
+            for (Cell a : as) {
+                if (a != null) {
                     long v = a.value;
-                    a.value = 0L;
+                    a.reset();
                     sum += Double.longBitsToDouble(v);
                 }
             }
@@ -233,7 +232,7 @@ public class DoubleAdder extends Striped64 implements Serializable {
          * held by this proxy.
          *
          * @return a {@code DoubleAdder} object with initial state
-         * held by this proxy.
+         * held by this proxy
          */
         private Object readResolve() {
             DoubleAdder a = new DoubleAdder();
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java
index 435aa1b90eb..0e9a8f5927b 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java
@@ -34,6 +34,7 @@
  */
 
 package java.util.concurrent.atomic;
+
 import java.io.Serializable;
 import java.util.function.LongBinaryOperator;
 
@@ -124,13 +125,12 @@ public class LongAccumulator extends Striped64 implements Serializable {
      * @return the current value
      */
     public long get() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         long result = base;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
+            for (Cell a : as)
+                if (a != null)
                     result = function.applyAsLong(result, a.value);
-            }
         }
         return result;
     }
@@ -144,13 +144,12 @@ public class LongAccumulator extends Striped64 implements Serializable {
      * updating.
      */
     public void reset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         base = identity;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
-                    a.value = identity;
-            }
+            for (Cell a : as)
+                if (a != null)
+                    a.reset(identity);
         }
     }
 
@@ -165,14 +164,14 @@ public class LongAccumulator extends Striped64 implements Serializable {
      * @return the value before reset
      */
     public long getThenReset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         long result = base;
         base = identity;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null) {
+            for (Cell a : as) {
+                if (a != null) {
                     long v = a.value;
-                    a.value = identity;
+                    a.reset(identity);
                     result = function.applyAsLong(result, v);
                 }
             }
@@ -234,21 +233,25 @@ public class LongAccumulator extends Striped64 implements Serializable {
          * @serial
          */
         private final long value;
+
         /**
          * The function used for updates.
          * @serial
          */
         private final LongBinaryOperator function;
+
         /**
-         * The identity value
+         * The identity value.
          * @serial
          */
         private final long identity;
 
-        SerializationProxy(LongAccumulator a) {
-            function = a.function;
-            identity = a.identity;
-            value = a.get();
+        SerializationProxy(long value,
+                           LongBinaryOperator function,
+                           long identity) {
+            this.value = value;
+            this.function = function;
+            this.identity = identity;
         }
 
         /**
@@ -256,7 +259,7 @@ public class LongAccumulator extends Striped64 implements Serializable {
          * held by this proxy.
          *
          * @return a {@code LongAccumulator} object with initial state
-         * held by this proxy.
+         * held by this proxy
          */
         private Object readResolve() {
             LongAccumulator a = new LongAccumulator(function, identity);
@@ -275,7 +278,7 @@ public class LongAccumulator extends Striped64 implements Serializable {
      * representing the state of this instance
      */
     private Object writeReplace() {
-        return new SerializationProxy(this);
+        return new SerializationProxy(get(), function, identity);
     }
 
     /**
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/LongAdder.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/LongAdder.java
index 6810edf0010..0248fad9c5f 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/LongAdder.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/LongAdder.java
@@ -34,6 +34,7 @@
  */
 
 package java.util.concurrent.atomic;
+
 import java.io.Serializable;
 
 /**
@@ -116,13 +117,12 @@ public class LongAdder extends Striped64 implements Serializable {
      * @return the sum
      */
     public long sum() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         long sum = base;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
+            for (Cell a : as)
+                if (a != null)
                     sum += a.value;
-            }
         }
         return sum;
     }
@@ -135,13 +135,12 @@ public class LongAdder extends Striped64 implements Serializable {
      * known that no threads are concurrently updating.
      */
     public void reset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         base = 0L;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null)
-                    a.value = 0L;
-            }
+            for (Cell a : as)
+                if (a != null)
+                    a.reset();
         }
     }
 
@@ -156,14 +155,14 @@ public class LongAdder extends Striped64 implements Serializable {
      * @return the sum
      */
     public long sumThenReset() {
-        Cell[] as = cells; Cell a;
+        Cell[] as = cells;
         long sum = base;
         base = 0L;
         if (as != null) {
-            for (int i = 0; i < as.length; ++i) {
-                if ((a = as[i]) != null) {
+            for (Cell a : as) {
+                if (a != null) {
                     sum += a.value;
-                    a.value = 0L;
+                    a.reset();
                 }
             }
         }
@@ -230,11 +229,11 @@ public class LongAdder extends Striped64 implements Serializable {
         }
 
         /**
-         * Return a {@code LongAdder} object with initial state
+         * Returns a {@code LongAdder} object with initial state
          * held by this proxy.
          *
          * @return a {@code LongAdder} object with initial state
-         * held by this proxy.
+         * held by this proxy
          */
         private Object readResolve() {
             LongAdder a = new LongAdder();
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/Striped64.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/Striped64.java
index a09868daba6..18d720fa391 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/Striped64.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/Striped64.java
@@ -34,9 +34,11 @@
  */
 
 package java.util.concurrent.atomic;
-import java.util.function.LongBinaryOperator;
-import java.util.function.DoubleBinaryOperator;
+
+import java.util.Arrays;
 import java.util.concurrent.ThreadLocalRandom;
+import java.util.function.DoubleBinaryOperator;
+import java.util.function.LongBinaryOperator;
 
 /**
  * A package-local class holding common representation and mechanics
@@ -121,19 +123,23 @@ abstract class Striped64 extends Number {
         volatile long value;
         Cell(long x) { value = x; }
         final boolean cas(long cmp, long val) {
-            return UNSAFE.compareAndSwapLong(this, valueOffset, cmp, val);
+            return U.compareAndSwapLong(this, VALUE, cmp, val);
+        }
+        final void reset() {
+            U.putLongVolatile(this, VALUE, 0L);
+        }
+        final void reset(long identity) {
+            U.putLongVolatile(this, VALUE, identity);
         }
 
         // Unsafe mechanics
-        private static final sun.misc.Unsafe UNSAFE;
-        private static final long valueOffset;
+        private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
+        private static final long VALUE;
         static {
             try {
-                UNSAFE = sun.misc.Unsafe.getUnsafe();
-                Class ak = Cell.class;
-                valueOffset = UNSAFE.objectFieldOffset
-                    (ak.getDeclaredField("value"));
-            } catch (Exception e) {
+                VALUE = U.objectFieldOffset
+                    (Cell.class.getDeclaredField("value"));
+            } catch (ReflectiveOperationException e) {
                 throw new Error(e);
             }
         }
@@ -159,7 +165,7 @@ abstract class Striped64 extends Number {
     transient volatile int cellsBusy;
 
     /**
-     * Package-private default constructor
+     * Package-private default constructor.
      */
     Striped64() {
     }
@@ -168,14 +174,14 @@ abstract class Striped64 extends Number {
      * CASes the base field.
      */
     final boolean casBase(long cmp, long val) {
-        return UNSAFE.compareAndSwapLong(this, BASE, cmp, val);
+        return U.compareAndSwapLong(this, BASE, cmp, val);
     }
 
     /**
      * CASes the cellsBusy field from 0 to 1 to acquire lock.
      */
     final boolean casCellsBusy() {
-        return UNSAFE.compareAndSwapInt(this, CELLSBUSY, 0, 1);
+        return U.compareAndSwapInt(this, CELLSBUSY, 0, 1);
     }
 
     /**
@@ -183,7 +189,7 @@ abstract class Striped64 extends Number {
      * Duplicated from ThreadLocalRandom because of packaging restrictions.
      */
     static final int getProbe() {
-        return UNSAFE.getInt(Thread.currentThread(), PROBE);
+        return U.getInt(Thread.currentThread(), PROBE);
     }
 
     /**
@@ -195,7 +201,7 @@ abstract class Striped64 extends Number {
         probe ^= probe << 13;   // xorshift
         probe ^= probe >>> 17;
         probe ^= probe << 5;
-        UNSAFE.putInt(Thread.currentThread(), PROBE, probe);
+        U.putInt(Thread.currentThread(), PROBE, probe);
         return probe;
     }
 
@@ -220,27 +226,24 @@ abstract class Striped64 extends Number {
             wasUncontended = true;
         }
         boolean collide = false;                // True if last slot nonempty
-        for (;;) {
+        done: for (;;) {
             Cell[] as; Cell a; int n; long v;
             if ((as = cells) != null && (n = as.length) > 0) {
                 if ((a = as[(n - 1) & h]) == null) {
                     if (cellsBusy == 0) {       // Try to attach new Cell
                         Cell r = new Cell(x);   // Optimistically create
                         if (cellsBusy == 0 && casCellsBusy()) {
-                            boolean created = false;
                             try {               // Recheck under lock
                                 Cell[] rs; int m, j;
                                 if ((rs = cells) != null &&
                                     (m = rs.length) > 0 &&
                                     rs[j = (m - 1) & h] == null) {
                                     rs[j] = r;
-                                    created = true;
+                                    break done;
                                 }
                             } finally {
                                 cellsBusy = 0;
                             }
-                            if (created)
-                                break;
                             continue;           // Slot is now non-empty
                         }
                     }
@@ -248,8 +251,8 @@ abstract class Striped64 extends Number {
                 }
                 else if (!wasUncontended)       // CAS already known to fail
                     wasUncontended = true;      // Continue after rehash
-                else if (a.cas(v = a.value, ((fn == null) ? v + x :
-                                             fn.applyAsLong(v, x))))
+                else if (a.cas(v = a.value,
+                               (fn == null) ? v + x : fn.applyAsLong(v, x)))
                     break;
                 else if (n >= NCPU || cells != as)
                     collide = false;            // At max size or stale
@@ -257,12 +260,8 @@ abstract class Striped64 extends Number {
                     collide = true;
                 else if (cellsBusy == 0 && casCellsBusy()) {
                     try {
-                        if (cells == as) {      // Expand table unless stale
-                            Cell[] rs = new Cell[n << 1];
-                            for (int i = 0; i < n; ++i)
-                                rs[i] = as[i];
-                            cells = rs;
-                        }
+                        if (cells == as)        // Expand table unless stale
+                            cells = Arrays.copyOf(as, n << 1);
                     } finally {
                         cellsBusy = 0;
                     }
@@ -272,26 +271,30 @@ abstract class Striped64 extends Number {
                 h = advanceProbe(h);
             }
             else if (cellsBusy == 0 && cells == as && casCellsBusy()) {
-                boolean init = false;
                 try {                           // Initialize table
                     if (cells == as) {
                         Cell[] rs = new Cell[2];
                         rs[h & 1] = new Cell(x);
                         cells = rs;
-                        init = true;
+                        break done;
                     }
                 } finally {
                     cellsBusy = 0;
                 }
-                if (init)
-                    break;
             }
-            else if (casBase(v = base, ((fn == null) ? v + x :
-                                        fn.applyAsLong(v, x))))
-                break;                          // Fall back on using base
+            // Fall back on using base
+            else if (casBase(v = base,
+                             (fn == null) ? v + x : fn.applyAsLong(v, x)))
+                break done;
         }
     }
 
+    private static long apply(DoubleBinaryOperator fn, long v, double x) {
+        double d = Double.longBitsToDouble(v);
+        d = (fn == null) ? d + x : fn.applyAsDouble(d, x);
+        return Double.doubleToRawLongBits(d);
+    }
+
     /**
      * Same as longAccumulate, but injecting long/double conversions
      * in too many places to sensibly merge with long version, given
@@ -307,27 +310,24 @@ abstract class Striped64 extends Number {
             wasUncontended = true;
         }
         boolean collide = false;                // True if last slot nonempty
-        for (;;) {
+        done: for (;;) {
             Cell[] as; Cell a; int n; long v;
             if ((as = cells) != null && (n = as.length) > 0) {
                 if ((a = as[(n - 1) & h]) == null) {
                     if (cellsBusy == 0) {       // Try to attach new Cell
                         Cell r = new Cell(Double.doubleToRawLongBits(x));
                         if (cellsBusy == 0 && casCellsBusy()) {
-                            boolean created = false;
                             try {               // Recheck under lock
                                 Cell[] rs; int m, j;
                                 if ((rs = cells) != null &&
                                     (m = rs.length) > 0 &&
                                     rs[j = (m - 1) & h] == null) {
                                     rs[j] = r;
-                                    created = true;
+                                    break done;
                                 }
                             } finally {
                                 cellsBusy = 0;
                             }
-                            if (created)
-                                break;
                             continue;           // Slot is now non-empty
                         }
                     }
@@ -335,13 +335,7 @@ abstract class Striped64 extends Number {
                 }
                 else if (!wasUncontended)       // CAS already known to fail
                     wasUncontended = true;      // Continue after rehash
-                else if (a.cas(v = a.value,
-                               ((fn == null) ?
-                                Double.doubleToRawLongBits
-                                (Double.longBitsToDouble(v) + x) :
-                                Double.doubleToRawLongBits
-                                (fn.applyAsDouble
-                                 (Double.longBitsToDouble(v), x)))))
+                else if (a.cas(v = a.value, apply(fn, v, x)))
                     break;
                 else if (n >= NCPU || cells != as)
                     collide = false;            // At max size or stale
@@ -349,12 +343,8 @@ abstract class Striped64 extends Number {
                     collide = true;
                 else if (cellsBusy == 0 && casCellsBusy()) {
                     try {
-                        if (cells == as) {      // Expand table unless stale
-                            Cell[] rs = new Cell[n << 1];
-                            for (int i = 0; i < n; ++i)
-                                rs[i] = as[i];
-                            cells = rs;
-                        }
+                        if (cells == as)        // Expand table unless stale
+                            cells = Arrays.copyOf(as, n << 1);
                     } finally {
                         cellsBusy = 0;
                     }
@@ -364,48 +354,38 @@ abstract class Striped64 extends Number {
                 h = advanceProbe(h);
             }
             else if (cellsBusy == 0 && cells == as && casCellsBusy()) {
-                boolean init = false;
                 try {                           // Initialize table
                     if (cells == as) {
                         Cell[] rs = new Cell[2];
                         rs[h & 1] = new Cell(Double.doubleToRawLongBits(x));
                         cells = rs;
-                        init = true;
+                        break done;
                     }
                 } finally {
                     cellsBusy = 0;
                 }
-                if (init)
-                    break;
             }
-            else if (casBase(v = base,
-                             ((fn == null) ?
-                              Double.doubleToRawLongBits
-                              (Double.longBitsToDouble(v) + x) :
-                              Double.doubleToRawLongBits
-                              (fn.applyAsDouble
-                               (Double.longBitsToDouble(v), x)))))
-                break;                          // Fall back on using base
+            // Fall back on using base
+            else if (casBase(v = base, apply(fn, v, x)))
+                break done;
         }
     }
 
     // Unsafe mechanics
-    private static final sun.misc.Unsafe UNSAFE;
+    private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
     private static final long BASE;
     private static final long CELLSBUSY;
     private static final long PROBE;
     static {
         try {
-            UNSAFE = sun.misc.Unsafe.getUnsafe();
-            Class sk = Striped64.class;
-            BASE = UNSAFE.objectFieldOffset
-                (sk.getDeclaredField("base"));
-            CELLSBUSY = UNSAFE.objectFieldOffset
-                (sk.getDeclaredField("cellsBusy"));
-            Class tk = Thread.class;
-            PROBE = UNSAFE.objectFieldOffset
-                (tk.getDeclaredField("threadLocalRandomProbe"));
-        } catch (Exception e) {
+            BASE = U.objectFieldOffset
+                (Striped64.class.getDeclaredField("base"));
+            CELLSBUSY = U.objectFieldOffset
+                (Striped64.class.getDeclaredField("cellsBusy"));
+
+            PROBE = U.objectFieldOffset
+                (Thread.class.getDeclaredField("threadLocalRandomProbe"));
+        } catch (ReflectiveOperationException e) {
             throw new Error(e);
         }
     }
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/package-info.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/package-info.java
index ce497eb53b9..a8e1ff34528 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/package-info.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/package-info.java
@@ -40,7 +40,7 @@
  * array elements to those that also provide an atomic conditional update
  * operation of the form:
  *
- *  
 {@code boolean compareAndSet(expectedValue, updateValue);}
+ *
 {@code boolean compareAndSet(expectedValue, updateValue);}
* *

This method (which varies in argument types across different * classes) atomically sets a variable to the {@code updateValue} if it @@ -67,7 +67,7 @@ * {@code AtomicInteger} provide atomic increment methods. One * application is to generate sequence numbers, as in: * - *

 {@code
+ * 
 {@code
  * class Sequencer {
  *   private final AtomicLong sequenceNumber
  *     = new AtomicLong(0);
@@ -82,7 +82,7 @@
  * 
 {@code long transform(long input)}
* * write your utility method as follows: - *
 {@code
+ * 
 {@code
  * long getAndTransform(AtomicLong var) {
  *   long prev, next;
  *   do {
@@ -94,18 +94,19 @@
  *
  * 

The memory effects for accesses and updates of atomics generally * follow the rules for volatiles, as stated in - * - * The Java Language Specification (17.4 Memory Model): + * + * Chapter 17 of + * The Java™ Language Specification: * *

    * - *
  • {@code get} has the memory effects of reading a + *
  • {@code get} has the memory effects of reading a * {@code volatile} variable. * - *
  • {@code set} has the memory effects of writing (assigning) a + *
  • {@code set} has the memory effects of writing (assigning) a * {@code volatile} variable. * - *
  • {@code lazySet} has the memory effects of writing (assigning) + *
  • {@code lazySet} has the memory effects of writing (assigning) * a {@code volatile} variable except that it permits reorderings with * subsequent (but not previous) memory actions that do not themselves * impose reordering constraints with ordinary non-{@code volatile} @@ -119,7 +120,7 @@ * with respect to previous or subsequent reads and writes of any * variables other than the target of the {@code weakCompareAndSet}. * - *
  • {@code compareAndSet} + *
  • {@code compareAndSet} * and all other read-and-update operations such as {@code getAndIncrement} * have the memory effects of both reading and * writing {@code volatile} variables. From bed7702d83fc3e4e787de5e59bc59cb4353f5b28 Mon Sep 17 00:00:00 2001 From: Vyom Tewari Date: Tue, 29 Sep 2015 19:50:56 +0200 Subject: [PATCH 14/81] 8038075: JNI warnings in jdk/src/share/native/sun/misc/VMSupport.c Reviewed-by: rriggs --- jdk/src/java.base/share/native/libjava/VMSupport.c | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/src/java.base/share/native/libjava/VMSupport.c b/jdk/src/java.base/share/native/libjava/VMSupport.c index 35c9933d8a2..eb4ab4b2240 100644 --- a/jdk/src/java.base/share/native/libjava/VMSupport.c +++ b/jdk/src/java.base/share/native/libjava/VMSupport.c @@ -42,6 +42,7 @@ Java_sun_misc_VMSupport_initAgentProperties(JNIEnv *env, jclass cls, jobject pro if (!JDK_InitJvmHandle()) { JNU_ThrowInternalError(env, "Handle for JVM not found for symbol lookup"); + return NULL; } InitAgentProperties_fp = (INIT_AGENT_PROPERTIES_FN) JDK_FindJvmEntry("JVM_InitAgentProperties"); From c192a9a96004717484a7f2a0b90ca3c4b2ee11da Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Wed, 30 Sep 2015 12:48:32 +0530 Subject: [PATCH 15/81] 8137320: jjs should support @argfile to pass command line arguments from a file Reviewed-by: attila, hannesw, henryjen --- jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk b/jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk index efc2230ddd0..87353a2d3e9 100644 --- a/jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk +++ b/jdk/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk @@ -26,5 +26,6 @@ include LauncherCommon.gmk $(eval $(call SetupLauncher,jjs, \ + -DENABLE_ARG_FILES \ -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "jdk.nashorn.tools.jjs.Main"$(COMMA) }')) From 95b5f4d550b89f32dbb6115612c8aac9d7933e28 Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Wed, 30 Sep 2015 11:17:32 +0200 Subject: [PATCH 16/81] 8137289: java/util/logging/DrainFindDeadlockTest.java hangs Removed timeout=10 from @run command line. added new debug traces. Reviewed-by: chegar, mchung --- .../util/logging/DrainFindDeadlockTest.java | 44 ++++++++++++------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/jdk/test/java/util/logging/DrainFindDeadlockTest.java b/jdk/test/java/util/logging/DrainFindDeadlockTest.java index 5e769bb5d92..56fd18895be 100644 --- a/jdk/test/java/util/logging/DrainFindDeadlockTest.java +++ b/jdk/test/java/util/logging/DrainFindDeadlockTest.java @@ -35,7 +35,7 @@ import java.util.Map; * @summary check for deadlock between findLogger() and drainLoggerRefQueueBounded() * @author jim.gish@oracle.com * @build DrainFindDeadlockTest - * @run main/othervm/timeout=10 DrainFindDeadlockTest + * @run main/othervm DrainFindDeadlockTest * @key randomness */ @@ -109,9 +109,13 @@ public class DrainFindDeadlockTest { public void run() { System.out.println("Running " + Thread.currentThread().getName()); - for (int i=0; i < MAX_ITERATIONS; i++) { - logger = Logger.getLogger("DrainFindDeadlockTest"+i); - DrainFindDeadlockTest.randomDelay(); + try { + for (int i=0; i < MAX_ITERATIONS; i++) { + logger = Logger.getLogger("DrainFindDeadlockTest"+i); + DrainFindDeadlockTest.randomDelay(); + } + } finally { + System.out.println("Completed " + Thread.currentThread().getName()); } } } @@ -120,13 +124,17 @@ public class DrainFindDeadlockTest { @Override public void run() { System.out.println("Running " + Thread.currentThread().getName()); - for (int i=0; i < MAX_ITERATIONS; i++) { - try { - mgr.readConfiguration(); - } catch (IOException | SecurityException ex) { - throw new RuntimeException("FAILED: test setup problem", ex); + try { + for (int i=0; i < MAX_ITERATIONS; i++) { + try { + mgr.readConfiguration(); + } catch (IOException | SecurityException ex) { + throw new RuntimeException("FAILED: test setup problem", ex); + } + DrainFindDeadlockTest.randomDelay(); } - DrainFindDeadlockTest.randomDelay(); + } finally { + System.out.println("Completed " + Thread.currentThread().getName()); } } } @@ -185,12 +193,16 @@ public class DrainFindDeadlockTest { @Override public void run() { System.out.println("Running " + Thread.currentThread().getName()); - for (int i=0; i < MAX_ITERATIONS*2; i++) { - checkState(t1, t2); - try { - Thread.sleep(10); - } catch (InterruptedException ex) { - }; + try { + for (int i=0; i < MAX_ITERATIONS*2; i++) { + checkState(t1, t2); + try { + Thread.sleep(10); + } catch (InterruptedException ex) { + } + } + } finally { + System.out.println("Completed " + Thread.currentThread().getName()); } } } From fb9ae3bb1069641d7a2b4f3df3bb4d579617fb01 Mon Sep 17 00:00:00 2001 From: Artem Smotrakov Date: Wed, 30 Sep 2015 15:30:50 +0300 Subject: [PATCH 17/81] 8137174: NTLM impl should use doPrivileged when it reads system properties Reviewed-by: chegar --- .../classes/com/sun/security/ntlm/NTLM.java | 6 +- .../http/ntlm/NTLMAuthentication.java | 7 +- .../HttpURLConnection/NTLMAuthWithSM.java | 183 ++++++++++++++++++ .../HttpURLConnection/NTLMAuthWithSM.policy | 7 + 4 files changed, 198 insertions(+), 5 deletions(-) create mode 100644 jdk/test/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.java create mode 100644 jdk/test/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.policy diff --git a/jdk/src/java.base/share/classes/com/sun/security/ntlm/NTLM.java b/jdk/src/java.base/share/classes/com/sun/security/ntlm/NTLM.java index da18e2199ac..ee694e3f5fc 100644 --- a/jdk/src/java.base/share/classes/com/sun/security/ntlm/NTLM.java +++ b/jdk/src/java.base/share/classes/com/sun/security/ntlm/NTLM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2015, 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 @@ -56,7 +56,9 @@ class NTLM { private final Mac hmac; private final MessageDigest md5; private static final boolean DEBUG = - System.getProperty("ntlm.debug") != null; + java.security.AccessController.doPrivileged( + new sun.security.action.GetBooleanAction("ntlm.debug")) + .booleanValue(); final Version v; diff --git a/jdk/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java b/jdk/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java index 398dda86f57..0e067d0681f 100644 --- a/jdk/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java +++ b/jdk/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, 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 @@ -143,8 +143,9 @@ public class NTLMAuthentication extends AuthenticationInfo { password = pw.getPassword(); init0(); try { - client = new Client(System.getProperty("ntlm.version"), hostname, - username, ntdomain, password); + String version = java.security.AccessController.doPrivileged( + new sun.security.action.GetPropertyAction("ntlm.version")); + client = new Client(version, hostname, username, ntdomain, password); } catch (NTLMException ne) { try { client = new Client(null, hostname, username, ntdomain, password); diff --git a/jdk/test/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.java b/jdk/test/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.java new file mode 100644 index 00000000000..1859576a273 --- /dev/null +++ b/jdk/test/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.java @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.IOException; +import java.io.InputStream; +import java.net.Authenticator; +import java.net.InetSocketAddress; +import java.net.PasswordAuthentication; +import java.net.URL; +import java.net.URLConnection; +import java.util.List; +import sun.net.www.protocol.http.ntlm.NTLMAuthenticationCallback; + +/* + * @test + * @bug 8137174 + * @summary Checks if NTLM auth works fine if security manager set + * @run main/othervm/java.security.policy=NTLMAuthWithSM.policy NTLMAuthWithSM + */ +public class NTLMAuthWithSM { + + public static void main(String[] args) throws Exception { + // security manager is required + if (System.getSecurityManager() == null) { + throw new RuntimeException("Security manager not specified"); + } + + if (System.getProperty("os.name").startsWith("Windows")) { + // disable transparent NTLM authentication on Windows + NTLMAuthenticationCallback.setNTLMAuthenticationCallback( + new NTLMAuthenticationCallbackImpl()); + } + + try (LocalHttpServer server = LocalHttpServer.startServer()) { + // set authenticator + Authenticator.setDefault(new AuthenticatorImpl()); + + String url = String.format("http://localhost:%d/test/", + server.getPort()); + + // load a document which is protected with NTML authentication + System.out.println("load() called: " + url); + URLConnection conn = new URL(url).openConnection(); + try (BufferedReader reader = new BufferedReader( + new InputStreamReader(conn.getInputStream()))) { + + String line = reader.readLine(); + if (line == null) { + throw new IOException("Couldn't read a response"); + } + do { + System.out.println(line); + } while ((line = reader.readLine()) != null); + } + } + + System.out.println("Test passed"); + } + + private static class AuthenticatorImpl extends Authenticator { + + @Override + public PasswordAuthentication getPasswordAuthentication() { + System.out.println("getPasswordAuthentication() called, scheme: " + + getRequestingScheme()); + if (getRequestingScheme().equalsIgnoreCase("ntlm")) { + return new PasswordAuthentication("test", "test".toCharArray()); + } + return null; + } + } + + // local http server which pretends to support NTLM auth + static class LocalHttpServer implements HttpHandler, AutoCloseable { + + private final HttpServer server; + + private LocalHttpServer(HttpServer server) { + this.server = server; + } + + static LocalHttpServer startServer() throws IOException { + HttpServer httpServer = HttpServer.create( + new InetSocketAddress(0), 0); + LocalHttpServer localHttpServer = new LocalHttpServer(httpServer); + localHttpServer.start(); + + return localHttpServer; + } + + void start() { + server.createContext("/test", this); + server.start(); + System.out.println("HttpServer: started on port " + getPort()); + } + + void stop() { + server.stop(0); + System.out.println("HttpServer: stopped"); + } + + int getPort() { + return server.getAddress().getPort(); + } + + @Override + public void handle(HttpExchange t) throws IOException { + System.out.println("HttpServer: handle connection"); + + // read a request + try (InputStream is = t.getRequestBody()) { + while (is.read() > 0); + } + + try { + List headers = t.getRequestHeaders() + .get("Authorization"); + if (headers != null && !headers.isEmpty() + && headers.get(0).trim().contains("NTLM")) { + byte[] output = "hello".getBytes(); + t.sendResponseHeaders(200, output.length); + t.getResponseBody().write(output); + System.out.println("HttpServer: return 200"); + } else { + t.getResponseHeaders().set("WWW-Authenticate", "NTLM"); + byte[] output = "forbidden".getBytes(); + t.sendResponseHeaders(401, output.length); + t.getResponseBody().write(output); + System.out.println("HttpServer: return 401"); + } + } catch (IOException e) { + System.out.println("HttpServer: exception: " + e); + System.out.println("HttpServer: return 500"); + t.sendResponseHeaders(500, 0); + } finally { + t.close(); + } + } + + @Override + public void close() { + stop(); + } + } + + private static class NTLMAuthenticationCallbackImpl + extends NTLMAuthenticationCallback { + + // don't trust any site, so that no transparent NTLM auth happens + @Override + public boolean isTrustedSite(URL url) { + System.out.println( + "NTLMAuthenticationCallbackImpl.isTrustedSite() called: " + + "return false"); + return false; + } + } +} diff --git a/jdk/test/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.policy b/jdk/test/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.policy new file mode 100644 index 00000000000..8b024f3a871 --- /dev/null +++ b/jdk/test/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.policy @@ -0,0 +1,7 @@ +grant { + permission java.net.NetPermission "setDefaultAuthenticator"; + permission java.net.SocketPermission "localhost:*", + "connect,resolve,listen,accept"; + permission java.lang.RuntimePermission + "accessClassInPackage.sun.net.www.protocol.http.ntlm"; +}; From eda52119fbe5a48667f0a79c3f39042b76272750 Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Wed, 30 Sep 2015 12:33:08 -0400 Subject: [PATCH 18/81] 8137313: TreeTest.java intermittently fails with a timeout Enhance debugging information Reviewed-by: chegar, darcy --- .../java/lang/ProcessHandle/TreeTest.java | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/jdk/test/java/lang/ProcessHandle/TreeTest.java b/jdk/test/java/lang/ProcessHandle/TreeTest.java index b150acd0824..b41f3c276af 100644 --- a/jdk/test/java/lang/ProcessHandle/TreeTest.java +++ b/jdk/test/java/lang/ProcessHandle/TreeTest.java @@ -34,6 +34,7 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.concurrent.ExecutionException; +import jdk.testlibrary.Utils; import org.testng.Assert; import org.testng.TestNG; import org.testng.annotations.Test; @@ -174,7 +175,7 @@ public class TreeTest extends ProcessUtil { // Poll until all 9 child processes exist or the timeout is reached int expected = 9; - long timeout = jdk.testlibrary.Utils.adjustTimeout(10L); + long timeout = Utils.adjustTimeout(10L); Instant endTimeout = Instant.now().plusSeconds(timeout); do { Thread.sleep(200L); @@ -223,6 +224,10 @@ public class TreeTest extends ProcessUtil { /** * Test destroy of processes. + * A JavaChild is started and it starts three children. + * Each one is then checked to be alive and listed by allChildren + * and forcibly destroyed. + * After they exit they should no longer be listed by allChildren. */ @Test public static void test3() { @@ -239,7 +244,7 @@ public class TreeTest extends ProcessUtil { // Spawn children and have them wait p1.sendAction("spawn", newChildren, "stdin"); - // Gather the PIDs from the output of the spawing process + // Gather the PIDs from the output of the spawning process p1.forEachOutputLine((s) -> { String[] split = s.trim().split(" "); if (split.length == 3 && split[1].equals("spawn")) { @@ -259,15 +264,23 @@ public class TreeTest extends ProcessUtil { Assert.assertTrue(allChildren.contains(p), "Spawned child should be listed in allChildren: " + p); p.destroyForcibly(); }); + Assert.assertEquals(processes.size(), newChildren, "Wrong number of children"); processes.forEach((p, parent) -> { - while (p.isAlive()) { + for (long retries = Utils.adjustTimeout(100L); retries > 0 ; retries--) { + if (!p.isAlive()) { + return; // not alive, go on to the next + } + // Wait a bit and retry try { - Thread.sleep(100L); // It will happen but don't burn the cpu + Thread.sleep(100L); } catch (InterruptedException ie) { // try again } } + printf("Timeout waiting for exit of pid %s, parent: %s, info: %s%n", + p, parent, p.info()); + Assert.fail("Process still alive: " + p); }); p1.destroyForcibly(); p1.waitFor(); @@ -281,7 +294,12 @@ public class TreeTest extends ProcessUtil { } catch (InterruptedException inte) { Assert.fail("InterruptedException", inte); } finally { - processes.forEach((p, parent) -> p.destroyForcibly()); + processes.forEach((p, parent) -> { + if (p.isAlive()) { + ProcessUtil.printProcess(p); + p.destroyForcibly(); + } + }); } } From 112eb7283e64bae028ed470d5aa96fe85eb4bdc8 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Wed, 30 Sep 2015 15:25:29 -0700 Subject: [PATCH 19/81] 8136874: Bug in port of fdlibm pow to Java Reviewed-by: bpb --- .../share/classes/java/lang/FdLibm.java | 6 +- jdk/test/java/lang/StrictMath/PowTests.java | 301 ++++++++++++++++++ 2 files changed, 304 insertions(+), 3 deletions(-) create mode 100644 jdk/test/java/lang/StrictMath/PowTests.java diff --git a/jdk/src/java.base/share/classes/java/lang/FdLibm.java b/jdk/src/java.base/share/classes/java/lang/FdLibm.java index ed0236d5929..8b6a8dcd172 100644 --- a/jdk/src/java.base/share/classes/java/lang/FdLibm.java +++ b/jdk/src/java.base/share/classes/java/lang/FdLibm.java @@ -352,15 +352,15 @@ class FdLibm { double p_h, p_l, t1, t2; // |y| is huge - if (y_abs > 0x1.0p31) { // if |y| > 2**31 + if (y_abs > 0x1.00000_ffff_ffffp31) { // if |y| > ~2**31 final double INV_LN2 = 0x1.7154_7652_b82fep0; // 1.44269504088896338700e+00 = 1/ln2 final double INV_LN2_H = 0x1.715476p0; // 1.44269502162933349609e+00 = 24 bits of 1/ln2 final double INV_LN2_L = 0x1.4ae0_bf85_ddf44p-26; // 1.92596299112661746887e-08 = 1/ln2 tail // Over/underflow if x is not close to one - if (x_abs < 0x1.fffffp-1) // |x| < 0.9999995231628418 + if (x_abs < 0x1.fffff_0000_0000p-1) // |x| < ~0.9999995231628418 return (y < 0.0) ? s * INFINITY : s * 0.0; - if (x_abs > 1.0) // |x| > 1.0 + if (x_abs > 0x1.00000_ffff_ffffp0) // |x| > ~1.0 return (y > 0.0) ? s * INFINITY : s * 0.0; /* * now |1-x| is tiny <= 2**-20, sufficient to compute diff --git a/jdk/test/java/lang/StrictMath/PowTests.java b/jdk/test/java/lang/StrictMath/PowTests.java new file mode 100644 index 00000000000..338cf42d54c --- /dev/null +++ b/jdk/test/java/lang/StrictMath/PowTests.java @@ -0,0 +1,301 @@ +/* + * Copyright (c) 2003, 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8136874 + * @summary Tests for StrictMath.pow + * @author Joseph D. Darcy + */ + +/** + * The tests in ../Math/PowTests.java test properties that should + * hold for any pow implementation, including the FDLIBM-based one + * required for StrictMath.pow. Therefore, the test cases in + * ../Math/PowTests.java are run against both the Math and + * StrictMath versions of pow. The role of this test is to verify + * that the FDLIBM pow algorithm is being used by running golden + * file tests on values that may vary from one conforming pow + * implementation to another. + */ + +public class PowTests { + private PowTests(){} + + private static final double INFINITY = Double.POSITIVE_INFINITY; + + public static void main(String... args) { + int failures = 0; + + failures += testPow(); + + if (failures > 0) { + System.err.println("Testing pow incurred " + + failures + " failures."); + throw new RuntimeException(); + } + } + + private static int testPow() { + int failures = 0; + + double [][] testCases = { + // Probe near decision points of the fdlibm algorithm + + {0x1.00000_0000_0001p1, // |x| > 1.0 + INFINITY, // infinity + INFINITY // 0 + }, + + + {0x1.fffffp-1, // |x| = 0.9999995231628418 + 0x1.0p31, // 2^31 + 0.0 // 0 + }, + + {0x1.ffffe_ffffffffp-1, // |x| < 0.9999995231628418 + 0x1.0p31, // 2^31 + 0.0 // 0 + }, + + {-0x1.ffffe_ffffffffp-1, // |x| < 0.9999995231628418 + 0x1.0p31, // 2^31 + 0.0 // 0 + }, + + {0x1.fffffp-1, // |x| = 0.9999995231628418 + 0x1.0000000000001p31, // nextUp(2^31) + 0.0 // 0 + }, + + {0x1.fffffp-1, // |x| = 0.9999995231628418 + 0x1.0p31 + 1.0, // 2^31 + 1, odd integer + 0.0 // 0 + }, + + {0x1.fffffp-1, // |x| = 0.9999995231628418 + 0x1.0p31 + 2.0, // 2^31 + 2, even integer + 0.0 // 0 + }, + + {0x1.ffffe_ffffffffp-1, // |x| < 0.9999995231628418 + 0x1.0000000000001p31, // nextUp(2^31) + 0.0 // 0 + }, + + {-0x1.ffffe_ffffffffp-1, // |x| < 0.9999995231628418 + 0x1.0000000000001p31, // nextUp(2^31) + Double.NaN // 0 + }, + + {-0x1.ffffe_ffffffffp-1, // |x| < 0.9999995231628418 + 0x1.0p31 + 1.0, // 2^31 + 1, odd integer + -0.0 // 0 + }, + + {-0x1.ffffe_ffffffffp-1, // |x| < 0.9999995231628418 + 0x1.0p31 + 2.0, // 2^31 + 2, even integer + 0.0 // 0 + }, + + {0x1.0000000000001p0, // nextUp(1) + 0x1.0000000000001p31, // nextUp(2^31) + 0x1.00000800002p0 + }, + + {0x1.0000000000001p0, // nextUp(1) + -0x1.0000000000001p31, // -nextUp(2^31) + 0x1.fffff000004p-1 + }, + + {-0x1.0000000000001p0, // -nextUp(1) + -0x1.0000000000001p31, // -nextUp(2^31) + Double.NaN + }, + + {-0x1.0000000000001p0, // -nextUp(1) + 0x1.0p31 + 1.0, // 2^31 + 1, odd integer + -0x1.0000080000201p0 + }, + + {-0x1.0000000000001p0, // -nextUp(1) + 0x1.0p31 + 2.0, // 2^31 + 2, even integer + 0x1.0000080000202p0 + }, + + {0x1.00000_ffff_ffffp0, + 0x1.00001_0000_0000p31, + INFINITY + }, + + // Huge y, |y| > 0x1.00000_ffff_ffffp31 ~2**31 is a decision point + + // First y = 0x1.00001_0000_0000p31 + {0x1.fffff_ffff_ffffp-1, + 0x1.00001_0000_0000p31, + 0x1.fffff7ffff9p-1 + }, + + {0x1.fffff_ffff_fffep-1, + 0x1.00001_0000_0000p31, + 0x1.ffffefffff4p-1 + }, + + {0x1.fffff_0000_0000p-1, + 0x1.00001_0000_0000p31, + 0.0 + }, + + // Cycle through decision points on x values + + {0x1.fffff_0000_0000p-1, + 0x1.00001_0000_0000p31, + 0.0 + }, + + {-0x1.fffff_0000_0000p-1, + 0x1.00001_0000_0000p31, + 0.0 + }, + + {0x1.ffffe_ffff_ffffp-1, + 0x1.00001_0000_0000p31, + 0.0 + }, + + {-0x1.ffffe_ffff_ffffp-1, + 0x1.00001_0000_0000p31, + 0.0 + }, + + {0x1.00000_ffff_ffffp0, + 0x1.00001_0000_0000p31, + INFINITY + }, + + + {0x1.00001_0000_0000p0, + 0x1.00001_0000_0000p31, + INFINITY + }, + + {-0x1.00000_ffff_ffffp0, + 0x1.00001_0000_0000p31, + INFINITY + }, + + + {-0x1.00001_0000_0000p0, + 0x1.00001_0000_0000p31, + INFINITY + }, + + // Now y = -0x1.00001_0000_0000p31 + + {0x1.fffff_0000_0000p-1, + -0x1.00001_0000_0000p31, + INFINITY + }, + + {-0x1.fffff_0000_0000p-1, + 0x1.00001_0000_0000p31, + 0.0 + }, + + {0x1.ffffe_ffff_ffffp-1, + -0x1.00001_0000_0000p31, + INFINITY + }, + + {-0x1.ffffe_ffff_ffffp-1, + -0x1.00001_0000_0000p31, + INFINITY + }, + + {0x1.00000_ffff_ffffp0, + -0x1.00001_0000_0000p31, + 0.0 + }, + + + {0x1.00001_0000_0000p0, + -0x1.00001_0000_0000p31, + 0.0 + }, + + {-0x1.00000_ffff_ffffp0, + -0x1.00001_0000_0000p31, + 0.0 + }, + + + {-0x1.00001_0000_0000p0, + -0x1.00001_0000_0000p31, + 0.0 + }, + + //----------------------- + + {0x1.ffffe_ffff_ffffp-1, + -0x1.00001_0000_0000p31, + INFINITY + }, + + {0x1.00001_0000_0000p0, + -0x1.00001_0000_0000p31, + 0.0 + }, + + + {0x1.0000000000002p0, // 1.0000000000000004 + 0x1.f4add4p30, // 2.1E9 + 0x1.00000fa56f1a6p0 // 1.0000009325877754 + }, + + // Verify no early overflow + {0x1.0000000000002p0, // 1.0000000000000004 + 0x1.0642acp31, // 2.2E9 + 0x1.000010642b465p0, // 1.0000009769967388 + }, + + // Verify proper overflow + {0x1.0000000000002p0, // 1.0000000000000004 + 0x1.62e42fefa39fp60, // 1.59828858065033216E18 + 0x1.ffffffffffd9fp1023, // 1.7976931348621944E308 + }, + + }; + + for (double[] testCase: testCases) + failures += testPowCase(testCase[0], testCase[1], testCase[2]); + + return failures; + } + + private static int testPowCase(double input1, double input2, double expected) { + int failures = 0; + failures += Tests.test("StrictMath.pow(double)", input1, input2, + StrictMath.pow(input1, input2), expected); + return failures; + } +} From ddf365ac9979659ff637178416f4d8bc812651d8 Mon Sep 17 00:00:00 2001 From: Rob McKenna Date: Thu, 1 Oct 2015 00:09:51 +0100 Subject: [PATCH 20/81] 8135305: InetAddress.isReachable reports true when loopback interface is specified Reviewed-by: michaelm --- .../windows/native/libnet/Inet4AddressImpl.c | 70 ++++++++++++++----- .../IsReachableViaLoopbackTest.java | 40 +++++++++++ 2 files changed, 91 insertions(+), 19 deletions(-) create mode 100644 jdk/test/java/net/InetAddress/IsReachableViaLoopbackTest.java diff --git a/jdk/src/java.base/windows/native/libnet/Inet4AddressImpl.c b/jdk/src/java.base/windows/native/libnet/Inet4AddressImpl.c index f786a8056d6..5213383c1e5 100644 --- a/jdk/src/java.base/windows/native/libnet/Inet4AddressImpl.c +++ b/jdk/src/java.base/windows/native/libnet/Inet4AddressImpl.c @@ -283,8 +283,11 @@ Java_java_net_Inet4AddressImpl_getHostByAddr(JNIEnv *env, jobject this, * Returns true is an ECHO_REPLY is received, otherwise, false. */ static jboolean -ping4(JNIEnv *env, unsigned long ipaddr, jint timeout) { - +ping4(JNIEnv *env, + unsigned long src_addr, + unsigned long dest_addr, + jint timeout) +{ // See https://msdn.microsoft.com/en-us/library/aa366050%28VS.85%29.aspx HANDLE hIcmpFile; @@ -307,14 +310,29 @@ ping4(JNIEnv *env, unsigned long ipaddr, jint timeout) { return JNI_FALSE; } - dwRetVal = IcmpSendEcho(hIcmpFile, // HANDLE IcmpHandle, - ipaddr, // IPAddr DestinationAddress, - SendData, // LPVOID RequestData, - sizeof(SendData), // WORD RequestSize, - NULL, // PIP_OPTION_INFORMATION RequestOptions, - ReplyBuffer,// LPVOID ReplyBuffer, - ReplySize, // DWORD ReplySize, - timeout); // DWORD Timeout + if (src_addr == 0) { + dwRetVal = IcmpSendEcho(hIcmpFile, // HANDLE IcmpHandle, + dest_addr, // IPAddr DestinationAddress, + SendData, // LPVOID RequestData, + sizeof(SendData), // WORD RequestSize, + NULL, // PIP_OPTION_INFORMATION RequestOptions, + ReplyBuffer,// LPVOID ReplyBuffer, + ReplySize, // DWORD ReplySize, + timeout); // DWORD Timeout + } else { + dwRetVal = IcmpSendEcho2Ex(hIcmpFile, // HANDLE IcmpHandle, + NULL, // HANDLE Event + NULL, // PIO_APC_ROUTINE ApcRoutine + NULL, // ApcContext + src_addr, // IPAddr SourceAddress, + dest_addr, // IPAddr DestinationAddress, + SendData, // LPVOID RequestData, + sizeof(SendData), // WORD RequestSize, + NULL, // PIP_OPTION_INFORMATION RequestOptions, + ReplyBuffer,// LPVOID ReplyBuffer, + ReplySize, // DWORD ReplySize, + timeout); // DWORD Timeout + } free(ReplyBuffer); IcmpCloseHandle(hIcmpFile); @@ -337,9 +355,9 @@ Java_java_net_Inet4AddressImpl_isReachable0(JNIEnv *env, jobject this, jint timeout, jbyteArray ifArray, jint ttl) { - jint addr; + jint src_addr = 0; + jint dest_addr = 0; jbyte caddr[4]; - struct sockaddr_in him; int sz; /** @@ -349,14 +367,28 @@ Java_java_net_Inet4AddressImpl_isReachable0(JNIEnv *env, jobject this, if (sz != 4) { return JNI_FALSE; } - memset((char *) &him, 0, sizeof(him)); memset((char *) caddr, 0, sizeof(caddr)); (*env)->GetByteArrayRegion(env, addrArray, 0, 4, caddr); - addr = ((caddr[0]<<24) & 0xff000000); - addr |= ((caddr[1] <<16) & 0xff0000); - addr |= ((caddr[2] <<8) & 0xff00); - addr |= (caddr[3] & 0xff); - addr = htonl(addr); + dest_addr = ((caddr[0]<<24) & 0xff000000); + dest_addr |= ((caddr[1] <<16) & 0xff0000); + dest_addr |= ((caddr[2] <<8) & 0xff00); + dest_addr |= (caddr[3] & 0xff); + dest_addr = htonl(dest_addr); - return ping4(env, addr, timeout); + /** + * If a network interface was specified, let's convert its address + * as well. + */ + if (!(IS_NULL(ifArray))) { + memset((char *) caddr, 0, sizeof(caddr)); + (*env)->GetByteArrayRegion(env, ifArray, 0, 4, caddr); + src_addr = ((caddr[0]<<24) & 0xff000000); + src_addr |= ((caddr[1] <<16) & 0xff0000); + src_addr |= ((caddr[2] <<8) & 0xff00); + src_addr |= (caddr[3] & 0xff); + src_addr = htonl(src_addr); + } + + return ping4(env, src_addr, dest_addr, timeout); } + diff --git a/jdk/test/java/net/InetAddress/IsReachableViaLoopbackTest.java b/jdk/test/java/net/InetAddress/IsReachableViaLoopbackTest.java new file mode 100644 index 00000000000..4d7f266ec1d --- /dev/null +++ b/jdk/test/java/net/InetAddress/IsReachableViaLoopbackTest.java @@ -0,0 +1,40 @@ +import java.io.*; +import java.net.*; +import java.util.*; + +/** + * @test + * @bug 8135305 + * @summary ensure we can't ping external hosts via loopback if + */ + +public class IsReachableViaLoopbackTest { + public static void main(String[] args) { + try { + InetAddress addr = InetAddress.getByName("localhost"); + InetAddress remoteAddr = InetAddress.getByName("bugs.openjdk.java.net"); + if (!addr.isReachable(10000)) + throw new RuntimeException("Localhost should always be reachable"); + NetworkInterface inf = NetworkInterface.getByInetAddress(addr); + if (inf != null) { + if (!addr.isReachable(inf, 20, 10000)) { + throw new RuntimeException("Localhost should always be reachable"); + } else { + System.out.println(addr + " is reachable"); + } + if (remoteAddr.isReachable(inf, 20, 10000)) { + throw new RuntimeException(remoteAddr + " is reachable"); + } else { + System.out.println(remoteAddr + " is NOT reachable"); + } + } else { + System.out.println("inf == null"); + } + + } catch (IOException e) { + throw new RuntimeException("Unexpected exception:" + e); + } + System.out.println("IsReachableViaLoopbackTest EXIT"); + } +} + From 7127fab647b7dcc500c2c07e5ea0c9a21aefc761 Mon Sep 17 00:00:00 2001 From: Rob McKenna Date: Thu, 1 Oct 2015 00:13:09 +0100 Subject: [PATCH 21/81] 8133249: Occasional SIGSEGV: non thread-safe use of strerr in getLastErrorString Reviewed-by: igerasim, rriggs, christos --- jdk/make/lib/CoreLibraries.gmk | 1 + jdk/make/mapfiles/libjava/mapfile-vers | 3 ++- .../java.base/share/native/libjava/jni_util.h | 1 + .../java.base/share/native/libzip/zip_util.c | 15 ++++++++--- .../unix/native/libjava/ProcessImpl_md.c | 7 ++--- .../unix/native/libjava/jni_util_md.c | 27 +++++++++++-------- .../native/libnet/PlainDatagramSocketImpl.c | 22 ++++++++------- .../native/libnio/fs/UnixNativeDispatcher.c | 14 +++------- .../windows/native/libjava/jni_util_md.c | 17 +++++++----- .../libnet/TwoStacksPlainDatagramSocketImpl.c | 7 +++-- 10 files changed, 68 insertions(+), 46 deletions(-) diff --git a/jdk/make/lib/CoreLibraries.gmk b/jdk/make/lib/CoreLibraries.gmk index e6138e26e1e..843324c5329 100644 --- a/jdk/make/lib/CoreLibraries.gmk +++ b/jdk/make/lib/CoreLibraries.gmk @@ -160,6 +160,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \ -framework Security -framework SystemConfiguration, \ LDFLAGS_SUFFIX_windows := -export:winFileHandleOpen -export:handleLseek \ -export:getLastErrorString \ + -export:getErrorString \ jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \ shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \ advapi32.lib version.lib, \ diff --git a/jdk/make/mapfiles/libjava/mapfile-vers b/jdk/make/mapfiles/libjava/mapfile-vers index e77eca01e48..afc317bb5cf 100644 --- a/jdk/make/mapfiles/libjava/mapfile-vers +++ b/jdk/make/mapfiles/libjava/mapfile-vers @@ -282,8 +282,9 @@ SUNWprivate_1.1 { # ZipFile.c needs this one throwFileNotFoundException; - # zip_util.c needs this one + # zip_util.c needs these getLastErrorString; + getErrorString; # Outcalls from libjvm done using dlsym(). diff --git a/jdk/src/java.base/share/native/libjava/jni_util.h b/jdk/src/java.base/share/native/libjava/jni_util.h index 5278ebe0f45..0db1f1099c8 100644 --- a/jdk/src/java.base/share/native/libjava/jni_util.h +++ b/jdk/src/java.base/share/native/libjava/jni_util.h @@ -388,6 +388,7 @@ void buildJniFunctionName(const char *sym, const char *cname, char *jniEntryName); extern size_t getLastErrorString(char *buf, size_t len); +extern int getErrorString(int err, char *buf, size_t len); #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ diff --git a/jdk/src/java.base/share/native/libzip/zip_util.c b/jdk/src/java.base/share/native/libzip/zip_util.c index c7505f6aefb..ef1f67fc8ba 100644 --- a/jdk/src/java.base/share/native/libzip/zip_util.c +++ b/jdk/src/java.base/share/native/libzip/zip_util.c @@ -1438,6 +1438,7 @@ jboolean JNICALL ZIP_ReadEntry(jzfile *zip, jzentry *entry, unsigned char *buf, char *entryname) { char *msg; + char tmpbuf[1024]; strcpy(entryname, entry->name); if (entry->csize == 0) { @@ -1456,8 +1457,11 @@ ZIP_ReadEntry(jzfile *zip, jzentry *entry, unsigned char *buf, char *entryname) msg = zip->msg; ZIP_Unlock(zip); if (n == -1) { - jio_fprintf(stderr, "%s: %s\n", zip->name, - msg != 0 ? msg : strerror(errno)); + if (msg == 0) { + getErrorString(errno, tmpbuf, sizeof(tmpbuf)); + msg = tmpbuf; + } + jio_fprintf(stderr, "%s: %s\n", zip->name, msg); return JNI_FALSE; } buf += n; @@ -1470,8 +1474,11 @@ ZIP_ReadEntry(jzfile *zip, jzentry *entry, unsigned char *buf, char *entryname) if ((msg == NULL) || (*msg == 0)) { msg = zip->msg; } - jio_fprintf(stderr, "%s: %s\n", zip->name, - msg != 0 ? msg : strerror(errno)); + if (msg == 0) { + getErrorString(errno, tmpbuf, sizeof(tmpbuf)); + msg = tmpbuf; + } + jio_fprintf(stderr, "%s: %s\n", zip->name, msg); return JNI_FALSE; } } diff --git a/jdk/src/java.base/unix/native/libjava/ProcessImpl_md.c b/jdk/src/java.base/unix/native/libjava/ProcessImpl_md.c index 44777a43f2e..3408bdd9762 100644 --- a/jdk/src/java.base/unix/native/libjava/ProcessImpl_md.c +++ b/jdk/src/java.base/unix/native/libjava/ProcessImpl_md.c @@ -248,12 +248,13 @@ throwIOException(JNIEnv *env, int errnum, const char *defaultDetail) const char *detail = defaultDetail; char *errmsg; size_t fmtsize; + char tmpbuf[1024]; jstring s; if (errnum != 0) { - const char *s = strerror(errnum); - if (strcmp(s, "Unknown error") != 0) - detail = s; + int ret = getErrorString(errnum, tmpbuf, sizeof(tmpbuf)); + if (ret != EINVAL) + detail = tmpbuf; } /* ASCII Decimal representation uses 2.4 times as many bits as binary. */ fmtsize = sizeof(IOE_FORMAT) + strlen(detail) + 3 * sizeof(errnum); diff --git a/jdk/src/java.base/unix/native/libjava/jni_util_md.c b/jdk/src/java.base/unix/native/libjava/jni_util_md.c index e0c479b96ca..a0b08bee587 100644 --- a/jdk/src/java.base/unix/native/libjava/jni_util_md.c +++ b/jdk/src/java.base/unix/native/libjava/jni_util_md.c @@ -30,6 +30,13 @@ #include "jni_util.h" #include "dlfcn.h" +#if defined(LINUX) && (defined(_GNU_SOURCE) || \ + (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE < 200112L \ + && defined(_XOPEN_SOURCE) && _XOPEN_SOURCE < 600)) +extern int __xpg_strerror_r(int, char *, size_t); +#define strerror_r(a, b, c) __xpg_strerror_r((a), (b), (c)) +#endif + void* getProcessHandle() { static void *procHandle = NULL; if (procHandle != NULL) { @@ -55,16 +62,14 @@ void buildJniFunctionName(const char *sym, const char *cname, size_t getLastErrorString(char *buf, size_t len) { - char *err; - size_t n; if (errno == 0 || len < 1) return 0; - - err = strerror(errno); - n = strlen(err); - if (n >= len) - n = len - 1; - - strncpy(buf, err, n); - buf[n] = '\0'; - return n; + getErrorString(errno, buf, len); + return strlen(buf); +} + +int +getErrorString(int err, char *buf, size_t len) +{ + if (err == 0 || len < 1) return 0; + return strerror_r(err, buf, len); } diff --git a/jdk/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c b/jdk/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c index b7b43e28d87..e6f18428769 100644 --- a/jdk/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c +++ b/jdk/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c @@ -918,6 +918,7 @@ Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate(JNIEnv *env, jobject this) { jobject fdObj = (*env)->GetObjectField(env, this, pdsi_fdID); int arg, fd, t = 1; + char tmpbuf[1024]; #ifdef AF_INET6 int domain = ipv6_available() ? AF_INET6 : AF_INET; #else @@ -953,22 +954,23 @@ Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate(JNIEnv *env, arg = 65507; if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&arg, sizeof(arg)) < 0) { - JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", - strerror(errno)); + getErrorString(errno, tmpbuf, sizeof(tmpbuf)); + JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", tmpbuf); close(fd); return; } if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&arg, sizeof(arg)) < 0) { - JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", - strerror(errno)); + getErrorString(errno, tmpbuf, sizeof(tmpbuf)); + JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", tmpbuf); close(fd); return; } #endif /* __APPLE__ */ if (setsockopt(fd, SOL_SOCKET, SO_BROADCAST, (char*) &t, sizeof (int)) < 0) { - JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", strerror(errno)); + getErrorString(errno, tmpbuf, sizeof(tmpbuf)); + JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", tmpbuf); close(fd); return; } @@ -977,9 +979,10 @@ Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate(JNIEnv *env, arg = 0; int level = (domain == AF_INET6) ? IPPROTO_IPV6 : IPPROTO_IP; if ((setsockopt(fd, level, IP_MULTICAST_ALL, (char*)&arg, sizeof(arg)) < 0) && - (errno != ENOPROTOOPT)) { - JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", - strerror(errno)); + (errno != ENOPROTOOPT)) + { + getErrorString(errno, tmpbuf, sizeof(tmpbuf)); + JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", tmpbuf); close(fd); return; } @@ -994,7 +997,8 @@ Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate(JNIEnv *env, int ttl = 1; if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, (char *) &ttl, sizeof (ttl)) < 0) { - JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", strerror(errno)); + getErrorString(errno, tmpbuf, sizeof(tmpbuf)); + JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", tmpbuf); close(fd); return; } diff --git a/jdk/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c b/jdk/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c index 2808cc189f8..262986f9c05 100644 --- a/jdk/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c +++ b/jdk/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c @@ -315,21 +315,15 @@ Java_sun_nio_fs_UnixNativeDispatcher_getcwd(JNIEnv* env, jclass this) { JNIEXPORT jbyteArray Java_sun_nio_fs_UnixNativeDispatcher_strerror(JNIEnv* env, jclass this, jint error) { - char* msg; + char tmpbuf[1024]; jsize len; jbyteArray bytes; -#ifdef _AIX - /* strerror() is not thread-safe on AIX so we have to use strerror_r() */ - char buffer[256]; - msg = (strerror_r((int)error, buffer, 256) == 0) ? buffer : "Error while calling strerror_r"; -#else - msg = strerror((int)error); -#endif - len = strlen(msg); + getErrorString((int)errno, tmpbuf, sizeof(tmpbuf)); + len = strlen(tmpbuf); bytes = (*env)->NewByteArray(env, len); if (bytes != NULL) { - (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)msg); + (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)tmpbuf); } return bytes; } diff --git a/jdk/src/java.base/windows/native/libjava/jni_util_md.c b/jdk/src/java.base/windows/native/libjava/jni_util_md.c index 374e3084c07..5dd0179432c 100644 --- a/jdk/src/java.base/windows/native/libjava/jni_util_md.c +++ b/jdk/src/java.base/windows/native/libjava/jni_util_md.c @@ -108,13 +108,9 @@ getLastErrorString(char *utf8_jvmErrorMsg, size_t cbErrorMsg) } } else if (errno != 0) { // C runtime error that has no corresponding WIN32 error code - const WCHAR *rtError = _wcserror(errno); - if (rtError != NULL) { - wcsncpy(utf16_osErrorMsg, rtError, cbErrorMsg); - // truncate if too long - utf16_osErrorMsg[cbErrorMsg - 1] = L'\0'; + int ret = _wcserror_s(utf16_osErrorMsg, cbErrorMsg, errno); + if (ret == 0) n = wcslen(utf16_osErrorMsg); - } } else noError = TRUE; //OS has no error to report @@ -147,3 +143,12 @@ getLastErrorString(char *utf8_jvmErrorMsg, size_t cbErrorMsg) } return n; } + +int +getErrorString(int err, char *buf, size_t len) +{ + int ret = 0; + if (err == 0 || len < 1) return 0; + ret = strerror_s(buf, len, err); + return ret; +} diff --git a/jdk/src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c b/jdk/src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c index 5971e73c92c..3db3d7b2fc2 100644 --- a/jdk/src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c +++ b/jdk/src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c @@ -2211,8 +2211,11 @@ Java_java_net_TwoStacksPlainDatagramSocketImpl_socketGetOption(JNIEnv *env, jobj optlen = sizeof(optval.i); if (NET_GetSockOpt(fd, level, optname, (void *)&optval, &optlen) < 0) { - char errmsg[255]; - sprintf(errmsg, "error getting socket option: %s\n", strerror(errno)); + char tmpbuf[255]; + int size = 0; + char errmsg[255 + 31]; + getErrorString(errno, tmpbuf, sizeof(tmpbuf)); + sprintf(errmsg, "error getting socket option: %s", tmpbuf); JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", errmsg); return NULL; } From aef9a19da89cbc4c2aa8f08c028aa09671861489 Mon Sep 17 00:00:00 2001 From: Naveen Kumar Date: Thu, 1 Oct 2015 15:16:35 +0900 Subject: [PATCH 22/81] 8081794: ParsePosition getErrorIndex returns 0 for TimeZone parsing problem Reviewed-by: peytoia, okutsu --- .../classes/java/text/SimpleDateFormat.java | 2 +- .../text/Format/DateFormat/Bug8081794.java | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 jdk/test/java/text/Format/DateFormat/Bug8081794.java diff --git a/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java b/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java index 3c0f9a33edc..488e43635b6 100644 --- a/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java +++ b/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java @@ -1722,7 +1722,7 @@ public class SimpleDateFormat extends DateFormat { } return (start + zoneNames[nameIndex].length()); } - return 0; + return -start; } /** diff --git a/jdk/test/java/text/Format/DateFormat/Bug8081794.java b/jdk/test/java/text/Format/DateFormat/Bug8081794.java new file mode 100644 index 00000000000..f134b2004db --- /dev/null +++ b/jdk/test/java/text/Format/DateFormat/Bug8081794.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8081794 + * @summary ParsePosition getErrorIndex should return correct index + */ +import java.text.ParsePosition; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; + +public class Bug8081794 { + + public static void main(String[] args) { + String date = "13 Jan 2005 21:45:34 ABC"; + String format = "dd MMM yyyy HH:mm:ss z"; + ParsePosition pp = new ParsePosition(0); + pp.setIndex(0); + SimpleDateFormat sd = new SimpleDateFormat(format, Locale.ENGLISH); + Date d = sd.parse(date, pp); + int errorIndex = pp.getErrorIndex(); + if (errorIndex == 21) { + System.out.println(": passed"); + } else { + System.out.println(": failed"); + throw new RuntimeException("Failed with wrong index: " + errorIndex); + } + } +} From 143bf054c04fb5660da33421651fca58bd16fd3e Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Thu, 1 Oct 2015 09:45:47 +0200 Subject: [PATCH 23/81] 8138636: bootcycle-images build fails Reviewed-by: alanb --- jdk/make/rmic/RmicCommon.gmk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/make/rmic/RmicCommon.gmk b/jdk/make/rmic/RmicCommon.gmk index 4369fd08bba..8c6affb1015 100644 --- a/jdk/make/rmic/RmicCommon.gmk +++ b/jdk/make/rmic/RmicCommon.gmk @@ -33,7 +33,7 @@ include RMICompilation.gmk BTRMIC_CP := $(call PathList, \ $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_classes $(INTERIM_LANGTOOLS_JAR)) -BTRMIC_ARGS := -Xbootclasspath/p:$(BTRMIC_CP) -cp $(BTRMIC_CP) +BTRMIC_ARGS := -cp $(BTRMIC_CP) RMIC := $(JAVA) $(BTRMIC_ARGS) sun.rmi.rmic.Main CLASSES_DIR := $(JDK_OUTPUTDIR)/modules From 07f5079718e15e19edc7c6a65b7d73311ed9a482 Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Thu, 1 Oct 2015 09:59:16 -0400 Subject: [PATCH 24/81] 8134426: Add serialVersionUID field to relevant javax.transaction classes Reviewed-by: joehw, alanb --- .../javax/transaction/xa/XAException.java | 6 +- .../InvalidTransactionException.java | 5 + .../TransactionRequiredException.java | 5 + .../TransactionRolledbackException.java | 5 + jdk/test/TEST.groups | 1 + .../javax/transaction/testng/TEST.properties | 4 + .../InvalidTransactionExceptionTests.java | 70 ++++++++ .../TransactionRequiredExceptionTests.java | 70 ++++++++ .../TransactionRolledbackExceptionTests.java | 70 ++++++++ .../test/transaction/XAExceptionTests.java | 98 ++++++++++ .../util/SerializedTransactionExceptions.java | 167 ++++++++++++++++++ 11 files changed, 500 insertions(+), 1 deletion(-) create mode 100644 jdk/test/javax/transaction/testng/TEST.properties create mode 100644 jdk/test/javax/transaction/testng/test/transaction/InvalidTransactionExceptionTests.java create mode 100644 jdk/test/javax/transaction/testng/test/transaction/TransactionRequiredExceptionTests.java create mode 100644 jdk/test/javax/transaction/testng/test/transaction/TransactionRolledbackExceptionTests.java create mode 100644 jdk/test/javax/transaction/testng/test/transaction/XAExceptionTests.java create mode 100644 jdk/test/javax/transaction/testng/util/SerializedTransactionExceptions.java diff --git a/jdk/src/java.sql/share/classes/javax/transaction/xa/XAException.java b/jdk/src/java.sql/share/classes/javax/transaction/xa/XAException.java index 62ae7e5e8d9..dc35105f62f 100644 --- a/jdk/src/java.sql/share/classes/javax/transaction/xa/XAException.java +++ b/jdk/src/java.sql/share/classes/javax/transaction/xa/XAException.java @@ -31,7 +31,11 @@ package javax.transaction.xa; * */ public class XAException extends Exception { - //private static final long serialVersionUID = -8249683284832867751L; + + /** + * Specify serialVersionUID for backward compatibility + */ + private static final long serialVersionUID = -8249683284832867751L; /** * The error code with which to create the SystemException. diff --git a/jdk/src/java.transaction/share/classes/javax/transaction/InvalidTransactionException.java b/jdk/src/java.transaction/share/classes/javax/transaction/InvalidTransactionException.java index 761b577fc6c..8c49804d315 100644 --- a/jdk/src/java.transaction/share/classes/javax/transaction/InvalidTransactionException.java +++ b/jdk/src/java.transaction/share/classes/javax/transaction/InvalidTransactionException.java @@ -39,6 +39,11 @@ package javax.transaction; @SuppressWarnings("serial") // serialVersionUID intentionally omitted public class InvalidTransactionException extends java.rmi.RemoteException { + /** + * Specify serialVersionUID for backward compatibility + */ + private static final long serialVersionUID = 3597320220337691496L; + /** * Constructs an {@code InvalidTransactionException}. */ diff --git a/jdk/src/java.transaction/share/classes/javax/transaction/TransactionRequiredException.java b/jdk/src/java.transaction/share/classes/javax/transaction/TransactionRequiredException.java index 7be9b2b6c6b..e92c63c2abe 100644 --- a/jdk/src/java.transaction/share/classes/javax/transaction/TransactionRequiredException.java +++ b/jdk/src/java.transaction/share/classes/javax/transaction/TransactionRequiredException.java @@ -38,6 +38,11 @@ package javax.transaction; @SuppressWarnings("serial") // serialVersionUID intentionally omitted public class TransactionRequiredException extends java.rmi.RemoteException { + /** + * Specify serialVersionUID for backward compatibility + */ + private static final long serialVersionUID = -1898806419937446439L; + /** * Constructs a {@code TransactionRequiredException}. */ diff --git a/jdk/src/java.transaction/share/classes/javax/transaction/TransactionRolledbackException.java b/jdk/src/java.transaction/share/classes/javax/transaction/TransactionRolledbackException.java index 2b4f6ad865d..2546e71e028 100644 --- a/jdk/src/java.transaction/share/classes/javax/transaction/TransactionRolledbackException.java +++ b/jdk/src/java.transaction/share/classes/javax/transaction/TransactionRolledbackException.java @@ -41,6 +41,11 @@ package javax.transaction; @SuppressWarnings("serial") // serialVersionUID intentionally omitted public class TransactionRolledbackException extends java.rmi.RemoteException { + /** + * Specify serialVersionUID for backward compatibility + */ + private static final long serialVersionUID = -3142798139623020577L; + /** * Constructs a {@code TransactionRolledbackException}. */ diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups index 7214f832f69..b2f73a7cd9f 100644 --- a/jdk/test/TEST.groups +++ b/jdk/test/TEST.groups @@ -250,6 +250,7 @@ jdk_other = \ javax/naming \ javax/script \ javax/smartcardio \ + javax/transaction \ javax/xml \ -javax/xml/crypto \ jdk/asm \ diff --git a/jdk/test/javax/transaction/testng/TEST.properties b/jdk/test/javax/transaction/testng/TEST.properties new file mode 100644 index 00000000000..f9e4addcabe --- /dev/null +++ b/jdk/test/javax/transaction/testng/TEST.properties @@ -0,0 +1,4 @@ +# JDBC unit tests uses TestNG +TestNG.dirs= . +othervm.dirs= . + diff --git a/jdk/test/javax/transaction/testng/test/transaction/InvalidTransactionExceptionTests.java b/jdk/test/javax/transaction/testng/test/transaction/InvalidTransactionExceptionTests.java new file mode 100644 index 00000000000..8df4103180e --- /dev/null +++ b/jdk/test/javax/transaction/testng/test/transaction/InvalidTransactionExceptionTests.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package test.transaction; + +import java.io.ByteArrayInputStream; +import java.io.ObjectInputStream; +import javax.transaction.InvalidTransactionException; +import static org.testng.Assert.*; +import org.testng.annotations.Test; +import util.SerializedTransactionExceptions; + +public class InvalidTransactionExceptionTests { + + protected final String reason = "reason"; + + /** + * Create InvalidTransactionException with no-arg constructor + */ + @Test + public void test1() { + InvalidTransactionException ex = new InvalidTransactionException(); + assertTrue(ex.getMessage() == null + && ex.getCause() == null); + } + + /** + * Create InvalidTransactionException with message + */ + @Test + public void test2() { + InvalidTransactionException ex = new InvalidTransactionException(reason); + assertTrue(ex.getMessage().equals(reason) + && ex.getCause() == null); + } + + /** + * De-Serialize a InvalidTransactionException from JDBC 4.0 and make sure + * you can read it back properly + */ + @Test + public void test3() throws Exception { + + ObjectInputStream ois = new ObjectInputStream( + new ByteArrayInputStream(SerializedTransactionExceptions.ITE_DATA)); + InvalidTransactionException ex = (InvalidTransactionException) ois.readObject(); + assertTrue(reason.equals(ex.getMessage()) + && ex.getCause() == null); + } + +} diff --git a/jdk/test/javax/transaction/testng/test/transaction/TransactionRequiredExceptionTests.java b/jdk/test/javax/transaction/testng/test/transaction/TransactionRequiredExceptionTests.java new file mode 100644 index 00000000000..0be26cee8aa --- /dev/null +++ b/jdk/test/javax/transaction/testng/test/transaction/TransactionRequiredExceptionTests.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package test.transaction; + +import java.io.ByteArrayInputStream; +import java.io.ObjectInputStream; +import javax.transaction.TransactionRequiredException; +import static org.testng.Assert.*; +import org.testng.annotations.Test; +import util.SerializedTransactionExceptions; + +public class TransactionRequiredExceptionTests { + + protected final String reason = "reason"; + + /** + * Create TransactionRequiredException with no-arg constructor + */ + @Test + public void test1() { + TransactionRequiredException ex = new TransactionRequiredException(); + assertTrue(ex.getMessage() == null + && ex.getCause() == null); + } + + /** + * Create TransactionRequiredException with message + */ + @Test + public void test2() { + TransactionRequiredException ex = new TransactionRequiredException(reason); + assertTrue(ex.getMessage().equals(reason) + && ex.getCause() == null); + } + + /** + * De-Serialize a TransactionRequiredException from JDBC 4.0 and make sure + * you can read it back properly + */ + @Test + public void test3() throws Exception { + + ObjectInputStream ois = new ObjectInputStream( + new ByteArrayInputStream(SerializedTransactionExceptions.TRE_DATA)); + TransactionRequiredException ex = (TransactionRequiredException) ois.readObject(); + assertTrue(reason.equals(ex.getMessage()) + && ex.getCause() == null); + } + +} diff --git a/jdk/test/javax/transaction/testng/test/transaction/TransactionRolledbackExceptionTests.java b/jdk/test/javax/transaction/testng/test/transaction/TransactionRolledbackExceptionTests.java new file mode 100644 index 00000000000..399a902c392 --- /dev/null +++ b/jdk/test/javax/transaction/testng/test/transaction/TransactionRolledbackExceptionTests.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package test.transaction; + +import java.io.ByteArrayInputStream; +import java.io.ObjectInputStream; +import javax.transaction.TransactionRolledbackException; +import static org.testng.Assert.*; +import org.testng.annotations.Test; +import util.SerializedTransactionExceptions; + +public class TransactionRolledbackExceptionTests { + + protected final String reason = "reason"; + + /** + * Create TransactionRolledbackException with no-arg constructor + */ + @Test + public void test1() { + TransactionRolledbackException ex = new TransactionRolledbackException(); + assertTrue(ex.getMessage() == null + && ex.getCause() == null); + } + + /** + * Create TransactionRolledbackException with message + */ + @Test + public void test2() { + TransactionRolledbackException ex = new TransactionRolledbackException(reason); + assertTrue(ex.getMessage().equals(reason) + && ex.getCause() == null); + } + + /** + * De-Serialize a TransactionRolledbackException from JDBC 4.0 and make sure + * you can read it back properly + */ + @Test + public void test3() throws Exception { + + ObjectInputStream ois = new ObjectInputStream( + new ByteArrayInputStream(SerializedTransactionExceptions.TRBE_DATA)); + TransactionRolledbackException ex = (TransactionRolledbackException) ois.readObject(); + assertTrue(reason.equals(ex.getMessage()) + && ex.getCause() == null); + } + +} diff --git a/jdk/test/javax/transaction/testng/test/transaction/XAExceptionTests.java b/jdk/test/javax/transaction/testng/test/transaction/XAExceptionTests.java new file mode 100644 index 00000000000..7c321fc78bb --- /dev/null +++ b/jdk/test/javax/transaction/testng/test/transaction/XAExceptionTests.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package test.transaction; + +import java.io.ByteArrayInputStream; +import java.io.ObjectInputStream; +import javax.transaction.xa.XAException; +import static org.testng.Assert.*; +import org.testng.annotations.Test; +import util.SerializedTransactionExceptions; + +public class XAExceptionTests { + + protected final String reason = "reason"; + + /** + * Create XAException with no-arg constructor + */ + @Test + public void test1() { + XAException ex = new XAException(); + assertTrue(ex.getMessage() == null + && ex.getCause() == null + && ex.errorCode == 0); + } + + /** + * Create XAException with message + */ + @Test + public void test2() { + XAException ex = new XAException(reason); + assertTrue(ex.getMessage().equals(reason) + && ex.getCause() == null + && ex.errorCode == 0); + } + + /** + * De-Serialize a XAException from JDBC 4.0 and make sure you can read it + * back properly + */ + @Test + public void test3() throws Exception { + + ObjectInputStream ois = new ObjectInputStream( + new ByteArrayInputStream(SerializedTransactionExceptions.XAE_DATA)); + XAException ex = (XAException) ois.readObject(); + assertTrue(reason.equals(ex.getMessage()) + && ex.getCause() == null + && ex.errorCode == 0); + } + + /** + * Create TransactionRolledbackException specifying an error code + */ + @Test + public void test4() { + int error = 21; + XAException ex = new XAException(error); + assertTrue(ex.getMessage() == null + && ex.getCause() == null + && ex.errorCode == error); + } + + /** + * Create TransactionRolledbackException specifying an error code + */ + @Test + public void test5() { + int error = 21; + XAException ex = new XAException(error); + ex.errorCode = error; + assertTrue(ex.getMessage() == null + && ex.getCause() == null + && ex.errorCode == error); + } + +} diff --git a/jdk/test/javax/transaction/testng/util/SerializedTransactionExceptions.java b/jdk/test/javax/transaction/testng/util/SerializedTransactionExceptions.java new file mode 100644 index 00000000000..61b51227578 --- /dev/null +++ b/jdk/test/javax/transaction/testng/util/SerializedTransactionExceptions.java @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package util; + +public class SerializedTransactionExceptions { + + /** + * Serialized XAException from JDK 8 with the following values: + * reason = "This was the error msg" + * cause = null + */ + public static byte[] XAE_DATA = { + (byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x20, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x78, (byte) 0x2e, (byte) 0x74, (byte) 0x72, (byte) 0x61, (byte) 0x6e, (byte) 0x73, (byte) 0x61, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x2e, (byte) 0x78, (byte) 0x61, (byte) 0x2e, (byte) 0x58, (byte) 0x41, (byte) 0x45, + (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x8d, (byte) 0x83, (byte) 0x3c, (byte) 0xc2, (byte) 0xda, (byte) 0xf, (byte) 0x2a, (byte) 0x59, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x49, (byte) 0x0, (byte) 0x9, (byte) 0x65, (byte) 0x72, (byte) 0x72, (byte) 0x6f, (byte) 0x72, (byte) 0x43, (byte) 0x6f, (byte) 0x64, (byte) 0x65, (byte) 0x78, + (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0xd0, (byte) 0xfd, (byte) 0x1f, (byte) 0x3e, (byte) 0x1a, (byte) 0x3b, (byte) 0x1c, (byte) 0xc4, (byte) 0x2, (byte) 0x0, + (byte) 0x0, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x54, (byte) 0x68, (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0xd5, (byte) 0xc6, (byte) 0x35, (byte) 0x27, (byte) 0x39, (byte) 0x77, (byte) 0xb8, (byte) 0xcb, + (byte) 0x3, (byte) 0x0, (byte) 0x4, (byte) 0x4c, (byte) 0x0, (byte) 0x5, (byte) 0x63, (byte) 0x61, (byte) 0x75, (byte) 0x73, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x15, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x54, (byte) 0x68, (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x61, (byte) 0x62, + (byte) 0x6c, (byte) 0x65, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0xd, (byte) 0x64, (byte) 0x65, (byte) 0x74, (byte) 0x61, (byte) 0x69, (byte) 0x6c, (byte) 0x4d, (byte) 0x65, (byte) 0x73, (byte) 0x73, (byte) 0x61, (byte) 0x67, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x12, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, + (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x3b, (byte) 0x5b, (byte) 0x0, (byte) 0xa, (byte) 0x73, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x1e, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, + (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0x14, (byte) 0x73, (byte) 0x75, (byte) 0x70, (byte) 0x70, (byte) 0x72, (byte) 0x65, (byte) 0x73, + (byte) 0x73, (byte) 0x65, (byte) 0x64, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x74, (byte) 0x0, (byte) 0x10, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2f, (byte) 0x4c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0x3b, + (byte) 0x78, (byte) 0x70, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x7, (byte) 0x74, (byte) 0x0, (byte) 0x6, (byte) 0x72, (byte) 0x65, (byte) 0x61, (byte) 0x73, (byte) 0x6f, (byte) 0x6e, (byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x1e, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, + (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x3b, (byte) 0x2, (byte) 0x46, (byte) 0x2a, (byte) 0x3c, (byte) 0x3c, (byte) 0xfd, (byte) 0x22, (byte) 0x39, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x1b, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, + (byte) 0x6e, (byte) 0x74, (byte) 0x61, (byte) 0x9, (byte) 0xc5, (byte) 0x9a, (byte) 0x26, (byte) 0x36, (byte) 0xdd, (byte) 0x85, (byte) 0x2, (byte) 0x0, (byte) 0x4, (byte) 0x49, (byte) 0x0, (byte) 0xa, (byte) 0x6c, (byte) 0x69, (byte) 0x6e, (byte) 0x65, (byte) 0x4e, (byte) 0x75, (byte) 0x6d, (byte) 0x62, (byte) 0x65, (byte) 0x72, (byte) 0x4c, (byte) 0x0, (byte) 0xe, (byte) 0x64, (byte) 0x65, (byte) 0x63, + (byte) 0x6c, (byte) 0x61, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x43, (byte) 0x6c, (byte) 0x61, (byte) 0x73, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, (byte) 0x4c, (byte) 0x0, (byte) 0x8, (byte) 0x66, (byte) 0x69, (byte) 0x6c, (byte) 0x65, (byte) 0x4e, (byte) 0x61, (byte) 0x6d, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, + (byte) 0x4c, (byte) 0x0, (byte) 0xa, (byte) 0x6d, (byte) 0x65, (byte) 0x74, (byte) 0x68, (byte) 0x6f, (byte) 0x64, (byte) 0x4e, (byte) 0x61, (byte) 0x6d, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x39, (byte) 0x74, (byte) 0x0, (byte) 0x10, (byte) 0x57, (byte) 0x72, (byte) 0x69, (byte) 0x74, (byte) 0x65, + (byte) 0x53, (byte) 0x65, (byte) 0x72, (byte) 0x69, (byte) 0x61, (byte) 0x6c, (byte) 0x44, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x31, (byte) 0x74, (byte) 0x0, (byte) 0x15, (byte) 0x57, (byte) 0x72, (byte) 0x69, (byte) 0x74, (byte) 0x65, (byte) 0x53, (byte) 0x65, (byte) 0x72, (byte) 0x69, (byte) 0x61, (byte) 0x6c, (byte) 0x44, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x31, (byte) 0x2e, (byte) 0x6a, + (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x74, (byte) 0x0, (byte) 0x3, (byte) 0x72, (byte) 0x75, (byte) 0x6e, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0xb, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x24, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0xd, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0xe, (byte) 0x74, (byte) 0x0, (byte) 0x4, + (byte) 0x6d, (byte) 0x61, (byte) 0x69, (byte) 0x6e, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x26, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2e, (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x24, (byte) 0x55, (byte) 0x6e, + (byte) 0x6d, (byte) 0x6f, (byte) 0x64, (byte) 0x69, (byte) 0x66, (byte) 0x69, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0x4c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0xfc, (byte) 0xf, (byte) 0x25, (byte) 0x31, (byte) 0xb5, (byte) 0xec, (byte) 0x8e, (byte) 0x10, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x4c, (byte) 0x0, (byte) 0x4, (byte) 0x6c, (byte) 0x69, (byte) 0x73, (byte) 0x74, + (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x6, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x2c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2e, (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x24, (byte) 0x55, + (byte) 0x6e, (byte) 0x6d, (byte) 0x6f, (byte) 0x64, (byte) 0x69, (byte) 0x66, (byte) 0x69, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x19, (byte) 0x42, (byte) 0x0, (byte) 0x80, (byte) 0xcb, (byte) 0x5e, (byte) 0xf7, (byte) 0x1e, (byte) 0x2, (byte) 0x0, (byte) 0x1, + (byte) 0x4c, (byte) 0x0, (byte) 0x1, (byte) 0x63, (byte) 0x74, (byte) 0x0, (byte) 0x16, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2f, (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x3b, (byte) 0x78, (byte) 0x70, (byte) 0x73, + (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2e, (byte) 0x41, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x4c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0x78, (byte) 0x81, (byte) 0xd2, (byte) 0x1d, (byte) 0x99, (byte) 0xc7, (byte) 0x61, (byte) 0x9d, (byte) 0x3, (byte) 0x0, + (byte) 0x1, (byte) 0x49, (byte) 0x0, (byte) 0x4, (byte) 0x73, (byte) 0x69, (byte) 0x7a, (byte) 0x65, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x77, (byte) 0x4, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x17, (byte) 0x78, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0 + }; + + /** + * Serialized InvalidTransactionException from JDK 8 with the following + * values: + * reason = "This was the error msg" + * cause = null + */ + public static byte[] ITE_DATA = { + (byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x2d, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x78, (byte) 0x2e, (byte) 0x74, (byte) 0x72, (byte) 0x61, (byte) 0x6e, (byte) 0x73, (byte) 0x61, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x2e, (byte) 0x49, (byte) 0x6e, (byte) 0x76, (byte) 0x61, (byte) 0x6c, (byte) 0x69, + (byte) 0x64, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x6e, (byte) 0x73, (byte) 0x61, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x31, (byte) 0xec, (byte) 0x3f, (byte) 0xae, (byte) 0x54, (byte) 0x8e, (byte) 0xdb, (byte) 0x68, (byte) 0x2, (byte) 0x0, (byte) 0x0, + (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x18, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x72, (byte) 0x6d, (byte) 0x69, (byte) 0x2e, (byte) 0x52, (byte) 0x65, (byte) 0x6d, (byte) 0x6f, (byte) 0x74, (byte) 0x65, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0xb8, (byte) 0x8c, (byte) 0x9d, (byte) 0x4e, + (byte) 0xde, (byte) 0xe4, (byte) 0x7a, (byte) 0x22, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x4c, (byte) 0x0, (byte) 0x6, (byte) 0x64, (byte) 0x65, (byte) 0x74, (byte) 0x61, (byte) 0x69, (byte) 0x6c, (byte) 0x74, (byte) 0x0, (byte) 0x15, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x54, (byte) 0x68, + (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0x3b, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x69, (byte) 0x6f, (byte) 0x2e, (byte) 0x49, (byte) 0x4f, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x6c, + (byte) 0x80, (byte) 0x73, (byte) 0x64, (byte) 0x65, (byte) 0x25, (byte) 0xf0, (byte) 0xab, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, + (byte) 0x6e, (byte) 0xd0, (byte) 0xfd, (byte) 0x1f, (byte) 0x3e, (byte) 0x1a, (byte) 0x3b, (byte) 0x1c, (byte) 0xc4, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x54, (byte) 0x68, (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x61, + (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0xd5, (byte) 0xc6, (byte) 0x35, (byte) 0x27, (byte) 0x39, (byte) 0x77, (byte) 0xb8, (byte) 0xcb, (byte) 0x3, (byte) 0x0, (byte) 0x4, (byte) 0x4c, (byte) 0x0, (byte) 0x5, (byte) 0x63, (byte) 0x61, (byte) 0x75, (byte) 0x73, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x2, (byte) 0x4c, (byte) 0x0, (byte) 0xd, (byte) 0x64, (byte) 0x65, + (byte) 0x74, (byte) 0x61, (byte) 0x69, (byte) 0x6c, (byte) 0x4d, (byte) 0x65, (byte) 0x73, (byte) 0x73, (byte) 0x61, (byte) 0x67, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x12, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x3b, + (byte) 0x5b, (byte) 0x0, (byte) 0xa, (byte) 0x73, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x1e, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, + (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0x14, (byte) 0x73, (byte) 0x75, (byte) 0x70, (byte) 0x70, (byte) 0x72, (byte) 0x65, (byte) 0x73, (byte) 0x73, (byte) 0x65, (byte) 0x64, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, + (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x74, (byte) 0x0, (byte) 0x10, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2f, (byte) 0x4c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0x3b, (byte) 0x78, (byte) 0x70, (byte) 0x70, (byte) 0x74, (byte) 0x0, (byte) 0x6, (byte) 0x72, (byte) 0x65, + (byte) 0x61, (byte) 0x73, (byte) 0x6f, (byte) 0x6e, (byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x1e, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, + (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x3b, (byte) 0x2, (byte) 0x46, (byte) 0x2a, (byte) 0x3c, (byte) 0x3c, (byte) 0xfd, (byte) 0x22, (byte) 0x39, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x1b, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, + (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x61, (byte) 0x9, (byte) 0xc5, (byte) 0x9a, (byte) 0x26, (byte) 0x36, (byte) 0xdd, (byte) 0x85, (byte) 0x2, (byte) 0x0, + (byte) 0x4, (byte) 0x49, (byte) 0x0, (byte) 0xa, (byte) 0x6c, (byte) 0x69, (byte) 0x6e, (byte) 0x65, (byte) 0x4e, (byte) 0x75, (byte) 0x6d, (byte) 0x62, (byte) 0x65, (byte) 0x72, (byte) 0x4c, (byte) 0x0, (byte) 0xe, (byte) 0x64, (byte) 0x65, (byte) 0x63, (byte) 0x6c, (byte) 0x61, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x43, (byte) 0x6c, (byte) 0x61, (byte) 0x73, (byte) 0x73, (byte) 0x71, + (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x6, (byte) 0x4c, (byte) 0x0, (byte) 0x8, (byte) 0x66, (byte) 0x69, (byte) 0x6c, (byte) 0x65, (byte) 0x4e, (byte) 0x61, (byte) 0x6d, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x6, (byte) 0x4c, (byte) 0x0, (byte) 0xa, (byte) 0x6d, (byte) 0x65, (byte) 0x74, (byte) 0x68, (byte) 0x6f, (byte) 0x64, (byte) 0x4e, (byte) 0x61, (byte) 0x6d, + (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x6, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x3a, (byte) 0x74, (byte) 0x0, (byte) 0x10, (byte) 0x57, (byte) 0x72, (byte) 0x69, (byte) 0x74, (byte) 0x65, (byte) 0x53, (byte) 0x65, (byte) 0x72, (byte) 0x69, (byte) 0x61, (byte) 0x6c, (byte) 0x44, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x31, (byte) 0x74, + (byte) 0x0, (byte) 0x15, (byte) 0x57, (byte) 0x72, (byte) 0x69, (byte) 0x74, (byte) 0x65, (byte) 0x53, (byte) 0x65, (byte) 0x72, (byte) 0x69, (byte) 0x61, (byte) 0x6c, (byte) 0x44, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x31, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x74, (byte) 0x0, (byte) 0x3, (byte) 0x72, (byte) 0x75, (byte) 0x6e, (byte) 0x73, (byte) 0x71, (byte) 0x0, + (byte) 0x7e, (byte) 0x0, (byte) 0xd, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x24, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0xf, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x10, (byte) 0x74, (byte) 0x0, (byte) 0x4, (byte) 0x6d, (byte) 0x61, (byte) 0x69, (byte) 0x6e, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x26, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, + (byte) 0x2e, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2e, (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x24, (byte) 0x55, (byte) 0x6e, (byte) 0x6d, (byte) 0x6f, (byte) 0x64, (byte) 0x69, (byte) 0x66, (byte) 0x69, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0x4c, (byte) 0x69, + (byte) 0x73, (byte) 0x74, (byte) 0xfc, (byte) 0xf, (byte) 0x25, (byte) 0x31, (byte) 0xb5, (byte) 0xec, (byte) 0x8e, (byte) 0x10, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x4c, (byte) 0x0, (byte) 0x4, (byte) 0x6c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x8, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x2c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, + (byte) 0x61, (byte) 0x2e, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2e, (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x24, (byte) 0x55, (byte) 0x6e, (byte) 0x6d, (byte) 0x6f, (byte) 0x64, (byte) 0x69, (byte) 0x66, (byte) 0x69, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0x43, + (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x19, (byte) 0x42, (byte) 0x0, (byte) 0x80, (byte) 0xcb, (byte) 0x5e, (byte) 0xf7, (byte) 0x1e, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x4c, (byte) 0x0, (byte) 0x1, (byte) 0x63, (byte) 0x74, (byte) 0x0, (byte) 0x16, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, + (byte) 0x2f, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2f, (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x3b, (byte) 0x78, (byte) 0x70, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, + (byte) 0x2e, (byte) 0x41, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x4c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0x78, (byte) 0x81, (byte) 0xd2, (byte) 0x1d, (byte) 0x99, (byte) 0xc7, (byte) 0x61, (byte) 0x9d, (byte) 0x3, (byte) 0x0, (byte) 0x1, (byte) 0x49, (byte) 0x0, (byte) 0x4, (byte) 0x73, (byte) 0x69, (byte) 0x7a, (byte) 0x65, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x77, (byte) 0x4, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x19, (byte) 0x78, (byte) 0x70 + }; + + /** + * Serialized TransactionRequiredException from JDK 8 with the following + * values: + * reason = "This was the error msg" + * cause = null + */ + public static byte[] TRE_DATA = { + (byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x78, (byte) 0x2e, (byte) 0x74, (byte) 0x72, (byte) 0x61, (byte) 0x6e, (byte) 0x73, (byte) 0x61, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x2e, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x6e, (byte) 0x73, (byte) 0x61, + (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x52, (byte) 0x65, (byte) 0x71, (byte) 0x75, (byte) 0x69, (byte) 0x72, (byte) 0x65, (byte) 0x64, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0xe5, (byte) 0xa6, (byte) 0x15, (byte) 0x9f, (byte) 0x12, (byte) 0x65, (byte) 0xb5, (byte) 0xd9, (byte) 0x2, (byte) 0x0, + (byte) 0x0, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x18, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x72, (byte) 0x6d, (byte) 0x69, (byte) 0x2e, (byte) 0x52, (byte) 0x65, (byte) 0x6d, (byte) 0x6f, (byte) 0x74, (byte) 0x65, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0xb8, (byte) 0x8c, (byte) 0x9d, + (byte) 0x4e, (byte) 0xde, (byte) 0xe4, (byte) 0x7a, (byte) 0x22, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x4c, (byte) 0x0, (byte) 0x6, (byte) 0x64, (byte) 0x65, (byte) 0x74, (byte) 0x61, (byte) 0x69, (byte) 0x6c, (byte) 0x74, (byte) 0x0, (byte) 0x15, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x54, + (byte) 0x68, (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0x3b, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x69, (byte) 0x6f, (byte) 0x2e, (byte) 0x49, (byte) 0x4f, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, + (byte) 0x6c, (byte) 0x80, (byte) 0x73, (byte) 0x64, (byte) 0x65, (byte) 0x25, (byte) 0xf0, (byte) 0xab, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, + (byte) 0x6f, (byte) 0x6e, (byte) 0xd0, (byte) 0xfd, (byte) 0x1f, (byte) 0x3e, (byte) 0x1a, (byte) 0x3b, (byte) 0x1c, (byte) 0xc4, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x54, (byte) 0x68, (byte) 0x72, (byte) 0x6f, (byte) 0x77, + (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0xd5, (byte) 0xc6, (byte) 0x35, (byte) 0x27, (byte) 0x39, (byte) 0x77, (byte) 0xb8, (byte) 0xcb, (byte) 0x3, (byte) 0x0, (byte) 0x4, (byte) 0x4c, (byte) 0x0, (byte) 0x5, (byte) 0x63, (byte) 0x61, (byte) 0x75, (byte) 0x73, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x2, (byte) 0x4c, (byte) 0x0, (byte) 0xd, (byte) 0x64, + (byte) 0x65, (byte) 0x74, (byte) 0x61, (byte) 0x69, (byte) 0x6c, (byte) 0x4d, (byte) 0x65, (byte) 0x73, (byte) 0x73, (byte) 0x61, (byte) 0x67, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x12, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, + (byte) 0x3b, (byte) 0x5b, (byte) 0x0, (byte) 0xa, (byte) 0x73, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x1e, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x61, + (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0x14, (byte) 0x73, (byte) 0x75, (byte) 0x70, (byte) 0x70, (byte) 0x72, (byte) 0x65, (byte) 0x73, (byte) 0x73, (byte) 0x65, (byte) 0x64, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, + (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x74, (byte) 0x0, (byte) 0x10, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2f, (byte) 0x4c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0x3b, (byte) 0x78, (byte) 0x70, (byte) 0x70, (byte) 0x74, (byte) 0x0, (byte) 0x6, (byte) 0x72, + (byte) 0x65, (byte) 0x61, (byte) 0x73, (byte) 0x6f, (byte) 0x6e, (byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x1e, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, + (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x3b, (byte) 0x2, (byte) 0x46, (byte) 0x2a, (byte) 0x3c, (byte) 0x3c, (byte) 0xfd, (byte) 0x22, (byte) 0x39, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x1b, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, + (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x61, (byte) 0x9, (byte) 0xc5, (byte) 0x9a, (byte) 0x26, (byte) 0x36, (byte) 0xdd, (byte) 0x85, (byte) 0x2, + (byte) 0x0, (byte) 0x4, (byte) 0x49, (byte) 0x0, (byte) 0xa, (byte) 0x6c, (byte) 0x69, (byte) 0x6e, (byte) 0x65, (byte) 0x4e, (byte) 0x75, (byte) 0x6d, (byte) 0x62, (byte) 0x65, (byte) 0x72, (byte) 0x4c, (byte) 0x0, (byte) 0xe, (byte) 0x64, (byte) 0x65, (byte) 0x63, (byte) 0x6c, (byte) 0x61, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x43, (byte) 0x6c, (byte) 0x61, (byte) 0x73, (byte) 0x73, + (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x6, (byte) 0x4c, (byte) 0x0, (byte) 0x8, (byte) 0x66, (byte) 0x69, (byte) 0x6c, (byte) 0x65, (byte) 0x4e, (byte) 0x61, (byte) 0x6d, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x6, (byte) 0x4c, (byte) 0x0, (byte) 0xa, (byte) 0x6d, (byte) 0x65, (byte) 0x74, (byte) 0x68, (byte) 0x6f, (byte) 0x64, (byte) 0x4e, (byte) 0x61, + (byte) 0x6d, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x6, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x3c, (byte) 0x74, (byte) 0x0, (byte) 0x10, (byte) 0x57, (byte) 0x72, (byte) 0x69, (byte) 0x74, (byte) 0x65, (byte) 0x53, (byte) 0x65, (byte) 0x72, (byte) 0x69, (byte) 0x61, (byte) 0x6c, (byte) 0x44, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x31, + (byte) 0x74, (byte) 0x0, (byte) 0x15, (byte) 0x57, (byte) 0x72, (byte) 0x69, (byte) 0x74, (byte) 0x65, (byte) 0x53, (byte) 0x65, (byte) 0x72, (byte) 0x69, (byte) 0x61, (byte) 0x6c, (byte) 0x44, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x31, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x74, (byte) 0x0, (byte) 0x3, (byte) 0x72, (byte) 0x75, (byte) 0x6e, (byte) 0x73, (byte) 0x71, + (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0xd, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x24, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0xf, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x10, (byte) 0x74, (byte) 0x0, (byte) 0x4, (byte) 0x6d, (byte) 0x61, (byte) 0x69, (byte) 0x6e, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x26, (byte) 0x6a, (byte) 0x61, (byte) 0x76, + (byte) 0x61, (byte) 0x2e, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2e, (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x24, (byte) 0x55, (byte) 0x6e, (byte) 0x6d, (byte) 0x6f, (byte) 0x64, (byte) 0x69, (byte) 0x66, (byte) 0x69, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0x4c, + (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0xfc, (byte) 0xf, (byte) 0x25, (byte) 0x31, (byte) 0xb5, (byte) 0xec, (byte) 0x8e, (byte) 0x10, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x4c, (byte) 0x0, (byte) 0x4, (byte) 0x6c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x8, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x2c, (byte) 0x6a, (byte) 0x61, + (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2e, (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x24, (byte) 0x55, (byte) 0x6e, (byte) 0x6d, (byte) 0x6f, (byte) 0x64, (byte) 0x69, (byte) 0x66, (byte) 0x69, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, + (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x19, (byte) 0x42, (byte) 0x0, (byte) 0x80, (byte) 0xcb, (byte) 0x5e, (byte) 0xf7, (byte) 0x1e, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x4c, (byte) 0x0, (byte) 0x1, (byte) 0x63, (byte) 0x74, (byte) 0x0, (byte) 0x16, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, + (byte) 0x61, (byte) 0x2f, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2f, (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x3b, (byte) 0x78, (byte) 0x70, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x75, (byte) 0x74, (byte) 0x69, + (byte) 0x6c, (byte) 0x2e, (byte) 0x41, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x4c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0x78, (byte) 0x81, (byte) 0xd2, (byte) 0x1d, (byte) 0x99, (byte) 0xc7, (byte) 0x61, (byte) 0x9d, (byte) 0x3, (byte) 0x0, (byte) 0x1, (byte) 0x49, (byte) 0x0, (byte) 0x4, (byte) 0x73, (byte) 0x69, (byte) 0x7a, (byte) 0x65, (byte) 0x78, (byte) 0x70, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x77, (byte) 0x4, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x19, (byte) 0x78, (byte) 0x70 + }; + + /** + * Serialized TransactionRolledbackException from JDK 8 with the + * following values: + * reason = "This was the error msg" + * cause = null + */ + public static byte[] TRBE_DATA = { + (byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x30, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x78, (byte) 0x2e, (byte) 0x74, (byte) 0x72, (byte) 0x61, (byte) 0x6e, (byte) 0x73, (byte) 0x61, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x2e, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x6e, (byte) 0x73, (byte) 0x61, + (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x52, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x64, (byte) 0x62, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0xd4, (byte) 0x62, (byte) 0x89, (byte) 0xbe, (byte) 0x47, (byte) 0x2, (byte) 0xe7, (byte) 0xdf, + (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x18, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x72, (byte) 0x6d, (byte) 0x69, (byte) 0x2e, (byte) 0x52, (byte) 0x65, (byte) 0x6d, (byte) 0x6f, (byte) 0x74, (byte) 0x65, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0xb8, + (byte) 0x8c, (byte) 0x9d, (byte) 0x4e, (byte) 0xde, (byte) 0xe4, (byte) 0x7a, (byte) 0x22, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x4c, (byte) 0x0, (byte) 0x6, (byte) 0x64, (byte) 0x65, (byte) 0x74, (byte) 0x61, (byte) 0x69, (byte) 0x6c, (byte) 0x74, (byte) 0x0, (byte) 0x15, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, + (byte) 0x2f, (byte) 0x54, (byte) 0x68, (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0x3b, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x69, (byte) 0x6f, (byte) 0x2e, (byte) 0x49, (byte) 0x4f, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, + (byte) 0x6f, (byte) 0x6e, (byte) 0x6c, (byte) 0x80, (byte) 0x73, (byte) 0x64, (byte) 0x65, (byte) 0x25, (byte) 0xf0, (byte) 0xab, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, + (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0xd0, (byte) 0xfd, (byte) 0x1f, (byte) 0x3e, (byte) 0x1a, (byte) 0x3b, (byte) 0x1c, (byte) 0xc4, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x54, (byte) 0x68, (byte) 0x72, + (byte) 0x6f, (byte) 0x77, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0xd5, (byte) 0xc6, (byte) 0x35, (byte) 0x27, (byte) 0x39, (byte) 0x77, (byte) 0xb8, (byte) 0xcb, (byte) 0x3, (byte) 0x0, (byte) 0x4, (byte) 0x4c, (byte) 0x0, (byte) 0x5, (byte) 0x63, (byte) 0x61, (byte) 0x75, (byte) 0x73, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x2, (byte) 0x4c, (byte) 0x0, + (byte) 0xd, (byte) 0x64, (byte) 0x65, (byte) 0x74, (byte) 0x61, (byte) 0x69, (byte) 0x6c, (byte) 0x4d, (byte) 0x65, (byte) 0x73, (byte) 0x73, (byte) 0x61, (byte) 0x67, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x12, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x72, (byte) 0x69, + (byte) 0x6e, (byte) 0x67, (byte) 0x3b, (byte) 0x5b, (byte) 0x0, (byte) 0xa, (byte) 0x73, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x1e, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, + (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0x14, (byte) 0x73, (byte) 0x75, (byte) 0x70, (byte) 0x70, (byte) 0x72, (byte) 0x65, (byte) 0x73, (byte) 0x73, (byte) 0x65, (byte) 0x64, (byte) 0x45, (byte) 0x78, + (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x74, (byte) 0x0, (byte) 0x10, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2f, (byte) 0x4c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0x3b, (byte) 0x78, (byte) 0x70, (byte) 0x70, (byte) 0x74, (byte) 0x0, + (byte) 0x6, (byte) 0x72, (byte) 0x65, (byte) 0x61, (byte) 0x73, (byte) 0x6f, (byte) 0x6e, (byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x1e, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, + (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x3b, (byte) 0x2, (byte) 0x46, (byte) 0x2a, (byte) 0x3c, (byte) 0x3c, (byte) 0xfd, (byte) 0x22, (byte) 0x39, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x1b, (byte) 0x6a, (byte) 0x61, + (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x61, (byte) 0x9, (byte) 0xc5, (byte) 0x9a, (byte) 0x26, (byte) 0x36, (byte) 0xdd, + (byte) 0x85, (byte) 0x2, (byte) 0x0, (byte) 0x4, (byte) 0x49, (byte) 0x0, (byte) 0xa, (byte) 0x6c, (byte) 0x69, (byte) 0x6e, (byte) 0x65, (byte) 0x4e, (byte) 0x75, (byte) 0x6d, (byte) 0x62, (byte) 0x65, (byte) 0x72, (byte) 0x4c, (byte) 0x0, (byte) 0xe, (byte) 0x64, (byte) 0x65, (byte) 0x63, (byte) 0x6c, (byte) 0x61, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x43, (byte) 0x6c, (byte) 0x61, + (byte) 0x73, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x6, (byte) 0x4c, (byte) 0x0, (byte) 0x8, (byte) 0x66, (byte) 0x69, (byte) 0x6c, (byte) 0x65, (byte) 0x4e, (byte) 0x61, (byte) 0x6d, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x6, (byte) 0x4c, (byte) 0x0, (byte) 0xa, (byte) 0x6d, (byte) 0x65, (byte) 0x74, (byte) 0x68, (byte) 0x6f, (byte) 0x64, + (byte) 0x4e, (byte) 0x61, (byte) 0x6d, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x6, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x3e, (byte) 0x74, (byte) 0x0, (byte) 0x10, (byte) 0x57, (byte) 0x72, (byte) 0x69, (byte) 0x74, (byte) 0x65, (byte) 0x53, (byte) 0x65, (byte) 0x72, (byte) 0x69, (byte) 0x61, (byte) 0x6c, (byte) 0x44, (byte) 0x61, (byte) 0x74, + (byte) 0x61, (byte) 0x31, (byte) 0x74, (byte) 0x0, (byte) 0x15, (byte) 0x57, (byte) 0x72, (byte) 0x69, (byte) 0x74, (byte) 0x65, (byte) 0x53, (byte) 0x65, (byte) 0x72, (byte) 0x69, (byte) 0x61, (byte) 0x6c, (byte) 0x44, (byte) 0x61, (byte) 0x74, (byte) 0x61, (byte) 0x31, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x74, (byte) 0x0, (byte) 0x3, (byte) 0x72, (byte) 0x75, (byte) 0x6e, + (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0xd, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x24, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0xf, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x10, (byte) 0x74, (byte) 0x0, (byte) 0x4, (byte) 0x6d, (byte) 0x61, (byte) 0x69, (byte) 0x6e, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x26, (byte) 0x6a, + (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2e, (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x24, (byte) 0x55, (byte) 0x6e, (byte) 0x6d, (byte) 0x6f, (byte) 0x64, (byte) 0x69, (byte) 0x66, (byte) 0x69, (byte) 0x61, (byte) 0x62, (byte) 0x6c, + (byte) 0x65, (byte) 0x4c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0xfc, (byte) 0xf, (byte) 0x25, (byte) 0x31, (byte) 0xb5, (byte) 0xec, (byte) 0x8e, (byte) 0x10, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x4c, (byte) 0x0, (byte) 0x4, (byte) 0x6c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x8, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x2c, + (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2e, (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x24, (byte) 0x55, (byte) 0x6e, (byte) 0x6d, (byte) 0x6f, (byte) 0x64, (byte) 0x69, (byte) 0x66, (byte) 0x69, (byte) 0x61, (byte) 0x62, + (byte) 0x6c, (byte) 0x65, (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x19, (byte) 0x42, (byte) 0x0, (byte) 0x80, (byte) 0xcb, (byte) 0x5e, (byte) 0xf7, (byte) 0x1e, (byte) 0x2, (byte) 0x0, (byte) 0x1, (byte) 0x4c, (byte) 0x0, (byte) 0x1, (byte) 0x63, (byte) 0x74, (byte) 0x0, (byte) 0x16, (byte) 0x4c, (byte) 0x6a, + (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2f, (byte) 0x43, (byte) 0x6f, (byte) 0x6c, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x3b, (byte) 0x78, (byte) 0x70, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x75, + (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2e, (byte) 0x41, (byte) 0x72, (byte) 0x72, (byte) 0x61, (byte) 0x79, (byte) 0x4c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0x78, (byte) 0x81, (byte) 0xd2, (byte) 0x1d, (byte) 0x99, (byte) 0xc7, (byte) 0x61, (byte) 0x9d, (byte) 0x3, (byte) 0x0, (byte) 0x1, (byte) 0x49, (byte) 0x0, (byte) 0x4, (byte) 0x73, (byte) 0x69, (byte) 0x7a, (byte) 0x65, (byte) 0x78, + (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x77, (byte) 0x4, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x19, (byte) 0x78, (byte) 0x70 + }; + +} From c7b42305e98a8029cd52e3f8eba5ac10224a1c5e Mon Sep 17 00:00:00 2001 From: Kumar Srinivasan Date: Tue, 22 Sep 2015 11:50:40 -0700 Subject: [PATCH 25/81] 8073187: Unexpected side effect in Pack200 Reviewed-by: jrose, sherman --- .../com/sun/java/util/jar/pack/PackerImpl.java | 18 +++++------------- .../com/sun/java/util/jar/pack/PropMap.java | 6 +----- .../sun/java/util/jar/pack/UnpackerImpl.java | 16 ++++++---------- .../com/sun/java/util/jar/pack/Utils.java | 9 +-------- jdk/test/tools/pack200/Pack200Props.java | 4 +--- 5 files changed, 14 insertions(+), 39 deletions(-) diff --git a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PackerImpl.java b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PackerImpl.java index 2a5a5177ff7..5e7da4bb6d4 100644 --- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PackerImpl.java +++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PackerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -34,6 +34,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.time.ZoneOffset; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -41,7 +42,6 @@ import java.util.List; import java.util.ListIterator; import java.util.Map; import java.util.SortedMap; -import java.util.TimeZone; import java.util.jar.JarEntry; import java.util.jar.JarFile; import java.util.jar.JarInputStream; @@ -84,13 +84,8 @@ public class PackerImpl extends TLGlobals implements Pack200.Packer { */ public synchronized void pack(JarFile in, OutputStream out) throws IOException { assert(Utils.currentInstance.get() == null); - TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)) - ? null - : TimeZone.getDefault(); try { Utils.currentInstance.set(this); - if (tz != null) TimeZone.setDefault(TimeZone.getTimeZone("UTC")); - if ("0".equals(props.getProperty(Pack200.Packer.EFFORT))) { Utils.copyJarFile(in, out); } else { @@ -98,7 +93,6 @@ public class PackerImpl extends TLGlobals implements Pack200.Packer { } } finally { Utils.currentInstance.set(null); - if (tz != null) TimeZone.setDefault(tz); in.close(); } } @@ -119,11 +113,8 @@ public class PackerImpl extends TLGlobals implements Pack200.Packer { */ public synchronized void pack(JarInputStream in, OutputStream out) throws IOException { assert(Utils.currentInstance.get() == null); - TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)) ? null : - TimeZone.getDefault(); try { Utils.currentInstance.set(this); - if (tz != null) TimeZone.setDefault(TimeZone.getTimeZone("UTC")); if ("0".equals(props.getProperty(Pack200.Packer.EFFORT))) { Utils.copyJarFile(in, out); } else { @@ -131,7 +122,6 @@ public class PackerImpl extends TLGlobals implements Pack200.Packer { } } finally { Utils.currentInstance.set(null); - if (tz != null) TimeZone.setDefault(tz); in.close(); } } @@ -327,7 +317,9 @@ public class PackerImpl extends TLGlobals implements Pack200.Packer { this.f = null; this.jf = jf; this.je = je; - int timeSecs = getModtime(je.getTime()); + int timeSecs = (int) je.getTimeLocal() + .atOffset(ZoneOffset.UTC) + .toEpochSecond(); if (keepModtime && timeSecs != Constants.NO_MODTIME) { this.modtime = timeSecs; } else if (latestModtime && timeSecs > pkg.default_modtime) { diff --git a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PropMap.java b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PropMap.java index d5a08a805f5..3d54b911492 100644 --- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PropMap.java +++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/PropMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -69,10 +69,6 @@ final class PropMap implements SortedMap { props.put(Utils.DEBUG_VERBOSE, String.valueOf(Integer.getInteger(Utils.DEBUG_VERBOSE,0))); - // Set the PACK_TIMEZONE_NO_UTC - props.put(Utils.PACK_DEFAULT_TIMEZONE, - String.valueOf(Boolean.getBoolean(Utils.PACK_DEFAULT_TIMEZONE))); - // The segment size is unlimited props.put(Pack200.Packer.SEGMENT_LIMIT, "-1"); diff --git a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java index d18e95555d7..cf79442094a 100644 --- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java +++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -32,10 +32,11 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.time.LocalDateTime; +import java.time.ZoneOffset; import java.util.HashSet; import java.util.Set; import java.util.SortedMap; -import java.util.TimeZone; import java.util.jar.JarEntry; import java.util.jar.JarInputStream; import java.util.jar.JarOutputStream; @@ -95,13 +96,9 @@ public class UnpackerImpl extends TLGlobals implements Pack200.Unpacker { throw new NullPointerException("null output"); } assert(Utils.currentInstance.get() == null); - TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)) - ? null - : TimeZone.getDefault(); try { Utils.currentInstance.set(this); - if (tz != null) TimeZone.setDefault(TimeZone.getTimeZone("UTC")); final int verbose = props.getInteger(Utils.DEBUG_VERBOSE); BufferedInputStream in0 = new BufferedInputStream(in); if (Utils.isJarMagic(Utils.readMagic(in0))) { @@ -125,7 +122,6 @@ public class UnpackerImpl extends TLGlobals implements Pack200.Unpacker { } finally { _nunp = null; Utils.currentInstance.set(null); - if (tz != null) TimeZone.setDefault(tz); } } @@ -246,9 +242,9 @@ public class UnpackerImpl extends TLGlobals implements Pack200.Unpacker { je.setCrc(crc.getValue()); } if (keepModtime) { - je.setTime(file.modtime); - // Convert back to milliseconds - je.setTime((long)file.modtime * 1000); + LocalDateTime ldt = LocalDateTime + .ofEpochSecond(file.modtime, 0, ZoneOffset.UTC); + je.setTimeLocal(ldt); } else { je.setTime((long)modtime * 1000); } diff --git a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Utils.java b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Utils.java index 0c9109542bd..d17dc899821 100644 --- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Utils.java +++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Utils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -61,13 +61,6 @@ class Utils { */ static final String DEBUG_DISABLE_NATIVE = COM_PREFIX+"disable.native"; - /* - * Use the default working TimeZone instead of UTC. - * Note: This has installer unpacker implications. - * see: zip.cpp which uses gmtime vs. localtime. - */ - static final String PACK_DEFAULT_TIMEZONE = COM_PREFIX+"default.timezone"; - /* * Property indicating that the unpacker should * ignore the transmitted PACK_MODIFICATION_TIME, diff --git a/jdk/test/tools/pack200/Pack200Props.java b/jdk/test/tools/pack200/Pack200Props.java index dcb90548be8..fbb671649c9 100644 --- a/jdk/test/tools/pack200/Pack200Props.java +++ b/jdk/test/tools/pack200/Pack200Props.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2015, 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 @@ -88,8 +88,6 @@ public class Pack200Props { private static void verifyDefaults() { Map expectedDefaults = new HashMap<>(); Packer p = Pack200.newPacker(); - expectedDefaults.put("com.sun.java.util.jar.pack.default.timezone", - p.FALSE); expectedDefaults.put("com.sun.java.util.jar.pack.disable.native", p.FALSE); expectedDefaults.put("com.sun.java.util.jar.pack.verbose", "0"); From 30aa3bf02f804de45ced1720f616ed19e10d3d03 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Wed, 23 Sep 2015 14:09:36 -0700 Subject: [PATCH 26/81] 8133309: Some unicode characters do not display any more after upgrading to Windows 10 Reviewed-by: serb, jgodinez --- jdk/make/data/fontconfig/windows.fontconfig.properties | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jdk/make/data/fontconfig/windows.fontconfig.properties b/jdk/make/data/fontconfig/windows.fontconfig.properties index 65a239a44e4..9d3fa4a8315 100644 --- a/jdk/make/data/fontconfig/windows.fontconfig.properties +++ b/jdk/make/data/fontconfig/windows.fontconfig.properties @@ -40,6 +40,7 @@ allfonts.devanagari=Mangal allfonts.dingbats=Wingdings allfonts.lucida=Lucida Sans Regular allfonts.symbol=Symbol +allfonts.symbols=Segoe UI Symbol allfonts.thai=Lucida Sans Regular allfonts.georgian=Sylfaen @@ -236,7 +237,7 @@ sequence.dialoginput.x-windows-949=alphabetic,korean,dingbats,symbol sequence.allfonts.x-windows-874=alphabetic,thai,dingbats,symbol -sequence.fallback=lucida,\ +sequence.fallback=lucida,symbols,\ chinese-ms950,chinese-hkscs,chinese-ms936,chinese-gb18030,\ japanese,korean,chinese-ms950-extb,chinese-ms936-extb,georgian @@ -298,3 +299,4 @@ filename.Symbol=SYMBOL.TTF filename.Wingdings=WINGDING.TTF filename.Sylfaen=sylfaen.ttf +filename.Segoe_UI_Symbol=SEGUISYM.TTF From d0069e601689a95f6f23b17d7b90c2462b10b798 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Thu, 24 Sep 2015 10:11:46 -0700 Subject: [PATCH 27/81] 8137059: Run blessed-modifier-order script on client demos and misc. sources Reviewed-by: jgodinez, serb --- jdk/src/demo/share/applets/MoleculeViewer/XYZApp.java | 10 +++++----- .../java2d/J2DBench/src/j2dbench/tests/ImageTests.java | 2 +- .../java2d/J2DBench/src/j2dbench/tests/PixelTests.java | 6 +++--- .../J2DBench/src/j2dbench/tests/iio/InputTests.java | 2 +- .../J2DBench/src/j2dbench/tests/iio/OutputTests.java | 2 +- .../src/j2dbench/tests/text/TextMeasureTests.java | 6 +++--- .../share/jfc/FileChooserDemo/FileChooserDemo.java | 10 +++++----- jdk/src/demo/share/jfc/Notepad/Notepad.java | 2 +- .../classes/java/awt/datatransfer/DataFlavor.java | 8 ++++---- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/jdk/src/demo/share/applets/MoleculeViewer/XYZApp.java b/jdk/src/demo/share/applets/MoleculeViewer/XYZApp.java index ec036364436..a64a6b18b22 100644 --- a/jdk/src/demo/share/applets/MoleculeViewer/XYZApp.java +++ b/jdk/src/demo/share/applets/MoleculeViewer/XYZApp.java @@ -504,11 +504,11 @@ class Atom { private static Applet applet; private static byte[] data; - private final static int R = 40; - private final static int hx = 15; - private final static int hy = 15; - private final static int bgGrey = 192; - private final static int nBalls = 16; + private static final int R = 40; + private static final int hx = 15; + private static final int hy = 15; + private static final int bgGrey = 192; + private static final int nBalls = 16; private static int maxr; private int Rl; private int Gl; diff --git a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/ImageTests.java b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/ImageTests.java index 47cb8d7db32..69179c46072 100644 --- a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/ImageTests.java +++ b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/ImageTests.java @@ -771,7 +771,7 @@ public abstract class ImageTests extends GraphicsTests { } } - private static abstract class ImageOpTests extends ImageTests { + private abstract static class ImageOpTests extends ImageTests { ImageOpTests(Group parent, String nodeName, String desc) { super(parent, nodeName, desc, new Modifier.Filter() { diff --git a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/PixelTests.java b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/PixelTests.java index 75ba125220f..1b3fe3e2237 100644 --- a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/PixelTests.java +++ b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/PixelTests.java @@ -245,7 +245,7 @@ public abstract class PixelTests extends Test { } } - public static abstract class BufImgTest extends PixelTests { + public abstract static class BufImgTest extends PixelTests { public BufImgTest(String nodeName, String description) { super(bufimgtestroot, nodeName, description); } @@ -281,7 +281,7 @@ public abstract class PixelTests extends Test { } } - public static abstract class RasTest extends PixelTests { + public abstract static class RasTest extends PixelTests { public RasTest(String nodeName, String description) { super(rastertestroot, nodeName, description); } @@ -355,7 +355,7 @@ public abstract class PixelTests extends Test { } } - public static abstract class DataBufTest extends PixelTests { + public abstract static class DataBufTest extends PixelTests { public DataBufTest(String nodeName, String description) { super(dbtestroot, nodeName, description); } diff --git a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/InputTests.java b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/InputTests.java index bafae687052..664f6379554 100644 --- a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/InputTests.java +++ b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/InputTests.java @@ -161,7 +161,7 @@ abstract class InputTests extends IIOTests { } } - protected static abstract class Context { + protected abstract static class Context { int size; Object input; int inputType; diff --git a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/OutputTests.java b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/OutputTests.java index c09f5d2bd95..93ffe8f5b70 100644 --- a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/OutputTests.java +++ b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/OutputTests.java @@ -156,7 +156,7 @@ abstract class OutputTests extends IIOTests { } } - protected static abstract class Context { + protected abstract static class Context { int size; Object output; int outputType; diff --git a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/text/TextMeasureTests.java b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/text/TextMeasureTests.java index 6f9bb150b1d..356820e05b2 100644 --- a/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/text/TextMeasureTests.java +++ b/jdk/src/demo/share/java2d/J2DBench/src/j2dbench/tests/text/TextMeasureTests.java @@ -232,7 +232,7 @@ public abstract class TextMeasureTests extends TextTests { } } - public static abstract class GVMeasureTest extends TextMeasureTests { + public abstract static class GVMeasureTest extends TextMeasureTests { protected GVMeasureTest(Group parent, String nodeName, String description) { super(parent, nodeName, description); } @@ -431,7 +431,7 @@ public abstract class TextMeasureTests extends TextTests { } } - public static abstract class TLMeasureTest extends TextMeasureTests { + public abstract static class TLMeasureTest extends TextMeasureTests { protected TLMeasureTest(Group parent, String nodeName, String description) { super(parent, nodeName, description); } @@ -506,7 +506,7 @@ public abstract class TextMeasureTests extends TextTests { } } - public static abstract class TLExtendedMeasureTest extends TLMeasureTest { + public abstract static class TLExtendedMeasureTest extends TLMeasureTest { protected TLExtendedMeasureTest(Group parent, String nodeName, String description) { super(parent, nodeName, description); } diff --git a/jdk/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java b/jdk/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java index cd730f46ff3..89358d92550 100644 --- a/jdk/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java +++ b/jdk/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java @@ -143,11 +143,11 @@ public class FileChooserDemo extends JPanel implements ActionListener { private JTextField customField; private final ExampleFileView fileView; private final ExampleFileSystemView fileSystemView; - private final static Dimension hpad10 = new Dimension(10, 1); - private final static Dimension vpad20 = new Dimension(1, 20); - private final static Dimension vpad7 = new Dimension(1, 7); - private final static Dimension vpad4 = new Dimension(1, 4); - private final static Insets insets = new Insets(5, 10, 0, 10); + private static final Dimension hpad10 = new Dimension(10, 1); + private static final Dimension vpad20 = new Dimension(1, 20); + private static final Dimension vpad7 = new Dimension(1, 7); + private static final Dimension vpad4 = new Dimension(1, 4); + private static final Insets insets = new Insets(5, 10, 0, 10); private final FilePreviewer previewer; private final JFileChooser chooser; diff --git a/jdk/src/demo/share/jfc/Notepad/Notepad.java b/jdk/src/demo/share/jfc/Notepad/Notepad.java index 301510a154f..3ebe3f07d22 100644 --- a/jdk/src/demo/share/jfc/Notepad/Notepad.java +++ b/jdk/src/demo/share/jfc/Notepad/Notepad.java @@ -64,7 +64,7 @@ class Notepad extends JPanel { protected static Properties properties; private static ResourceBundle resources; - private final static String EXIT_AFTER_PAINT = "-exit"; + private static final String EXIT_AFTER_PAINT = "-exit"; private static boolean exitAfterFirstPaint; private static final String[] MENUBAR_KEYS = {"file", "edit", "debug"}; diff --git a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java index 69c0cbc474d..5f05177be39 100644 --- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java +++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java @@ -127,7 +127,7 @@ public class DataFlavor implements Externalizable, Cloneable { * @return the class loaded * @exception ClassNotFoundException if class is not found */ - protected final static Class tryToLoadClass(String className, + protected static final Class tryToLoadClass(String className, ClassLoader fallback) throws ClassNotFoundException { @@ -163,7 +163,7 @@ public class DataFlavor implements Externalizable, Cloneable { /* * private initializer */ - static private DataFlavor createConstant(Class rc, String prn) { + private static DataFlavor createConstant(Class rc, String prn) { try { return new DataFlavor(rc, prn); } catch (Exception e) { @@ -174,7 +174,7 @@ public class DataFlavor implements Externalizable, Cloneable { /* * private initializer */ - static private DataFlavor createConstant(String mt, String prn) { + private static DataFlavor createConstant(String mt, String prn) { try { return new DataFlavor(mt, prn); } catch (Exception e) { @@ -185,7 +185,7 @@ public class DataFlavor implements Externalizable, Cloneable { /* * private initializer */ - static private DataFlavor initHtmlDataFlavor(String htmlFlavorType) { + private static DataFlavor initHtmlDataFlavor(String htmlFlavorType) { try { return new DataFlavor ("text/html; class=java.lang.String;document=" + htmlFlavorType + ";charset=Unicode"); From 8a0268e190e8dc7fdd9149fc3151a4d473091d8a Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Fri, 25 Sep 2015 00:15:58 +0300 Subject: [PATCH 28/81] 8135122: The SwingUtilities2.COMPONENT_UI_PROPERTY_KEY can be removed Reviewed-by: azvegint, alexsch --- .../com/apple/laf/AquaUtilControlSize.java | 88 +++++++++++-------- .../share/classes/javax/swing/JComponent.java | 2 - .../swing/plaf/synth/SynthLookAndFeel.java | 5 +- .../classes/sun/swing/SwingUtilities2.java | 7 -- 4 files changed, 54 insertions(+), 48 deletions(-) diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtilControlSize.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtilControlSize.java index 7c4a3351566..2acc1eaedcf 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtilControlSize.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtilControlSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -27,7 +27,6 @@ package com.apple.laf; import java.awt.*; import java.beans.*; -import java.lang.reflect.Method; import javax.swing.*; import javax.swing.border.Border; @@ -38,6 +37,9 @@ import apple.laf.JRSUIConstants.*; import com.apple.laf.AquaUtils.RecyclableSingleton; import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor; +import sun.security.action.GetPropertyAction; + +import static java.security.AccessController.*; public class AquaUtilControlSize { protected static final String CLIENT_PROPERTY_KEY = "JComponent.sizeVariant"; @@ -47,7 +49,8 @@ public class AquaUtilControlSize { void applySizeFor(final JComponent c, final Size size); } - protected static final RecyclableSingleton sizeListener = new RecyclableSingletonFromDefaultConstructor(PropertySizeListener.class); + protected static final RecyclableSingleton sizeListener + = new RecyclableSingletonFromDefaultConstructor<>(PropertySizeListener.class); protected static PropertySizeListener getSizeListener() { return sizeListener.get(); } @@ -70,7 +73,7 @@ public class AquaUtilControlSize { } private static Size getDefaultSize() { - final String sizeProperty = java.security.AccessController.doPrivileged(new sun.security.action.GetPropertyAction(SYSTEM_PROPERTY_KEY)); + final String sizeProperty = doPrivileged(new GetPropertyAction(SYSTEM_PROPERTY_KEY)); final JRSUIConstants.Size size = getSizeFromString(sizeProperty); if (size != null) return size; return JRSUIConstants.Size.REGULAR; @@ -85,20 +88,32 @@ public class AquaUtilControlSize { return size; } - protected static JRSUIConstants.Size applySizeForControl(final JComponent c, final AquaPainter painter) { + protected static JRSUIConstants.Size applySizeForControl(final JComponent c, + final AquaPainter painter) { final JRSUIConstants.Size sizeFromUser = getUserSizeFrom(c); - final JRSUIConstants.Size size = sizeFromUser == null ? JRSUIConstants.Size.REGULAR : sizeFromUser; + final JRSUIConstants.Size size = sizeFromUser == null + ? JRSUIConstants.Size.REGULAR + : sizeFromUser; painter.state.set(size); return size; } - protected static Font getFontForSize(final Component c, final JRSUIConstants.Size size) { + protected static Font getFontForSize(final Component c, + final JRSUIConstants.Size size) { final Font initialFont = c.getFont(); - if (size == null || !(initialFont instanceof UIResource)) return initialFont; + if (size == null || !(initialFont instanceof UIResource)) { + return initialFont; + } - if (size == JRSUIConstants.Size.MINI) return initialFont.deriveFont(AquaFonts.getMiniControlTextFont().getSize2D()); - if (size == JRSUIConstants.Size.SMALL) return initialFont.deriveFont(AquaFonts.getSmallControlTextFont().getSize2D()); + if (size == JRSUIConstants.Size.MINI) { + return initialFont.deriveFont( + AquaFonts.getMiniControlTextFont().getSize2D()); + } + if (size == JRSUIConstants.Size.SMALL) { + return initialFont.deriveFont( + AquaFonts.getSmallControlTextFont().getSize2D()); + } return initialFont.deriveFont(AquaFonts.getControlTextFont().getSize2D()); } @@ -115,25 +130,8 @@ public class AquaUtilControlSize { c.setBorder(derivedBorder); } - // call JComponent.getUI() if it exists, then call Sizeable.applySizeFor() if the UI is "Sizeable" - // next best thing to -respondsToSelector: :-P - private static void applyUISizing(final JComponent c, final Size size) { - try { - // see if this component has a "getUI" method - final Class clazz = c.getClass(); - final Method getUIMethod = clazz.getMethod("getUI", new Class[0]); - - // see if that UI is one of ours that understands sizing - final Object ui = getUIMethod.invoke(c, new Object[0]); - if (!(ui instanceof Sizeable)) return; - - // size it! - final Sizeable sizeable = (Sizeable)ui; - sizeable.applySizeFor(c, size); - } catch (final Throwable e) { return; } - } - protected static class PropertySizeListener implements PropertyChangeListener { + @Override public void propertyChange(final PropertyChangeEvent evt) { final String key = evt.getPropertyName(); if (!CLIENT_PROPERTY_KEY.equalsIgnoreCase(key)) return; @@ -154,7 +152,10 @@ public class AquaUtilControlSize { applyBorderForSize(c, size); - applyUISizing(c, size); + final Object ui = c.getUI(); + if (ui instanceof Sizeable) { + ((Sizeable) ui).applySizeFor(c, size); + } final Font priorFont = c.getFont(); if (!(priorFont instanceof FontUIResource)) return; @@ -200,6 +201,7 @@ public class AquaUtilControlSize { return regular; } + @Override public String toString() { return "regular[" + regular + "] small[" + small + "] mini[" + mini + "]"; } @@ -223,8 +225,14 @@ public class AquaUtilControlSize { public SizeVariant(final SizeVariant desc){ this.size = desc.size; - this.insets = new InsetsUIResource(desc.insets.top, desc.insets.left, desc.insets.bottom, desc.insets.right); - this.margins = new InsetsUIResource(desc.margins.top, desc.margins.left, desc.margins.bottom, desc.margins.right); + this.insets = new InsetsUIResource(desc.insets.top, + desc.insets.left, + desc.insets.bottom, + desc.insets.right); + this.margins = new InsetsUIResource(desc.margins.top, + desc.margins.left, + desc.margins.bottom, + desc.margins.right); this.fontSize = desc.fontSize; this.w = desc.w; this.h = desc.h; @@ -241,7 +249,8 @@ public class AquaUtilControlSize { return this; } - public SizeVariant alterInsets(final int top, final int left, final int bottom, final int right) { + public SizeVariant alterInsets(final int top, final int left, + final int bottom, final int right) { insets = generateInsets(insets, top, left, bottom, right); return this; } @@ -251,7 +260,8 @@ public class AquaUtilControlSize { return this; } - public SizeVariant alterMargins(final int top, final int left, final int bottom, final int right) { + public SizeVariant alterMargins(final int top, final int left, + final int bottom, final int right) { margins = generateInsets(margins, top, left, bottom, right); return this; } @@ -273,8 +283,12 @@ public class AquaUtilControlSize { // return this; // } - static Insets generateInsets(final Insets i, final int top, final int left, final int bottom, final int right) { - if (i == null) return new InsetsUIResource(top, left, bottom, right); + static Insets generateInsets(final Insets i, final int top, + final int left, final int bottom, + final int right) { + if (i == null) { + return new InsetsUIResource(top, left, bottom, right); + } i.top += top; i.left += left; i.bottom += bottom; @@ -282,8 +296,10 @@ public class AquaUtilControlSize { return i; } + @Override public String toString() { - return "insets:" + insets + ", margins:" + margins + ", fontSize:" + fontSize;// + ", textBaseline:" + textBaseline; + return "insets:" + insets + ", margins:" + margins + ", fontSize:" + + fontSize;// + ", textBaseline:" + textBaseline; } } } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java b/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java index d00d42c8bbb..7c85698cc9f 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java @@ -4064,8 +4064,6 @@ public abstract class JComponent extends Container implements Serializable, return aaHint; } else if (key == RenderingHints.KEY_TEXT_LCD_CONTRAST) { return lcdRenderingHint; - } else if (key == SwingUtilities2.COMPONENT_UI_PROPERTY_KEY) { - return ui; } if(clientProperties == null) { return null; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java index b0af7ce40fb..fa4640dec73 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -949,8 +949,7 @@ public class SynthLookAndFeel extends BasicLookAndFeel { * @comp the component to check */ private void repaintIfBackgroundsDiffer(JComponent comp) { - ComponentUI ui = (ComponentUI)comp.getClientProperty( - SwingUtilities2.COMPONENT_UI_PROPERTY_KEY); + ComponentUI ui = comp.getUI(); if (ui instanceof SynthUI) { SynthUI synthUI = (SynthUI)ui; SynthContext context = synthUI.getContext(comp); diff --git a/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java b/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java index 0e00326c4c7..0b9104a826a 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java @@ -135,13 +135,6 @@ public class SwingUtilities2 { } } - /** - * Key used in client properties used to indicate that the - * {@code ComponentUI} of the JComponent instance should be returned. - */ - public static final Object COMPONENT_UI_PROPERTY_KEY = - new StringBuffer("ComponentUIPropertyKey"); - /** Client Property key for the text maximal offsets for BasicMenuItemUI */ public static final StringUIClientPropertyKey BASICMENUITEMUI_MAX_TEXT_OFFSET = new StringUIClientPropertyKey ("maxTextOffset"); From 3019b8d25972ecfd1ec7fd8611e6f7f598b0e661 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Sat, 26 Sep 2015 20:54:52 +0300 Subject: [PATCH 29/81] 6646604: Typos in documentation Reviewed-by: azvegint, amenkov --- .../java.desktop/share/classes/javax/sound/midi/MidiDevice.java | 2 +- .../share/classes/javax/sound/midi/Synthesizer.java | 2 +- .../share/classes/javax/sound/midi/SysexMessage.java | 2 +- .../share/classes/javax/sound/sampled/AudioInputStream.java | 2 +- .../share/classes/javax/sound/sampled/LineEvent.java | 2 +- .../javax/swing/plaf/synth/doc-files/synthFileFormat.html | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jdk/src/java.desktop/share/classes/javax/sound/midi/MidiDevice.java b/jdk/src/java.desktop/share/classes/javax/sound/midi/MidiDevice.java index 43c82932f6a..de67ee2cd61 100644 --- a/jdk/src/java.desktop/share/classes/javax/sound/midi/MidiDevice.java +++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/MidiDevice.java @@ -335,7 +335,7 @@ public interface MidiDevice extends AutoCloseable { /** * Obtains the version of the device. * - * @return textual version information for the device. + * @return textual version information for the device */ public final String getVersion() { return version; diff --git a/jdk/src/java.desktop/share/classes/javax/sound/midi/Synthesizer.java b/jdk/src/java.desktop/share/classes/javax/sound/midi/Synthesizer.java index 3d8c7a64d23..bc18df9c13c 100644 --- a/jdk/src/java.desktop/share/classes/javax/sound/midi/Synthesizer.java +++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/Synthesizer.java @@ -344,7 +344,7 @@ public interface Synthesizer extends MidiDevice { * Opens the receiver. * * @throws MidiUnavailableException if the receiver is cannot be opened, - * usually because the MIDI device is in use by another application. + * usually because the MIDI device is in use by another application * @throws SecurityException if the receiver cannot be opened due to * security restrictions */ diff --git a/jdk/src/java.desktop/share/classes/javax/sound/midi/SysexMessage.java b/jdk/src/java.desktop/share/classes/javax/sound/midi/SysexMessage.java index 8bcd00a9030..23ba4f8f50c 100644 --- a/jdk/src/java.desktop/share/classes/javax/sound/midi/SysexMessage.java +++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/SysexMessage.java @@ -124,7 +124,7 @@ public class SysexMessage extends MidiMessage { * including the status byte; it should be non-negative and less * than or equal to {@code data.length} * @throws InvalidMidiDataException if the parameter values do not specify a - * valid MIDI meta message. + * valid MIDI meta message * @see #setMessage(byte[], int) * @see #setMessage(int, byte[], int) * @see #getData() diff --git a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java index 14e7b537f1b..e9e770c0e0d 100644 --- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java +++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java @@ -392,7 +392,7 @@ public class AudioInputStream extends InputStream { * Marks the current position in this audio input stream. * * @param readlimit the maximum number of bytes that can be read before the - * mark position becomes invalid. + * mark position becomes invalid * @see #reset * @see #markSupported */ diff --git a/jdk/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java b/jdk/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java index 035c38f74f5..95f9be6dcf6 100644 --- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java +++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java @@ -82,7 +82,7 @@ public class LineEvent extends EventObject { * @param position the number of sample frames that the line had already * processed when the event occurred, or * {@link AudioSystem#NOT_SPECIFIED} - * @throws IllegalArgumentException if {@code line} is {@code null}. + * @throws IllegalArgumentException if {@code line} is {@code null} */ public LineEvent(Line line, Type type, long position) { diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html index a428be92563..202283049b5 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html @@ -105,7 +105,7 @@ div.example {
    Unique identifier for the style.
    clone
    Identifier of a previously defined style that is copied - and used for the new style. This provides a conveniant + and used for the new style. This provides a convenient mechanism for overriding only a portion of an existing style.
    From ebf2ca56f0b14e3fd7e806f48edf809f144a5691 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Sat, 26 Sep 2015 22:38:36 +0300 Subject: [PATCH 30/81] 8079965: Stop ignoring warnings for libawt_lwawt Reviewed-by: prr, ihse --- jdk/make/lib/Awt2dLibraries.gmk | 3 +- .../macosx/native/libawt_lwawt/awt/AWTEvent.h | 4 +-- .../macosx/native/libawt_lwawt/awt/AWTEvent.m | 17 +++++------ .../macosx/native/libawt_lwawt/awt/AWTView.h | 3 +- .../macosx/native/libawt_lwawt/awt/AWTView.m | 15 ++++------ .../native/libawt_lwawt/awt/AWTWindow.h | 5 ++-- .../native/libawt_lwawt/awt/AWTWindow.m | 5 ---- .../native/libawt_lwawt/awt/CDataTransferer.m | 6 ++-- .../native/libawt_lwawt/awt/CGraphicsConfig.m | 2 +- .../native/libawt_lwawt/awt/CGraphicsDevice.m | 6 ++-- .../native/libawt_lwawt/awt/CGraphicsEnv.m | 9 +++--- .../native/libawt_lwawt/awt/CPrinterJob.m | 29 ++++++++++++------- .../native/libawt_lwawt/awt/CTrayIcon.m | 5 ++-- .../native/libawt_lwawt/awt/GeomUtilities.h | 5 ++-- .../native/libawt_lwawt/awt/GeomUtilities.m | 3 +- .../awt/JavaComponentAccessibility.h | 6 ++-- .../native/libawt_lwawt/awt/LWCToolkit.h | 3 +- .../native/libawt_lwawt/awt/LWCToolkit.m | 7 ++--- .../java2d/opengl/CGLGraphicsConfig.m | 15 ++++------ .../libawt_lwawt/java2d/opengl/CGLLayer.h | 4 +-- .../java2d/opengl/CGLSurfaceData.m | 3 -- 21 files changed, 68 insertions(+), 87 deletions(-) diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index 21cd2d6f01a..858ca275970 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -959,10 +959,9 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) $(X_CFLAGS) \ $(X_LIBS) \ $(LIBAWT_LWAWT_CFLAGS), \ - DISABLED_WARNINGS_clang := incomplete-implementation \ + DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \ deprecated-declarations objc-method-access bitwise-op-parentheses \ incompatible-pointer-types parentheses-equality extra-tokens, \ - WARNINGS_AS_ERRORS_clang := false, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN) \ -L$(INSTALL_LIBRARIES_HERE), \ diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.h b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.h index 7769f3d4163..3c7cbe086ee 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.h +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -26,8 +26,6 @@ #ifndef __AWTEVENT_H #define __AWTEVENT_H -#import "LWCToolkit.h" - jlong UTC(NSEvent *event); void DeliverJavaKeyEvent(JNIEnv *env, NSEvent *event, jobject peer); void DeliverJavaMouseEvent(JNIEnv *env, NSEvent *event, jobject peer); diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m index 70624769dab..51bacfcd5e4 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m @@ -23,18 +23,15 @@ * questions. */ -#import -#import -#import -#include - -#import "jni_util.h" -#import "LWCToolkit.h" -#import "ThreadUtilities.h" - #import "java_awt_event_InputEvent.h" #import "java_awt_event_KeyEvent.h" -#import "java_awt_event_MouseEvent.h" +#import "LWCToolkit.h" + +#import "jni_util.h" + +#import +#import +#import /* * Table to map typed characters to their Java virtual key equivalent and back. diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.h b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.h index 592235bf7be..0344aebfe44 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.h +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -24,7 +24,6 @@ */ #import -#import #import "CDragSource.h" #import "CDropTarget.h" diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m index ca741d0f9b7..a7784585272 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -23,22 +23,17 @@ * questions. */ -#import "CGLGraphicsConfig.h" - -#import -#import #import "jni_util.h" - -#import "ThreadUtilities.h" +#import "CGLGraphicsConfig.h" #import "AWTView.h" -#import "AWTEvent.h" #import "AWTWindow.h" -#import "LWCToolkit.h" #import "JavaComponentAccessibility.h" #import "JavaTextAccessibility.h" #import "GeomUtilities.h" #import "OSVersion.h" -#import "CGLLayer.h" +#import "ThreadUtilities.h" + +#import @interface AWTView() @property (retain) CDropTarget *_dropTarget; diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.h b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.h index 7b8fa5e6477..d1bb8c64c43 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.h +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -27,13 +27,12 @@ #define _AWTWINDOW_H #import -#import #import "CMenuBar.h" #import "LWCToolkit.h" - @class AWTView; +@class JNFWeakJObjectWrapper; @interface AWTWindow : NSObject { @private diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m index 749c64b54be..eff112a9634 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m @@ -25,7 +25,6 @@ #import #import -#import #import "sun_lwawt_macosx_CPlatformWindow.h" #import "com_apple_eawt_event_GestureHandler.h" @@ -34,12 +33,8 @@ #import "AWTWindow.h" #import "AWTView.h" -#import "CMenu.h" -#import "CMenuBar.h" -#import "LWCToolkit.h" #import "GeomUtilities.h" #import "ThreadUtilities.h" -#import "OSVersion.h" #define MASK(KEY) \ (sun_lwawt_macosx_CPlatformWindow_ ## KEY) diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CDataTransferer.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CDataTransferer.m index 5fcb04bdb70..6a6339facfe 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CDataTransferer.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CDataTransferer.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -26,11 +26,9 @@ #import "CDataTransferer.h" #include "sun_lwawt_macosx_CDataTransferer.h" -#import -#import #import "jni_util.h" -#include "ThreadUtilities.h" +#import // ***** NOTE ***** This dictionary corresponds to the static array predefinedClipboardNames diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsConfig.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsConfig.m index 9ae58a76e17..efd6fdd2290 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsConfig.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsConfig.m @@ -27,7 +27,7 @@ #include "GeomUtilities.h" #include "sun_awt_CGraphicsConfig.h" - +#import /* * Class: sun_awt_CGraphicsConfig diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsDevice.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsDevice.m index 36df94b1236..d59fd859842 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsDevice.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsDevice.m @@ -26,6 +26,8 @@ #import "LWCToolkit.h" #import "ThreadUtilities.h" +#import + /* * Convert the mode string to the more convinient bits per pixel value */ @@ -200,7 +202,7 @@ JNF_COCOA_ENTER(env); for (NSScreen *screen in screens) { NSDictionary *screenInfo = [screen deviceDescription]; NSNumber *screenID = [screenInfo objectForKey:@"NSScreenNumber"]; - if ([screenID pointerValue] == displayID){ + if ([screenID unsignedIntValue] == displayID){ frame = [screen frame]; visibleFrame = [screen visibleFrame]; break; @@ -333,7 +335,7 @@ JNF_COCOA_ENTER(env); for (NSScreen *screen in screens) { NSDictionary *screenInfo = [screen deviceDescription]; NSNumber *screenID = [screenInfo objectForKey:@"NSScreenNumber"]; - if ([screenID pointerValue] == displayID){ + if ([screenID unsignedIntValue] == displayID){ if ([screen respondsToSelector:@selector(backingScaleFactor)]) { ret = [screen backingScaleFactor]; } diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsEnv.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsEnv.m index 55ea2d060cb..745569452d6 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsEnv.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsEnv.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -23,12 +23,11 @@ * questions. */ -#import - -#import "jni_util.h" -#import "LWCToolkit.h" #import "AWT_debug.h" +#import "jni_util.h" + +#import #define MAX_DISPLAYS 64 diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m index 4a85a916976..165e7029497 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -58,6 +58,14 @@ static void nsPrintInfoToJavaPrinterJob(JNIEnv* env, NSPrintInfo* src, jobject d static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobject srcPageable, NSPrintInfo* dst); +#ifdef __MAC_10_9 // code for SDK 10.9 or newer +#define NS_PORTRAIT NSPaperOrientationPortrait +#define NS_LANDSCAPE NSPaperOrientationLandscape +#else // code for SDK 10.8 or older +#define NS_PORTRAIT NSPortraitOrientation +#define NS_LANDSCAPE NSLandscapeOrientation +#endif + static NSPrintInfo* createDefaultNSPrintInfo(JNIEnv* env, jstring printer) { NSPrintInfo* defaultPrintInfo = [[NSPrintInfo sharedPrintInfo] copy]; @@ -143,12 +151,12 @@ static void nsPrintInfoToJavaPaper(JNIEnv* env, NSPrintInfo* src, jobject dst) NSSize paperSize = [src paperSize]; switch ([src orientation]) { - case NSPortraitOrientation: + case NS_PORTRAIT: jPaperW = paperSize.width; jPaperH = paperSize.height; break; - case NSLandscapeOrientation: + case NS_LANDSCAPE: jPaperW = paperSize.height; jPaperH = paperSize.width; break; @@ -217,13 +225,12 @@ static void nsPrintInfoToJavaPageFormat(JNIEnv* env, NSPrintInfo* src, jobject d static JNF_CTOR_CACHE(jm_Paper_ctor, sjc_Paper, "()V"); jint jOrientation; - NSPrintingOrientation nsOrientation = [src orientation]; - switch (nsOrientation) { - case NSPortraitOrientation: + switch ([src orientation]) { + case NS_PORTRAIT: jOrientation = java_awt_print_PageFormat_PORTRAIT; break; - case NSLandscapeOrientation: + case NS_LANDSCAPE: jOrientation = java_awt_print_PageFormat_LANDSCAPE; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted? break; @@ -273,20 +280,20 @@ static void javaPageFormatToNSPrintInfo(JNIEnv* env, jobject srcPrintJob, jobjec switch (JNFCallIntMethod(env, srcPageFormat, jm_getOrientation)) { // AWT_THREADING Safe (!appKit) case java_awt_print_PageFormat_PORTRAIT: - [dstPrintInfo setOrientation:NSPortraitOrientation]; + [dstPrintInfo setOrientation:NS_PORTRAIT]; break; case java_awt_print_PageFormat_LANDSCAPE: - [dstPrintInfo setOrientation:NSLandscapeOrientation]; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted? + [dstPrintInfo setOrientation:NS_LANDSCAPE]; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted? break; // AppKit printing doesn't support REVERSE_LANDSCAPE. Radar 2960295. case java_awt_print_PageFormat_REVERSE_LANDSCAPE: - [dstPrintInfo setOrientation:NSLandscapeOrientation]; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted? + [dstPrintInfo setOrientation:NS_LANDSCAPE]; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted? break; default: - [dstPrintInfo setOrientation:NSPortraitOrientation]; + [dstPrintInfo setOrientation:NS_PORTRAIT]; break; } diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m index 35adf3b866d..73d4c2f7896 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -23,9 +23,10 @@ * questions. */ +#import "jni_util.h" + #import #import -#import "jni_util.h" #import "CTrayIcon.h" #import "ThreadUtilities.h" diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/GeomUtilities.h b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/GeomUtilities.h index b2ad0153781..c0ca9d20f41 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/GeomUtilities.h +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/GeomUtilities.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -24,8 +24,7 @@ */ #import -#import - +#include "jni.h" jobject CGToJavaRect(JNIEnv *env, CGRect rect); CGRect JavaToCGRect(JNIEnv *env, jobject rect); diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/GeomUtilities.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/GeomUtilities.m index 4f6e8732cfa..4d803d87500 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/GeomUtilities.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/GeomUtilities.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -24,6 +24,7 @@ */ #import "GeomUtilities.h" +#import static JNF_CLASS_CACHE(sjc_Point2D, "java/awt/geom/Point2D"); static JNF_MEMBER_CACHE(jm_pt_getX, sjc_Point2D, "getX", "()D"); diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.h b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.h index 392fd30ea6c..9d22e28d4e9 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.h +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -23,9 +23,9 @@ * questions. */ -#import -#import +#include "jni.h" +#import //#define JAVA_AX_DEBUG 1 //#define JAVA_AX_NO_IGNORES 1 diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.h b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.h index c3e1b538ac9..7c07c9d9689 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.h +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.h @@ -23,11 +23,12 @@ * questions. */ +#include "jni.h" + #import #import #import -#import #define DEBUG 1 diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m index 2a4ab93f4e2..48fe1b9a3dc 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m @@ -28,15 +28,10 @@ #import #import #import -#import -#import #include "jni_util.h" -#import "CMenuBar.h" -#import "InitIDs.h" #import "LWCToolkit.h" #import "ThreadUtilities.h" -#import "AWT_debug.h" #import "CSystemColors.h" #import "NSApplicationAWT.h" #import "PropertiesUtilities.h" @@ -46,6 +41,8 @@ #import "sizecalc.h" +#import + int gNumberOfButtons; jint* gButtonDownMasks; diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLGraphicsConfig.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLGraphicsConfig.m index 241f66e11ac..605c345f2ce 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLGraphicsConfig.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLGraphicsConfig.m @@ -23,20 +23,17 @@ * questions. */ +#import "sun_java2d_opengl_CGLGraphicsConfig.h" + +#import "CGLGraphicsConfig.h" +#import "CGLSurfaceData.h" +#import "ThreadUtilities.h" + #import #import #import #import -#import "sun_java2d_opengl_CGLGraphicsConfig.h" - -#import "jni.h" -#import "jni_util.h" -#import "CGLGraphicsConfig.h" -#import "CGLSurfaceData.h" -#import "LWCToolkit.h" -#import "ThreadUtilities.h" - #pragma mark - #pragma mark "--- Mac OS X specific methods for GL pipeline ---" diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.h b/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.h index 43724c04b29..4a34dda953c 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.h +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -26,7 +26,7 @@ #ifndef CGLLayer_h_Included #define CGLLayer_h_Included -#import "AWTView.h" +#import @interface CGLLayer : CAOpenGLLayer { diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLSurfaceData.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLSurfaceData.m index 04dad19fb55..328721843a3 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLSurfaceData.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLSurfaceData.m @@ -24,16 +24,13 @@ */ #import -#import #import "sun_java2d_opengl_CGLSurfaceData.h" -#import "jni.h" #import "jni_util.h" #import "OGLRenderQueue.h" #import "CGLGraphicsConfig.h" #import "CGLSurfaceData.h" -#import "CGLLayer.h" #import "ThreadUtilities.h" /* JDK's glext.h is already included and will prevent the Apple glext.h From da9e27a0182a323a597070ed16d0a71c3f61643a Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Sun, 27 Sep 2015 00:51:27 +0300 Subject: [PATCH 31/81] 8135160: Endless Loop in RiffReader Reviewed-by: prr, amenkov --- .../com/sun/media/sound/DLSSoundbank.java | 8 +-- .../com/sun/media/sound/RIFFReader.java | 55 +++++++++--------- .../midi/Gervill/RiffReaderWriter/Skip.java | 22 +++++-- .../EndlessLoopHugeLengthWave.java | 57 +++++++++++++++++++ 4 files changed, 106 insertions(+), 36 deletions(-) create mode 100644 jdk/test/javax/sound/sampled/spi/AudioFileReader/EndlessLoopHugeLengthWave.java diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java index 59d0c8cf6af..db509a96eef 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java @@ -548,7 +548,7 @@ public final class DLSSoundbank implements Soundbank { long count = riff.readUnsignedInt(); if (size - 8 != 0) - riff.skipBytes(size - 8); + riff.skip(size - 8); for (int i = 0; i < count; i++) { DLSModulator modulator = new DLSModulator(); @@ -568,7 +568,7 @@ public final class DLSSoundbank implements Soundbank { long count = riff.readUnsignedInt(); if (size - 8 != 0) - riff.skipBytes(size - 8); + riff.skip(size - 8); for (int i = 0; i < count; i++) { DLSModulator modulator = new DLSModulator(); @@ -661,7 +661,7 @@ public final class DLSSoundbank implements Soundbank { long loops = riff.readInt(); if (size > 20) - riff.skipBytes(size - 20); + riff.skip(size - 20); for (int i = 0; i < loops; i++) { DLSSampleLoop loop = new DLSSampleLoop(); @@ -671,7 +671,7 @@ public final class DLSSoundbank implements Soundbank { loop.length = riff.readUnsignedInt(); sampleOptions.loops.add(loop); if (size2 > 16) - riff.skipBytes(size2 - 16); + riff.skip(size2 - 16); } } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/RIFFReader.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/RIFFReader.java index 9849fbcb961..93c1a058294 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/RIFFReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/RIFFReader.java @@ -118,6 +118,7 @@ public final class RIFFReader extends InputStream { return ckSize; } + @Override public int read() throws IOException { if (avail == 0) { return -1; @@ -132,6 +133,7 @@ public final class RIFFReader extends InputStream { return b; } + @Override public int read(byte[] b, int offset, int len) throws IOException { if (avail == 0) { return -1; @@ -172,49 +174,45 @@ public final class RIFFReader extends InputStream { } } - public long skipBytes(long n) throws IOException { - if (n < 0) + @Override + public long skip(final long n) throws IOException { + if (n <= 0 || avail == 0) { return 0; - long skipped = 0; - while (skipped != n) { - long s = skip(n - skipped); - if (s < 0) - break; - if (s == 0) - Thread.yield(); - skipped += s; } - return skipped; - } - - public long skip(long n) throws IOException { - if (avail == 0) - return -1; - if (n > avail) { - long len = stream.skip(avail); - if (len != -1) - filepointer += len; - avail = 0; - return len; - } else { - long ret = stream.skip(n); - if (ret == -1) { + // will not skip more than + long remaining = Math.min(n, avail); + while (remaining > 0) { + // Some input streams like FileInputStream can return more bytes, + // when EOF is reached. + long ret = Math.min(stream.skip(remaining), remaining); + if (ret == 0) { + // EOF or not? we need to check. + Thread.yield(); + if (stream.read() == -1) { + avail = 0; + break; + } + ret = 1; + } else if (ret < 0) { + // the skip should not return negative value, but check it also avail = 0; - return -1; + break; } + remaining -= ret; avail -= ret; filepointer += ret; - return ret; } + return n - remaining; } + @Override public int available() { return (int)avail; } public void finish() throws IOException { if (avail != 0) { - skipBytes(avail); + skip(avail); } } @@ -337,6 +335,7 @@ public final class RIFFReader extends InputStream { return ch1 + (ch2 << 8) | (ch3 << 16) | (ch4 << 24); } + @Override public void close() throws IOException { finish(); if (this == root) diff --git a/jdk/test/javax/sound/midi/Gervill/RiffReaderWriter/Skip.java b/jdk/test/javax/sound/midi/Gervill/RiffReaderWriter/Skip.java index bf09f79f884..4da4f7a8bfc 100644 --- a/jdk/test/javax/sound/midi/Gervill/RiffReaderWriter/Skip.java +++ b/jdk/test/javax/sound/midi/Gervill/RiffReaderWriter/Skip.java @@ -29,9 +29,8 @@ import java.io.File; import java.io.FileInputStream; -import javax.sound.sampled.*; - -import com.sun.media.sound.*; +import com.sun.media.sound.RIFFReader; +import com.sun.media.sound.RIFFWriter; public class Skip { @@ -42,6 +41,11 @@ public class Skip { } public static void main(String[] args) throws Exception { + test(false); + test(true); + } + + private static void test(boolean customStream) throws Exception { RIFFWriter writer = null; RIFFReader reader = null; File tempfile = File.createTempFile("test",".riff"); @@ -53,7 +57,17 @@ public class Skip { chunk.write((byte)44); writer.close(); writer = null; - FileInputStream fis = new FileInputStream(tempfile); + final FileInputStream fis; + if (customStream) { + fis = new FileInputStream(tempfile); + } else { + fis = new FileInputStream(tempfile) { + @Override + public long skip(long n) { + return 0; + } + }; + } reader = new RIFFReader(fis); RIFFReader readchunk = reader.nextChunk(); reader.skip(1); diff --git a/jdk/test/javax/sound/sampled/spi/AudioFileReader/EndlessLoopHugeLengthWave.java b/jdk/test/javax/sound/sampled/spi/AudioFileReader/EndlessLoopHugeLengthWave.java new file mode 100644 index 00000000000..05255c7d3fc --- /dev/null +++ b/jdk/test/javax/sound/sampled/spi/AudioFileReader/EndlessLoopHugeLengthWave.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.ByteArrayInputStream; + +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.UnsupportedAudioFileException; + +/** + * @test + * @bug 8135160 + */ +public final class EndlessLoopHugeLengthWave { + + // some data wich can cause an endless loop in RiffReader.java + private static byte[] headerWAV = {0x52, 0x49, 0x46, 0x46, // RIFF_MAGIC + 0x7, 0xF, 0xF, 0xF, // fileLength + 0x57, 0x41, 0x56, 0x45, // waveMagic + 0x66, 0x6d, 0x74, 0x20, // FMT_MAGIC + 1, 2, 3, 4, // format + 3, 0,// wav_type WAVE_FORMAT_IEEE_FLOAT + 1, 0, // channels + 1, 1, // sampleRate + 1, 0, 0, 0, // avgBytesPerSec + 0, 1, // blockAlign + 1, 0, // sampleSizeInBits + 0x64, 0x61, 0x74, 0x61, // DATA_MAGIC + }; + + public static void main(final String[] args) throws Exception { + try { + AudioSystem.getAudioFileFormat(new ByteArrayInputStream(headerWAV)); + } catch (final UnsupportedAudioFileException ignored) { + // Expected + } + } +} \ No newline at end of file From b6c3667ca07c5727468cc4fa387012300ed9fc6a Mon Sep 17 00:00:00 2001 From: Attila Szegedi Date: Mon, 28 Sep 2015 08:40:39 +0200 Subject: [PATCH 32/81] 8134502: introduce abstraction for basic NodeVisitor usage Reviewed-by: lagergren, sundar --- .../jdk/nashorn/api/tree/IRTranslator.java | 6 +-- .../internal/codegen/ApplySpecialization.java | 10 ++--- .../internal/codegen/AssignSymbols.java | 8 ++-- .../nashorn/internal/codegen/CacheAst.java | 6 +-- .../internal/codegen/CodeGenerator.java | 13 +++--- .../internal/codegen/CompilationPhase.java | 6 +-- .../internal/codegen/FindScopeDepths.java | 7 ++-- .../internal/codegen/FoldConstants.java | 8 ++-- .../codegen/LocalVariableTypesCalculator.java | 6 +-- .../jdk/nashorn/internal/codegen/Lower.java | 10 ++--- .../codegen/OptimisticTypesCalculator.java | 6 +-- .../internal/codegen/ProgramPoints.java | 9 +--- .../internal/codegen/ReplaceCompileUnits.java | 9 +--- .../nashorn/internal/codegen/Splitter.java | 10 ++--- .../nashorn/internal/ir/debug/JSONWriter.java | 6 +-- .../internal/ir/debug/PrintVisitor.java | 6 +-- .../ir/visitor/NodeOperatorVisitor.java | 2 +- .../ir/visitor/SimpleNodeVisitor.java | 41 +++++++++++++++++++ .../RecompilableScriptFunctionData.java | 7 ++-- 19 files changed, 93 insertions(+), 83 deletions(-) create mode 100644 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/visitor/SimpleNodeVisitor.java diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IRTranslator.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IRTranslator.java index 64592761d8e..44d6276ca07 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IRTranslator.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IRTranslator.java @@ -47,7 +47,6 @@ import jdk.nashorn.internal.ir.IdentNode; import jdk.nashorn.internal.ir.IfNode; import jdk.nashorn.internal.ir.IndexNode; import jdk.nashorn.internal.ir.LabelNode; -import jdk.nashorn.internal.ir.LexicalContext; import jdk.nashorn.internal.ir.LiteralNode; import jdk.nashorn.internal.ir.Node; import jdk.nashorn.internal.ir.ObjectNode; @@ -64,7 +63,7 @@ import jdk.nashorn.internal.ir.UnaryNode; import jdk.nashorn.internal.ir.VarNode; import jdk.nashorn.internal.ir.WhileNode; import jdk.nashorn.internal.ir.WithNode; -import jdk.nashorn.internal.ir.visitor.NodeVisitor; +import jdk.nashorn.internal.ir.visitor.SimpleNodeVisitor; import jdk.nashorn.internal.parser.Lexer; import jdk.nashorn.internal.parser.TokenType; @@ -72,10 +71,9 @@ import jdk.nashorn.internal.parser.TokenType; * This class translates from nashorn IR Node objects * to nashorn parser API Tree objects. */ -final class IRTranslator extends NodeVisitor { +final class IRTranslator extends SimpleNodeVisitor { public IRTranslator() { - super(new LexicalContext()); } // currently translated Statement diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ApplySpecialization.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ApplySpecialization.java index 7616c08a2fc..51abacdbbe6 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ApplySpecialization.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ApplySpecialization.java @@ -41,9 +41,8 @@ import jdk.nashorn.internal.ir.CallNode; import jdk.nashorn.internal.ir.Expression; import jdk.nashorn.internal.ir.FunctionNode; import jdk.nashorn.internal.ir.IdentNode; -import jdk.nashorn.internal.ir.LexicalContext; import jdk.nashorn.internal.ir.Node; -import jdk.nashorn.internal.ir.visitor.NodeVisitor; +import jdk.nashorn.internal.ir.visitor.SimpleNodeVisitor; import jdk.nashorn.internal.objects.Global; import jdk.nashorn.internal.runtime.Context; import jdk.nashorn.internal.runtime.logging.DebugLogger; @@ -81,7 +80,7 @@ import jdk.nashorn.internal.runtime.options.Options; */ @Logger(name="apply2call") -public final class ApplySpecialization extends NodeVisitor implements Loggable { +public final class ApplySpecialization extends SimpleNodeVisitor implements Loggable { private static final boolean USE_APPLY2CALL = Options.getBooleanProperty("nashorn.apply2call", true); @@ -105,7 +104,6 @@ public final class ApplySpecialization extends NodeVisitor imple * @param compiler compiler */ public ApplySpecialization(final Compiler compiler) { - super(new LexicalContext()); this.compiler = compiler; this.log = initLogger(compiler.getContext()); } @@ -138,7 +136,7 @@ public final class ApplySpecialization extends NodeVisitor imple private boolean hasApplies(final FunctionNode functionNode) { try { - functionNode.accept(new NodeVisitor(new LexicalContext()) { + functionNode.accept(new SimpleNodeVisitor() { @Override public boolean enterFunctionNode(final FunctionNode fn) { return fn == functionNode; @@ -172,7 +170,7 @@ public final class ApplySpecialization extends NodeVisitor imple final Deque> stack = new ArrayDeque<>(); //ensure that arguments is only passed as arg to apply - functionNode.accept(new NodeVisitor(new LexicalContext()) { + functionNode.accept(new SimpleNodeVisitor() { private boolean isCurrentArg(final Expression expr) { return !stack.isEmpty() && stack.peek().contains(expr); //args to current apply call diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/AssignSymbols.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/AssignSymbols.java index f59308b5546..73ded48da0c 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/AssignSymbols.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/AssignSymbols.java @@ -67,7 +67,6 @@ import jdk.nashorn.internal.ir.ForNode; import jdk.nashorn.internal.ir.FunctionNode; import jdk.nashorn.internal.ir.IdentNode; import jdk.nashorn.internal.ir.IndexNode; -import jdk.nashorn.internal.ir.LexicalContext; import jdk.nashorn.internal.ir.LexicalContextNode; import jdk.nashorn.internal.ir.LiteralNode; import jdk.nashorn.internal.ir.Node; @@ -81,7 +80,7 @@ import jdk.nashorn.internal.ir.TryNode; import jdk.nashorn.internal.ir.UnaryNode; import jdk.nashorn.internal.ir.VarNode; import jdk.nashorn.internal.ir.WithNode; -import jdk.nashorn.internal.ir.visitor.NodeVisitor; +import jdk.nashorn.internal.ir.visitor.SimpleNodeVisitor; import jdk.nashorn.internal.parser.TokenType; import jdk.nashorn.internal.runtime.Context; import jdk.nashorn.internal.runtime.ECMAErrors; @@ -102,7 +101,7 @@ import jdk.nashorn.internal.runtime.logging.Logger; * visitor. */ @Logger(name="symbols") -final class AssignSymbols extends NodeVisitor implements Loggable { +final class AssignSymbols extends SimpleNodeVisitor implements Loggable { private final DebugLogger log; private final boolean debug; @@ -150,7 +149,6 @@ final class AssignSymbols extends NodeVisitor implements Loggabl private final boolean isOnDemand; public AssignSymbols(final Compiler compiler) { - super(new LexicalContext()); this.compiler = compiler; this.log = initLogger(compiler.getContext()); this.debug = log.isEnabled(); @@ -187,7 +185,7 @@ final class AssignSymbols extends NodeVisitor implements Loggabl */ private void acceptDeclarations(final FunctionNode functionNode, final Block body) { // This visitor will assign symbol to all declared variables. - body.accept(new NodeVisitor(new LexicalContext()) { + body.accept(new SimpleNodeVisitor() { @Override protected boolean enterDefault(final Node node) { // Don't bother visiting expressions; var is a statement, it can't be inside an expression. diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CacheAst.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CacheAst.java index 5ecf4e692fd..6f66ea34c2c 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CacheAst.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CacheAst.java @@ -29,19 +29,17 @@ import java.util.ArrayDeque; import java.util.Collections; import java.util.Deque; import jdk.nashorn.internal.ir.FunctionNode; -import jdk.nashorn.internal.ir.LexicalContext; import jdk.nashorn.internal.ir.Node; import jdk.nashorn.internal.ir.Statement; -import jdk.nashorn.internal.ir.visitor.NodeVisitor; +import jdk.nashorn.internal.ir.visitor.SimpleNodeVisitor; import jdk.nashorn.internal.runtime.RecompilableScriptFunctionData; -class CacheAst extends NodeVisitor { +class CacheAst extends SimpleNodeVisitor { private final Deque dataStack = new ArrayDeque<>(); private final Compiler compiler; CacheAst(final Compiler compiler) { - super(new LexicalContext()); this.compiler = compiler; assert !compiler.isOnDemandCompilation(); } diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java index a28d1093594..d1cadc83cef 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java @@ -129,7 +129,7 @@ import jdk.nashorn.internal.ir.VarNode; import jdk.nashorn.internal.ir.WhileNode; import jdk.nashorn.internal.ir.WithNode; import jdk.nashorn.internal.ir.visitor.NodeOperatorVisitor; -import jdk.nashorn.internal.ir.visitor.NodeVisitor; +import jdk.nashorn.internal.ir.visitor.SimpleNodeVisitor; import jdk.nashorn.internal.objects.Global; import jdk.nashorn.internal.parser.Lexer.RegexToken; import jdk.nashorn.internal.parser.TokenType; @@ -1433,8 +1433,7 @@ final class CodeGenerator extends NodeOperatorVisitor(new LexicalContext()) { - + function.accept(new SimpleNodeVisitor() { private MethodEmitter sharedScopeCall(final IdentNode identNode, final int flags) { final Symbol symbol = identNode.getSymbol(); final boolean isFastScope = isFastScope(symbol); @@ -2461,7 +2460,7 @@ final class CodeGenerator extends NodeOperatorVisitor(new LexicalContext()) { + value.accept(new SimpleNodeVisitor() { @Override public boolean enterFunctionNode(final FunctionNode functionNode) { return false; @@ -2799,7 +2798,7 @@ final class CodeGenerator extends NodeOperatorVisitor(new LexicalContext()) { + rootExpr.accept(new SimpleNodeVisitor() { @Override public boolean enterFunctionNode(final FunctionNode functionNode) { return false; @@ -4347,7 +4346,7 @@ final class CodeGenerator extends NodeOperatorVisitor(new LexicalContext()) { + target.accept(new SimpleNodeVisitor() { @Override public boolean enterIdentNode(final IdentNode node) { if (node.getSymbol().isScope()) { @@ -4446,7 +4445,7 @@ final class CodeGenerator extends NodeOperatorVisitor(new LexicalContext()) { + target.accept(new SimpleNodeVisitor() { @Override protected boolean enterDefault(final Node node) { throw new AssertionError("Unexpected node " + node + " in store epilogue"); diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompilationPhase.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompilationPhase.java index 2e153b119c2..d9e111e5fe1 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompilationPhase.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompilationPhase.java @@ -36,13 +36,13 @@ import java.util.Set; import jdk.nashorn.internal.codegen.Compiler.CompilationPhases; import jdk.nashorn.internal.ir.Block; import jdk.nashorn.internal.ir.FunctionNode; -import jdk.nashorn.internal.ir.LexicalContext; import jdk.nashorn.internal.ir.LiteralNode; import jdk.nashorn.internal.ir.Node; import jdk.nashorn.internal.ir.Symbol; import jdk.nashorn.internal.ir.debug.ASTWriter; import jdk.nashorn.internal.ir.debug.PrintVisitor; import jdk.nashorn.internal.ir.visitor.NodeVisitor; +import jdk.nashorn.internal.ir.visitor.SimpleNodeVisitor; import jdk.nashorn.internal.runtime.CodeInstaller; import jdk.nashorn.internal.runtime.RecompilableScriptFunctionData; import jdk.nashorn.internal.runtime.ScriptEnvironment; @@ -118,7 +118,7 @@ abstract class CompilationPhase { FunctionNode newFunctionNode; //ensure elementTypes, postsets and presets exist for splitter and arraynodes - newFunctionNode = transformFunction(fn, new NodeVisitor(new LexicalContext()) { + newFunctionNode = transformFunction(fn, new SimpleNodeVisitor() { @Override public LiteralNode leaveLiteralNode(final LiteralNode literalNode) { return literalNode.initialize(lc); @@ -222,7 +222,7 @@ abstract class CompilationPhase { // correctness, it's just an optimization -- runtime type calculation is not used when the compilation // is not an on-demand optimistic compilation, so we can skip locals marking then. if (compiler.useOptimisticTypes() && compiler.isOnDemandCompilation()) { - fn.getBody().accept(new NodeVisitor(new LexicalContext()) { + fn.getBody().accept(new SimpleNodeVisitor() { @Override public boolean enterFunctionNode(final FunctionNode functionNode) { // OTOH, we must not declare symbols from nested functions to be locals. As we're doing on-demand diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FindScopeDepths.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FindScopeDepths.java index da35d50e02a..40c529a8d71 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FindScopeDepths.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FindScopeDepths.java @@ -39,7 +39,7 @@ import jdk.nashorn.internal.ir.LexicalContext; import jdk.nashorn.internal.ir.Node; import jdk.nashorn.internal.ir.Symbol; import jdk.nashorn.internal.ir.WithNode; -import jdk.nashorn.internal.ir.visitor.NodeVisitor; +import jdk.nashorn.internal.ir.visitor.SimpleNodeVisitor; import jdk.nashorn.internal.runtime.Context; import jdk.nashorn.internal.runtime.RecompilableScriptFunctionData; import jdk.nashorn.internal.runtime.logging.DebugLogger; @@ -53,7 +53,7 @@ import jdk.nashorn.internal.runtime.logging.Logger; * FunctionNode being compiled */ @Logger(name="scopedepths") -final class FindScopeDepths extends NodeVisitor implements Loggable { +final class FindScopeDepths extends SimpleNodeVisitor implements Loggable { private final Compiler compiler; private final Map> fnIdToNestedFunctions = new HashMap<>(); @@ -66,7 +66,6 @@ final class FindScopeDepths extends NodeVisitor implements Logga private int dynamicScopeCount; FindScopeDepths(final Compiler compiler) { - super(new LexicalContext()); this.compiler = compiler; this.log = initLogger(compiler.getContext()); } @@ -273,7 +272,7 @@ final class FindScopeDepths extends NodeVisitor implements Logga //get all symbols that are referenced inside this function body final Set symbols = new HashSet<>(); - block.accept(new NodeVisitor(new LexicalContext()) { + block.accept(new SimpleNodeVisitor() { @Override public boolean enterIdentNode(final IdentNode identNode) { final Symbol symbol = identNode.getSymbol(); diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FoldConstants.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FoldConstants.java index 540935c914d..e72ea0362f4 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FoldConstants.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FoldConstants.java @@ -38,7 +38,6 @@ import jdk.nashorn.internal.ir.EmptyNode; import jdk.nashorn.internal.ir.Expression; import jdk.nashorn.internal.ir.FunctionNode; import jdk.nashorn.internal.ir.IfNode; -import jdk.nashorn.internal.ir.LexicalContext; import jdk.nashorn.internal.ir.LiteralNode; import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode; import jdk.nashorn.internal.ir.Node; @@ -47,7 +46,7 @@ import jdk.nashorn.internal.ir.SwitchNode; import jdk.nashorn.internal.ir.TernaryNode; import jdk.nashorn.internal.ir.UnaryNode; import jdk.nashorn.internal.ir.VarNode; -import jdk.nashorn.internal.ir.visitor.NodeVisitor; +import jdk.nashorn.internal.ir.visitor.SimpleNodeVisitor; import jdk.nashorn.internal.runtime.Context; import jdk.nashorn.internal.runtime.JSType; import jdk.nashorn.internal.runtime.ScriptRuntime; @@ -59,12 +58,11 @@ import jdk.nashorn.internal.runtime.logging.Logger; * Simple constant folding pass, executed before IR is starting to be lowered. */ @Logger(name="fold") -final class FoldConstants extends NodeVisitor implements Loggable { +final class FoldConstants extends SimpleNodeVisitor implements Loggable { private final DebugLogger log; FoldConstants(final Compiler compiler) { - super(new LexicalContext()); this.log = initLogger(compiler.getContext()); } @@ -194,7 +192,7 @@ final class FoldConstants extends NodeVisitor implements Loggabl * initializers removed. */ static void extractVarNodesFromDeadCode(final Node deadCodeRoot, final List statements) { - deadCodeRoot.accept(new NodeVisitor(new LexicalContext()) { + deadCodeRoot.accept(new SimpleNodeVisitor() { @Override public boolean enterVarNode(final VarNode varNode) { statements.add(varNode.setInit(null)); diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java index afafd3e88ba..8195b76b3fe 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java @@ -87,6 +87,7 @@ import jdk.nashorn.internal.ir.VarNode; import jdk.nashorn.internal.ir.WhileNode; import jdk.nashorn.internal.ir.WithNode; import jdk.nashorn.internal.ir.visitor.NodeVisitor; +import jdk.nashorn.internal.ir.visitor.SimpleNodeVisitor; import jdk.nashorn.internal.parser.TokenType; /** @@ -105,7 +106,7 @@ import jdk.nashorn.internal.parser.TokenType; * instances of the calculator to be run on nested functions (when not lazy compiling). * */ -final class LocalVariableTypesCalculator extends NodeVisitor{ +final class LocalVariableTypesCalculator extends SimpleNodeVisitor { private static class JumpOrigin { final JoinPredecessor node; @@ -425,7 +426,6 @@ final class LocalVariableTypesCalculator extends NodeVisitor{ private final Deque