From 9f0e9954f9015672d0abd93740d9e20c877b0d47 Mon Sep 17 00:00:00 2001 From: Vadim Pakhnushev Date: Wed, 27 May 2015 14:42:58 +0300 Subject: [PATCH 01/70] 8079652: Could not enable D3D pipeline Reviewed-by: prr, serb --- .../windows/native/libawt/java2d/d3d/D3DPipelineManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DPipelineManager.cpp b/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DPipelineManager.cpp index ac9870189bd..11792b1c705 100644 --- a/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DPipelineManager.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DPipelineManager.cpp @@ -828,7 +828,7 @@ HWND D3DPipelineManager::CreateDefaultFocusWindow() return 0; } - HWND hWnd = CreateWindow(L"D3DFocusWindow", L"D3DFocusWindow", 0, + HWND hWnd = CreateWindow(L"D3DFocusWindow", L"D3DFocusWindow", WS_POPUP, mi.rcMonitor.left, mi.rcMonitor.top, 1, 1, NULL, NULL, GetModuleHandle(NULL), NULL); if (hWnd == 0) { From 44af11b7a328f63d24b42e70d6e90b826fe8c5d5 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Sat, 23 May 2015 15:13:40 +0300 Subject: [PATCH 02/70] 8061831: [OGL] "java.lang.InternalError: not implemented yet" during the blit of VI to VI in xor mode Reviewed-by: flar, bae --- .../sun/java2d/opengl/OGLBlitLoops.java | 64 +++++-- .../IncorrectClipXorModeSurface2Surface.java | 178 ++++++++++++++++++ 2 files changed, 226 insertions(+), 16 deletions(-) create mode 100644 jdk/test/java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLBlitLoops.java b/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLBlitLoops.java index 88d2c8f9221..272f82ac237 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLBlitLoops.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLBlitLoops.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, 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 @@ -59,6 +59,10 @@ final class OGLBlitLoops { TransformBlit transformBlitIntArgbPreToSurface = new OGLSwToSurfaceTransform(SurfaceType.IntArgbPre, OGLSurfaceData.PF_INT_ARGB_PRE); + OGLSurfaceToSwBlit blitSurfaceToIntArgbPre = + new OGLSurfaceToSwBlit(SurfaceType.IntArgbPre, + OGLSurfaceData.PF_INT_ARGB_PRE); + GraphicsPrimitive[] primitives = { // surface->surface ops new OGLSurfaceToSurfaceBlit(), @@ -73,8 +77,7 @@ final class OGLBlitLoops { // surface->sw ops new OGLSurfaceToSwBlit(SurfaceType.IntArgb, OGLSurfaceData.PF_INT_ARGB), - new OGLSurfaceToSwBlit(SurfaceType.IntArgbPre, - OGLSurfaceData.PF_INT_ARGB_PRE), + blitSurfaceToIntArgbPre, // sw->surface ops blitIntArgbPreToSurface, @@ -102,7 +105,14 @@ final class OGLBlitLoops { CompositeType.AnyAlpha, blitIntArgbPreToSurface), - new OGLAnyCompositeBlit(), + new OGLAnyCompositeBlit(OGLSurfaceData.OpenGLSurface, + blitSurfaceToIntArgbPre, + blitSurfaceToIntArgbPre, + blitIntArgbPreToSurface), + new OGLAnyCompositeBlit(SurfaceType.Any, + null, + blitSurfaceToIntArgbPre, + blitIntArgbPreToSurface), new OGLSwToSurfaceScale(SurfaceType.IntRgb, OGLSurfaceData.PF_INT_RGB), @@ -869,11 +879,26 @@ final class OGLGeneralTransformedBlit extends TransformBlit { } } +/** + * This general OGLAnyCompositeBlit implementation can convert any source/target + * surface to an intermediate surface using convertsrc/convertdst loops, applies + * necessary composite operation, and then uses convertresult loop to get the + * intermediate surface down to OpenGL. + */ final class OGLAnyCompositeBlit extends Blit { - private WeakReference dstTmp; - OGLAnyCompositeBlit() { - super(SurfaceType.Any, CompositeType.Any, OGLSurfaceData.OpenGLSurface); + private WeakReference dstTmp; + private WeakReference srcTmp; + private final Blit convertsrc; + private final Blit convertdst; + private final Blit convertresult; + + OGLAnyCompositeBlit(SurfaceType srctype, Blit convertsrc, Blit convertdst, + Blit convertresult) { + super(srctype, CompositeType.Any, OGLSurfaceData.OpenGLSurface); + this.convertsrc = convertsrc; + this.convertdst = convertdst; + this.convertresult = convertresult; } public synchronized void Blit(SurfaceData src, SurfaceData dst, @@ -881,9 +906,20 @@ final class OGLAnyCompositeBlit extends Blit { int sx, int sy, int dx, int dy, int w, int h) { - Blit convertdst = Blit.getFromCache(dst.getSurfaceType(), - CompositeType.SrcNoEa, - SurfaceType.IntArgbPre); + if (convertsrc != null) { + SurfaceData cachedSrc = null; + if (srcTmp != null) { + // use cached intermediate surface, if available + cachedSrc = srcTmp.get(); + } + // convert source to IntArgbPre + src = convertFrom(convertsrc, src, sx, sy, w, h, cachedSrc, + BufferedImage.TYPE_INT_ARGB_PRE); + if (src != cachedSrc) { + // cache the intermediate surface + srcTmp = new WeakReference<>(src); + } + } SurfaceData cachedDst = null; @@ -906,12 +942,8 @@ final class OGLAnyCompositeBlit extends Blit { // cache the intermediate surface dstTmp = new WeakReference<>(dstBuffer); } - // now blit the buffer back to the destination - convertdst = Blit.getFromCache(dstBuffer.getSurfaceType(), - CompositeType.SrcNoEa, - dst.getSurfaceType()); - convertdst.Blit(dstBuffer, dst, AlphaComposite.Src, - clip, 0, 0, dx, dy, w, h); + convertresult.Blit(dstBuffer, dst, AlphaComposite.Src, clip, 0, 0, dx, + dy, w, h); } } diff --git a/jdk/test/java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java b/jdk/test/java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java new file mode 100644 index 00000000000..8a9b1bd1ae7 --- /dev/null +++ b/jdk/test/java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java @@ -0,0 +1,178 @@ +/* + * 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.Color; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsEnvironment; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.Shape; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; +import java.awt.image.VolatileImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import static java.awt.geom.Rectangle2D.Double; + +/** + * @test + * @bug 8061831 + * @summary Tests drawing volatile image to volatile image using different + * clips + xor mode. Results of the blit compatibleImage to + * compatibleImage is used for comparison. + */ +public final class IncorrectClipXorModeSurface2Surface { + + private static int[] SIZES = {2, 10, 100}; + private static final Shape[] SHAPES = { + new Rectangle(0, 0, 0, 0), + new Rectangle(0, 0, 1, 1), + new Rectangle(0, 1, 1, 1), + new Rectangle(1, 0, 1, 1), + new Rectangle(1, 1, 1, 1), + + new Double(0, 0, 0.5, 0.5), + new Double(0, 0.5, 0.5, 0.5), + new Double(0.5, 0, 0.5, 0.5), + new Double(0.5, 0.5, 0.5, 0.5), + new Double(0.25, 0.25, 0.5, 0.5), + new Double(0, 0.25, 1, 0.5), + new Double(0.25, 0, 0.5, 1), + + new Double(.10, .10, .20, .20), + new Double(.75, .75, .20, .20), + new Double(.75, .10, .20, .20), + new Double(.10, .75, .20, .20), + }; + + public static void main(final String[] args) throws IOException { + GraphicsEnvironment ge = GraphicsEnvironment + .getLocalGraphicsEnvironment(); + GraphicsConfiguration gc = ge.getDefaultScreenDevice() + .getDefaultConfiguration(); + AffineTransform at; + for (int size : SIZES) { + at = AffineTransform.getScaleInstance(size, size); + for (Shape clip : SHAPES) { + clip = at.createTransformedShape(clip); + for (Shape to : SHAPES) { + to = at.createTransformedShape(to); + // Prepare test images + BufferedImage snapshot; + VolatileImage source = getVolatileImage(gc, size); + VolatileImage target = getVolatileImage(gc, size); + int attempt = 0; + while (true) { + if (++attempt > 10) { + throw new RuntimeException("Too many attempts: " + attempt); + } + // Prepare source images + source.validate(gc); + Graphics2D g2d = source.createGraphics(); + g2d.setColor(Color.RED); + g2d.fillRect(0, 0, size, size); + g2d.dispose(); + if (source.validate(gc) != VolatileImage.IMAGE_OK) { + continue; + } + // Prepare target images + target.validate(gc); + g2d = target.createGraphics(); + g2d.setColor(Color.GREEN); + g2d.fillRect(0, 0, size, size); + g2d.dispose(); + if (target.validate(gc) != VolatileImage.IMAGE_OK) { + continue; + } + + draw(clip, to, source, target); + snapshot = target.getSnapshot(); + if (source.contentsLost() || target.contentsLost()) { + continue; + } + break; + } + // Prepare gold images + BufferedImage goldS = getSourceGold(gc, size); + BufferedImage goldT = getTargetGold(gc, size); + draw(clip, to, goldS, goldT); + validate(snapshot, goldT); + source.flush(); + target.flush(); + } + } + } + } + + private static void draw(Shape clip, Shape shape, Image from, Image to) { + Graphics2D g2d = (Graphics2D) to.getGraphics(); + g2d.setXORMode(Color.BLACK); + g2d.setClip(clip); + Rectangle toBounds = shape.getBounds(); + g2d.drawImage(from, toBounds.x, toBounds.y, toBounds.width, + toBounds.height, null); + g2d.dispose(); + } + + private static BufferedImage getSourceGold(GraphicsConfiguration gc, + int size) { + final BufferedImage bi = gc.createCompatibleImage(size, size); + Graphics2D g2d = bi.createGraphics(); + g2d.setColor(Color.RED); + g2d.fillRect(0, 0, size, size); + g2d.dispose(); + return bi; + } + + private static BufferedImage getTargetGold(GraphicsConfiguration gc, + int size) { + BufferedImage image = gc.createCompatibleImage(size, size); + Graphics2D g2d = image.createGraphics(); + g2d.setColor(Color.GREEN); + g2d.fillRect(0, 0, size, size); + g2d.dispose(); + return image; + } + + private static VolatileImage getVolatileImage(GraphicsConfiguration gc, + int size) { + return gc.createCompatibleVolatileImage(size, size); + } + + private static void validate(BufferedImage bi, BufferedImage goldbi) + throws IOException { + for (int x = 0; x < bi.getWidth(); ++x) { + for (int y = 0; y < bi.getHeight(); ++y) { + if (goldbi.getRGB(x, y) != bi.getRGB(x, y)) { + ImageIO.write(bi, "png", new File("actual.png")); + ImageIO.write(goldbi, "png", new File("expected.png")); + throw new RuntimeException("Test failed."); + } + } + } + } +} From 4dc4dd721eff3de6987c9769c8e606cbd7c2c785 Mon Sep 17 00:00:00 2001 From: Anton Nashatyrev Date: Thu, 28 May 2015 21:17:49 +0300 Subject: [PATCH 03/70] 8041470: JButtons stay pressed after they have lost focus if you use the mouse wheel Reviewed-by: azvegint, alexp --- .../unix/classes/sun/awt/X11/XWindow.java | 21 ++- .../WheelModifier/WheelModifier.java | 132 ++++++++++++++++++ 2 files changed, 140 insertions(+), 13 deletions(-) create mode 100644 jdk/test/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java 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 77d8096cf71..7ba27919fd8 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,10 +572,6 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { } static int getModifiers(int state, int button, int keyCode) { - return getModifiers(state, button, keyCode, 0, false); - } - - static int getModifiers(int state, int button, int keyCode, int type, boolean wheel_mouse) { int modifiers = 0; if (((state & XConstants.ShiftMask) != 0) ^ (keyCode == KeyEvent.VK_SHIFT)) { @@ -606,7 +602,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 (!wheel_mouse) { + if (!isWheel(XConstants.buttons[i])) { modifiers |= InputEvent.getMaskForButton(i+1); } } @@ -614,6 +610,11 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { return modifiers; } + static boolean isWheel(int button) { + // 4 and 5 buttons are usually considered assigned to a first wheel + return button == XConstants.buttons[3] || button == XConstants.buttons[4]; + } + static int getXModifiers(AWTKeyStroke stroke) { int mods = stroke.getModifiers(); int res = 0; @@ -653,7 +654,6 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { int modifiers; boolean popupTrigger = false; int button=0; - boolean wheel_mouse = false; int lbutton = xbe.get_button(); /* * Ignore the buttons above 20 due to the bit limit for @@ -706,11 +706,6 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { } button = XConstants.buttons[lbutton - 1]; - // 4 and 5 buttons are usually considered assigned to a first wheel - if (lbutton == XConstants.buttons[3] || - lbutton == XConstants.buttons[4]) { - wheel_mouse = true; - } // mapping extra buttons to numbers starting from 4. if ((button > XConstants.buttons[4]) && (!Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled())){ @@ -720,9 +715,9 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { if (button > XConstants.buttons[4]){ button -= 2; } - modifiers = getModifiers(xbe.get_state(),button,0, type, wheel_mouse); + modifiers = getModifiers(xbe.get_state(),button,0); - if (!wheel_mouse) { + if (!isWheel(lbutton)) { MouseEvent me = new MouseEvent(getEventSource(), type == XConstants.ButtonPress ? MouseEvent.MOUSE_PRESSED : MouseEvent.MOUSE_RELEASED, jWhen,modifiers, x, y, diff --git a/jdk/test/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java b/jdk/test/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java new file mode 100644 index 00000000000..28fd50a2664 --- /dev/null +++ b/jdk/test/java/awt/event/MouseWheelEvent/WheelModifier/WheelModifier.java @@ -0,0 +1,132 @@ +/* + * 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 8041470 + @summary JButtons stay pressed after they have lost focus if you use the mouse wheel + @author Anton Nashatyrev +*/ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; +import java.util.concurrent.CountDownLatch; + +public class WheelModifier { + + JFrame f; + JButton fb; + + CountDownLatch pressSema = new CountDownLatch(1); + CountDownLatch exitSema = new CountDownLatch(1); + CountDownLatch releaseSema = new CountDownLatch(1); + volatile CountDownLatch wheelSema; + + void createGui() { + f = new JFrame("frame"); + fb = new JButton("frame_button"); + fb.addMouseListener(new MouseAdapter() { + @Override + public void mouseReleased(MouseEvent e) { + System.out.println("WheelModifier.mouseReleased: " + e); + releaseSema.countDown(); + } + + @Override + public void mouseEntered(MouseEvent e) { + System.out.println("WheelModifier.mouseEntered: " + e); + + } + + @Override + public void mouseExited(MouseEvent e) { + System.out.println("WheelModifier.mouseExited: " + e); + exitSema.countDown(); + } + + @Override + public void mousePressed(MouseEvent e) { + System.out.println("WheelModifier.mousePressed: " + e); + pressSema.countDown(); + } + + @Override + public void mouseDragged(MouseEvent e) { + System.out.println("WheelModifier.mouseDragged: " + e); + } + }); + + Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() { + @Override + public void eventDispatched(AWTEvent event) { + System.out.println("WheelModifier.mouseWheel: " + event); + wheelSema.countDown(); + } + }, MouseEvent.MOUSE_WHEEL_EVENT_MASK); + + f.setLayout(new FlowLayout()); + f.add(fb); + f.setSize(200, 200); + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + f.setVisible(true); + } + + void run() throws Exception { + Robot r = new Robot(); + r.waitForIdle(); + System.out.println("# Started"); + + Point sLoc = fb.getLocationOnScreen(); + Dimension bSize = fb.getSize(); + r.mouseMove(sLoc.x + bSize.width / 2, sLoc.y + bSize.height / 2); + r.mousePress(MouseEvent.BUTTON1_MASK); + pressSema.await(); + System.out.println("# Pressed"); + + r.mouseMove(sLoc.x + bSize.width / 2, sLoc.y + bSize.height * 2); + exitSema.await(); + System.out.println("# Exited"); + + wheelSema = new CountDownLatch(1); + r.mouseWheel(1); + wheelSema.await(); + System.out.println("# Wheeled 1"); + + wheelSema = new CountDownLatch(1); + r.mouseWheel(-1); + wheelSema.await(); + System.out.println("# Wheeled 2"); + + r.mouseRelease(MouseEvent.BUTTON1_MASK); + releaseSema.await(); + System.out.println("# Released!"); + } + + public static void main(String[] args) throws Exception { + WheelModifier test = new WheelModifier(); + + SwingUtilities.invokeAndWait(() -> test.createGui()); + test.run(); + + System.out.println("Done."); + } +} From 69e03ffa3545126ca9c48d0dde9e321d7fb03b77 Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Fri, 29 May 2015 08:58:46 +0900 Subject: [PATCH 04/70] 8081295: Build failed with GCC 5.1.1 Array bounds and incorrect condition warnings happen with GCC 5.1.1 Reviewed-by: azvegint --- jdk/make/lib/Awt2dLibraries.gmk | 4 ++-- jdk/src/jdk.jdwp.agent/share/native/libjdwp/eventFilter.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index 177fe2ad594..aab1add5f48 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -54,7 +54,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE, \ OPTIMIZATION := HIGHEST, \ CFLAGS := $(CFLAGS_JDKLIB) \ $(BUILD_LIBMLIB_CFLAGS), \ - DISABLED_WARNINGS_gcc := parentheses, \ + DISABLED_WARNINGS_gcc := parentheses array-bounds, \ DISABLED_WARNINGS_clang := parentheses, \ DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \ MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \ @@ -494,7 +494,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \ CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJAVAJPEG_SRC)) \ $(LIBJAVA_HEADER_FLAGS) \ -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \ - DISABLED_WARNINGS_gcc := clobbered parentheses, \ + DISABLED_WARNINGS_gcc := clobbered parentheses array-bounds, \ DISABLED_WARNINGS_clang := logical-op-parentheses, \ DISABLED_WARNINGS_microsoft := 4267, \ MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \ diff --git a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/eventFilter.c b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/eventFilter.c index d3eeb4d077c..9d9adf32e79 100644 --- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/eventFilter.c +++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/eventFilter.c @@ -518,8 +518,8 @@ eventFilterRestricted_passesFilter(JNIEnv *env, case JDWP_REQUEST_MODIFIER(SourceNameMatch): { char* desiredNamePattern = filter->u.SourceNameOnly.sourceNamePattern; - if (!searchAllSourceNames(env, clazz, - desiredNamePattern) == 1) { + if (searchAllSourceNames(env, clazz, + desiredNamePattern) != 1) { /* The name isn't in the SDE; try the sourceName in the ref * type */ From f5800b1a9c76d4e0e7ab55a84e766cb65b325de9 Mon Sep 17 00:00:00 2001 From: Andrew Brygin Date: Fri, 29 May 2015 18:32:58 +0300 Subject: [PATCH 05/70] 8023794: [macosx] LCD Rendering hints seems not working without FRACTIONALMETRICS=ON Reviewed-by: serb, prr --- .../classes/sun/lwawt/macosx/LWCToolkit.java | 3 +- .../native/libawt_lwawt/font/AWTStrike.m | 29 ++-- .../native/libawt_lwawt/font/CGGlyphImages.m | 126 ++++++++++++------ .../sun/java2d/opengl/OGLSurfaceData.java | 19 ++- .../native/common/java2d/opengl/OGLContext.c | 2 +- .../common/java2d/opengl/OGLTextRenderer.c | 123 +++-------------- 6 files changed, 135 insertions(+), 167 deletions(-) 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 e2dcd71733b..0188339093e 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 @@ -370,8 +370,7 @@ public final class LWCToolkit extends LWToolkit { protected void initializeDesktopProperties() { super.initializeDesktopProperties(); Map fontHints = new HashMap<>(); - fontHints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - fontHints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + fontHints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); desktopProperties.put(SunToolkit.DESKTOPFONTHINTS, fontHints); desktopProperties.put("awt.mouse.numButtons", BUTTONS); diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/AWTStrike.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/AWTStrike.m index 2a4a2806c78..e55a267d5fe 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/AWTStrike.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/AWTStrike.m @@ -311,21 +311,26 @@ JNF_COCOA_ENTER(env); jlong *glyphInfos = (*env)->GetPrimitiveArrayCritical(env, glyphInfoLongArray, NULL); - if (glyphInfos != NULL) { - jint *rawGlyphCodes = + + jint *rawGlyphCodes = (*env)->GetPrimitiveArrayCritical(env, glyphCodes, NULL); - - if (rawGlyphCodes != NULL) { + @try { + if (rawGlyphCodes != NULL && glyphInfos != NULL) { CGGlyphImages_GetGlyphImagePtrs(glyphInfos, awtStrike, - rawGlyphCodes, len); - - (*env)->ReleasePrimitiveArrayCritical(env, glyphCodes, - rawGlyphCodes, JNI_ABORT); + rawGlyphCodes, len); + } + } + @finally { + if (rawGlyphCodes != NULL) { + (*env)->ReleasePrimitiveArrayCritical(env, glyphCodes, + rawGlyphCodes, JNI_ABORT); + } + if (glyphInfos != NULL) { + // Do not use JNI_COMMIT, as that will not free the buffer copy + // when +ProtectJavaHeap is on. + (*env)->ReleasePrimitiveArrayCritical(env, glyphInfoLongArray, + glyphInfos, 0); } - // Do not use JNI_COMMIT, as that will not free the buffer copy - // when +ProtectJavaHeap is on. - (*env)->ReleasePrimitiveArrayCritical(env, glyphInfoLongArray, - glyphInfos, 0); } JNF_COCOA_EXIT(env); diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m index 1901c1fc5cb..c1dd6eb59c8 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m @@ -195,19 +195,40 @@ DUMP_GLYPHINFO(const GlyphInfo *info) #pragma mark --- Font Rendering Mode Descriptors --- +static Int32 reverseGamma = 0; + +static UInt8 reverseGammaLut[256] = { 0 }; + +static inline UInt8* getReverseGammaLut() { + if (reverseGamma == 0) { + // initialize gamma lut + double gamma; + const char* pGammaEnv = getenv("J2D_LCD_REVERSE_GAMMA"); + if (pGammaEnv != NULL) { + reverseGamma = atol(pGammaEnv); + } + + if (reverseGamma < 100 || reverseGamma > 250) { + reverseGamma = 180; + } + + gamma = 100.0 / reverseGamma; + for (int i = 0; i < 256; i++) { + double x = ((double)i) / 255.0; + reverseGammaLut[i] = (UInt8)(255 * pow(x, gamma)); + } + } + return reverseGammaLut; +} static inline void CGGI_CopyARGBPixelToRGBPixel(const UInt32 p, UInt8 *dst) { -#if __LITTLE_ENDIAN__ - *(dst + 2) = 0xFF - (p >> 24 & 0xFF); - *(dst + 1) = 0xFF - (p >> 16 & 0xFF); - *(dst) = 0xFF - (p >> 8 & 0xFF); -#else - *(dst) = 0xFF - (p >> 16 & 0xFF); - *(dst + 1) = 0xFF - (p >> 8 & 0xFF); - *(dst + 2) = 0xFF - (p & 0xFF); -#endif + UInt8* lut = getReverseGammaLut(); + + *(dst + 0) = lut[0xFF - (p >> 16 & 0xFF)]; // red + *(dst + 1) = lut[0xFF - (p >> 8 & 0xFF)]; // green + *(dst + 2) = lut[0xFF - (p & 0xFF)]; // blue } static void @@ -222,17 +243,14 @@ CGGI_CopyImageFromCanvasToRGBInfo(CGGI_GlyphCanvas *canvas, GlyphInfo *info) size_t height = info->height; size_t y; + + // fill empty glyph image with black-on-white glyph for (y = 0; y < height; y++) { size_t destRow = y * destRowWidth * 3; size_t srcRow = y * srcRowWidth; size_t x; for (x = 0; x < destRowWidth; x++) { - // size_t x3 = x * 3; - // UInt32 p = src[srcRow + x]; - // dest[destRow + x3] = 0xFF - (p >> 16 & 0xFF); - // dest[destRow + x3 + 1] = 0xFF - (p >> 8 & 0xFF); - // dest[destRow + x3 + 2] = 0xFF - (p & 0xFF); CGGI_CopyARGBPixelToRGBPixel(src[srcRow + x], dest + destRow + x * 3); } @@ -260,13 +278,9 @@ CGGI_CopyImageFromCanvasToRGBInfo(CGGI_GlyphCanvas *canvas, GlyphInfo *info) //} static inline UInt8 -CGGI_ConvertPixelToGreyBit(UInt32 p) +CGGI_ConvertBWPixelToByteGray(UInt32 p) { -#ifdef __LITTLE_ENDIAN__ - return 0xFF - ((p >> 24 & 0xFF) + (p >> 16 & 0xFF) + (p >> 8 & 0xFF)) / 3; -#else - return 0xFF - ((p >> 16 & 0xFF) + (p >> 8 & 0xFF) + (p & 0xFF)) / 3; -#endif + return 0xFF - (((p >> 24 & 0xFF) + (p >> 16 & 0xFF) + (p >> 8 & 0xFF)) / 3); } static void @@ -281,14 +295,15 @@ CGGI_CopyImageFromCanvasToAlphaInfo(CGGI_GlyphCanvas *canvas, GlyphInfo *info) size_t height = info->height; size_t y; + + // fill empty glyph image with black-on-white glyph for (y = 0; y < height; y++) { size_t destRow = y * destRowWidth; size_t srcRow = y * srcRowWidth; - size_t x; for (x = 0; x < destRowWidth; x++) { UInt32 p = src[srcRow + x]; - dest[destRow + x] = CGGI_ConvertPixelToGreyBit(p); + dest[destRow + x] = CGGI_ConvertBWPixelToByteGray(p); } } } @@ -316,13 +331,11 @@ CGGI_GetRenderingMode(const AWTStrike *strike) { CGGI_RenderingMode mode; mode.cgFontMode = strike->fStyle; + NSException *e = nil; switch (strike->fAAStyle) { - case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_DEFAULT: case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_OFF: case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_ON: - case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_GASP: - default: mode.glyphDescriptor = &grey; break; case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_LCD_HRGB: @@ -331,6 +344,17 @@ CGGI_GetRenderingMode(const AWTStrike *strike) case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_LCD_VBGR: mode.glyphDescriptor = &rgb; break; + case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_GASP: + case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_DEFAULT: + default: + /* we expect that text antialiasing hint has been already + * evaluated. Report an error if we get 'unevaluated' hint here. + */ + e = [NSException + exceptionWithName:@"IllegalArgumentException" + reason:@"Invalid hint value" + userInfo:nil]; + @throw e; } return mode; @@ -345,7 +369,8 @@ CGGI_GetRenderingMode(const AWTStrike *strike) */ static inline void CGGI_InitCanvas(CGGI_GlyphCanvas *canvas, - const vImagePixelCount width, const vImagePixelCount height) + const vImagePixelCount width, const vImagePixelCount height, + const CGGI_RenderingMode* mode) { // our canvas is *always* 4-byte ARGB size_t bytesPerRow = width * sizeof(UInt32); @@ -356,19 +381,26 @@ CGGI_InitCanvas(CGGI_GlyphCanvas *canvas, canvas->image->height = height; canvas->image->rowBytes = bytesPerRow; - canvas->image->data = (void *)calloc(byteCount, sizeof(UInt32)); + canvas->image->data = (void *)calloc(byteCount, sizeof(UInt8)); if (canvas->image->data == NULL) { [[NSException exceptionWithName:NSMallocException reason:@"Failed to allocate memory for the buffer which backs the CGContext for glyph strikes." userInfo:nil] raise]; } - CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); + uint32_t bmpInfo = kCGImageAlphaPremultipliedFirst; + if (mode->glyphDescriptor == &rgb) { + bmpInfo |= kCGBitmapByteOrder32Host; + } + + CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); canvas->context = CGBitmapContextCreate(canvas->image->data, width, height, 8, bytesPerRow, colorSpace, - kCGImageAlphaPremultipliedFirst); + bmpInfo); + // set foreground color CGContextSetRGBFillColor(canvas->context, 0.0f, 0.0f, 0.0f, 1.0f); + CGContextSetFontSize(canvas->context, 1); CGContextSaveGState(canvas->context); @@ -404,7 +436,9 @@ CGGI_FreeCanvas(CGGI_GlyphCanvas *canvas) * Quick and easy inline to check if this canvas is big enough. */ static inline void -CGGI_SizeCanvas(CGGI_GlyphCanvas *canvas, const vImagePixelCount width, const vImagePixelCount height, const JRSFontRenderingStyle style) +CGGI_SizeCanvas(CGGI_GlyphCanvas *canvas, const vImagePixelCount width, + const vImagePixelCount height, + const CGGI_RenderingMode* mode) { if (canvas->image != NULL && width < canvas->image->width && @@ -418,8 +452,9 @@ CGGI_SizeCanvas(CGGI_GlyphCanvas *canvas, const vImagePixelCount width, const vI CGGI_FreeCanvas(canvas); CGGI_InitCanvas(canvas, width * CGGI_GLYPH_CANVAS_SLACK, - height * CGGI_GLYPH_CANVAS_SLACK); - JRSFontSetRenderingStyleOnContext(canvas->context, style); + height * CGGI_GLYPH_CANVAS_SLACK, + mode); + JRSFontSetRenderingStyleOnContext(canvas->context, mode->cgFontMode); } /* @@ -443,6 +478,7 @@ CGGI_ClearCanvas(CGGI_GlyphCanvas *canvas, GlyphInfo *info) Pixel_8888 opaqueWhite = { 0xFF, 0xFF, 0xFF, 0xFF }; #endif + // clear canvas background and set foreground color vImageBufferFill_ARGB8888(&canvasRectToClear, opaqueWhite, kvImageNoFlags); } @@ -577,7 +613,7 @@ CGGI_CreateImageForUnicode GlyphInfo *info = CGGI_CreateNewGlyphInfoFrom(advance, bbox, strike, mode); // fix the context size, just in case the substituted character is unexpectedly large - CGGI_SizeCanvas(canvas, info->width, info->height, mode->cgFontMode); + CGGI_SizeCanvas(canvas, info->width, info->height, mode); // align the transform for the real CoreText strike CGContextSetTextMatrix(canvas->context, strike->fAltTx); @@ -653,8 +689,11 @@ CGGI_FillImagesForGlyphsWithSizedCanvas(CGGI_GlyphCanvas *canvas, #endif } -static NSString *threadLocalCanvasKey = - @"Java CoreGraphics Text Renderer Cached Canvas"; +static NSString *threadLocalAACanvasKey = + @"Java CoreGraphics Text Renderer Cached Canvas for AA"; + +static NSString *threadLocalLCDCanvasKey = + @"Java CoreGraphics Text Renderer Cached Canvas for LCD"; /* * This is the maximum length and height times the above slack squared @@ -678,25 +717,28 @@ CGGI_FillImagesForGlyphs(jlong *glyphInfos, const AWTStrike *strike, CGGI_GLYPH_CANVAS_MAX*CGGI_GLYPH_CANVAS_MAX*CGGI_GLYPH_CANVAS_SLACK*CGGI_GLYPH_CANVAS_SLACK) { CGGI_GlyphCanvas *tmpCanvas = [[CGGI_GlyphCanvas alloc] init]; - CGGI_InitCanvas(tmpCanvas, maxWidth, maxHeight); + CGGI_InitCanvas(tmpCanvas, maxWidth, maxHeight, mode); CGGI_FillImagesForGlyphsWithSizedCanvas(tmpCanvas, strike, - mode, glyphInfos, uniChars, - glyphs, len); + mode, glyphInfos, uniChars, + glyphs, len); CGGI_FreeCanvas(tmpCanvas); [tmpCanvas release]; return; } - NSMutableDictionary *threadDict = [[NSThread currentThread] threadDictionary]; - CGGI_GlyphCanvas *canvas = [threadDict objectForKey:threadLocalCanvasKey]; + + NSString* theKey = (mode->glyphDescriptor == &rgb) ? + threadLocalLCDCanvasKey : threadLocalAACanvasKey; + + CGGI_GlyphCanvas *canvas = [threadDict objectForKey:theKey]; if (canvas == nil) { canvas = [[CGGI_GlyphCanvas alloc] init]; - [threadDict setObject:canvas forKey:threadLocalCanvasKey]; + [threadDict setObject:canvas forKey:theKey]; } - CGGI_SizeCanvas(canvas, maxWidth, maxHeight, mode->cgFontMode); + CGGI_SizeCanvas(canvas, maxWidth, maxHeight, mode); CGGI_FillImagesForGlyphsWithSizedCanvas(canvas, strike, mode, glyphInfos, uniChars, glyphs, len); } diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLSurfaceData.java b/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLSurfaceData.java index 42b3f2697c5..253a3df3a73 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLSurfaceData.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLSurfaceData.java @@ -26,6 +26,7 @@ package sun.java2d.opengl; import java.awt.AlphaComposite; +import java.awt.Composite; import java.awt.GraphicsEnvironment; import java.awt.Rectangle; import java.awt.Transparency; @@ -400,8 +401,8 @@ public abstract class OGLSurfaceData extends SurfaceData /** * For now, we can only render LCD text if: * - the fragment shader extension is available, and - * - blending is disabled, and - * - the source color is opaque + * - the source color is opaque, and + * - blending is SrcOverNoEa or disabled * - and the destination is opaque * * Eventually, we could enhance the native OGL text rendering code @@ -411,9 +412,19 @@ public abstract class OGLSurfaceData extends SurfaceData public boolean canRenderLCDText(SunGraphics2D sg2d) { return graphicsConfig.isCapPresent(CAPS_EXT_LCD_SHADER) && - sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY && + sg2d.surfaceData.getTransparency() == Transparency.OPAQUE && sg2d.paintState <= SunGraphics2D.PAINT_OPAQUECOLOR && - sg2d.surfaceData.getTransparency() == Transparency.OPAQUE; + (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY || + (sg2d.compositeState <= SunGraphics2D.COMP_ALPHA && canHandleComposite(sg2d.composite))); + } + + private boolean canHandleComposite(Composite c) { + if (c instanceof AlphaComposite) { + AlphaComposite ac = (AlphaComposite)c; + + return ac.getRule() == AlphaComposite.SRC_OVER && ac.getAlpha() >= 1f; + } + return false; } public void validatePipe(SunGraphics2D sg2d) { diff --git a/jdk/src/java.desktop/share/native/common/java2d/opengl/OGLContext.c b/jdk/src/java.desktop/share/native/common/java2d/opengl/OGLContext.c index a33e201a39a..c2d1972ee6d 100644 --- a/jdk/src/java.desktop/share/native/common/java2d/opengl/OGLContext.c +++ b/jdk/src/java.desktop/share/native/common/java2d/opengl/OGLContext.c @@ -750,7 +750,7 @@ OGLContext_IsLCDShaderSupportAvailable(JNIEnv *env, // finally, check to see if the hardware supports the required number // of texture units j2d_glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &maxTexUnits); - if (maxTexUnits < 4) { + if (maxTexUnits < 2) { J2dRlsTraceLn1(J2D_TRACE_INFO, "OGLContext_IsLCDShaderSupportAvailable: not enough tex units (%d)", maxTexUnits); diff --git a/jdk/src/java.desktop/share/native/common/java2d/opengl/OGLTextRenderer.c b/jdk/src/java.desktop/share/native/common/java2d/opengl/OGLTextRenderer.c index f9c8350bd99..cd6ee6da0e0 100644 --- a/jdk/src/java.desktop/share/native/common/java2d/opengl/OGLTextRenderer.c +++ b/jdk/src/java.desktop/share/native/common/java2d/opengl/OGLTextRenderer.c @@ -275,12 +275,9 @@ OGLTR_AddToGlyphCache(GlyphInfo *glyph, jboolean rgbOrder) * changes, we will modify the "src_adj" value in OGLTR_UpdateLCDTextColor()). * * The "main" function is executed for each "fragment" (or pixel) in the - * glyph image. We have determined that the pow() function can be quite - * slow and it only operates on scalar values, not vectors as we require. - * So instead we build two 3D textures containing gamma (and inverse gamma) - * lookup tables that allow us to approximate a component-wise pow() function - * with a single 3D texture lookup. This approach is at least 2x faster - * than the equivalent pow() calls. + * glyph image. The pow() routine operates on vectors, gives precise results, + * and provides acceptable level of performance, so we use it to perform + * the gamma adjustment. * * The variables involved in the equation can be expressed as follows: * @@ -299,8 +296,8 @@ static const char *lcdTextShaderSource = "uniform vec3 src_adj;" "uniform sampler2D glyph_tex;" "uniform sampler2D dst_tex;" - "uniform sampler3D invgamma_tex;" - "uniform sampler3D gamma_tex;" + "uniform vec3 gamma;" + "uniform vec3 invgamma;" "" "void main(void)" "{" @@ -312,12 +309,12 @@ static const char *lcdTextShaderSource = " }" // load the RGB value from the corresponding destination pixel " vec3 dst_clr = vec3(texture2D(dst_tex, gl_TexCoord[1].st));" - // gamma adjust the dest color using the invgamma LUT - " vec3 dst_adj = vec3(texture3D(invgamma_tex, dst_clr.stp));" + // gamma adjust the dest color + " vec3 dst_adj = pow(dst_clr.rgb, gamma);" // linearly interpolate the three color values " vec3 result = mix(dst_adj, src_adj, glyph_clr);" // gamma re-adjust the resulting color (alpha is always set to 1.0) - " gl_FragColor = vec4(vec3(texture3D(gamma_tex, result.stp)), 1.0);" + " gl_FragColor = vec4(pow(result.rgb, invgamma), 1.0);" "}"; /** @@ -348,10 +345,6 @@ OGLTR_CreateLCDTextProgram() j2d_glUniform1iARB(loc, 0); // texture unit 0 loc = j2d_glGetUniformLocationARB(lcdTextProgram, "dst_tex"); j2d_glUniform1iARB(loc, 1); // texture unit 1 - loc = j2d_glGetUniformLocationARB(lcdTextProgram, "invgamma_tex"); - j2d_glUniform1iARB(loc, 2); // texture unit 2 - loc = j2d_glGetUniformLocationARB(lcdTextProgram, "gamma_tex"); - j2d_glUniform1iARB(loc, 3); // texture unit 3 // "unuse" the program object; it will be re-bound later as needed j2d_glUseProgramObjectARB(0); @@ -360,108 +353,26 @@ OGLTR_CreateLCDTextProgram() } /** - * Initializes a 3D texture object for use as a three-dimensional gamma - * lookup table. Note that the wrap mode is initialized to GL_LINEAR so - * that the table will interpolate adjacent values when the index falls - * somewhere in between. - */ -static GLuint -OGLTR_InitGammaLutTexture() -{ - GLuint lutTextureID; - - j2d_glGenTextures(1, &lutTextureID); - j2d_glBindTexture(GL_TEXTURE_3D, lutTextureID); - j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); - - return lutTextureID; -} - -/** - * Updates the lookup table in the given texture object with the float - * values in the given system memory buffer. Note that we could use - * glTexSubImage3D() when updating the texture after its first - * initialization, but since we're updating the entire table (with - * power-of-two dimensions) and this is a relatively rare event, we'll - * just stick with glTexImage3D(). - */ -static void -OGLTR_UpdateGammaLutTexture(GLuint texID, GLfloat *lut, jint size) -{ - j2d_glBindTexture(GL_TEXTURE_3D, texID); - j2d_glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB8, - size, size, size, 0, GL_RGB, GL_FLOAT, lut); -} - -/** - * (Re)Initializes the gamma lookup table textures. + * (Re)Initializes the gamma related uniforms. * * The given contrast value is an int in the range [100, 250] which we will - * then scale to fit in the range [1.0, 2.5]. We create two LUTs, one - * that essentially calculates pow(x, gamma) and the other calculates - * pow(x, 1/gamma). These values are replicated in all three dimensions, so - * given a single 3D texture coordinate (typically this will be a triplet - * in the form (r,g,b)), the 3D texture lookup will return an RGB triplet: - * - * (pow(r,g), pow(y,g), pow(z,g) - * - * where g is either gamma or 1/gamma, depending on the table. + * then scale to fit in the range [1.0, 2.5]. */ static jboolean OGLTR_UpdateLCDTextContrast(jint contrast) { - double gamma = ((double)contrast) / 100.0; - double ig = gamma; - double g = 1.0 / ig; - GLfloat lut[LUT_EDGE][LUT_EDGE][LUT_EDGE][3]; - GLfloat invlut[LUT_EDGE][LUT_EDGE][LUT_EDGE][3]; - int min = 0; - int max = LUT_EDGE - 1; - int x, y, z; + double g = ((double)contrast) / 100.0; + double ig = 1.0 / g; + GLint loc; J2dTraceLn1(J2D_TRACE_INFO, "OGLTR_UpdateLCDTextContrast: contrast=%d", contrast); - for (z = min; z <= max; z++) { - double zval = ((double)z) / max; - GLfloat gz = (GLfloat)pow(zval, g); - GLfloat igz = (GLfloat)pow(zval, ig); + loc = j2d_glGetUniformLocationARB(lcdTextProgram, "gamma"); + j2d_glUniform3fARB(loc, g, g, g); - for (y = min; y <= max; y++) { - double yval = ((double)y) / max; - GLfloat gy = (GLfloat)pow(yval, g); - GLfloat igy = (GLfloat)pow(yval, ig); - - for (x = min; x <= max; x++) { - double xval = ((double)x) / max; - GLfloat gx = (GLfloat)pow(xval, g); - GLfloat igx = (GLfloat)pow(xval, ig); - - lut[z][y][x][0] = gx; - lut[z][y][x][1] = gy; - lut[z][y][x][2] = gz; - - invlut[z][y][x][0] = igx; - invlut[z][y][x][1] = igy; - invlut[z][y][x][2] = igz; - } - } - } - - if (gammaLutTextureID == 0) { - gammaLutTextureID = OGLTR_InitGammaLutTexture(); - } - OGLTR_UpdateGammaLutTexture(gammaLutTextureID, (GLfloat *)lut, LUT_EDGE); - - if (invGammaLutTextureID == 0) { - invGammaLutTextureID = OGLTR_InitGammaLutTexture(); - } - OGLTR_UpdateGammaLutTexture(invGammaLutTextureID, - (GLfloat *)invlut, LUT_EDGE); + loc = j2d_glGetUniformLocationARB(lcdTextProgram, "invgamma"); + j2d_glUniform3fARB(loc, ig, ig, ig); return JNI_TRUE; } From 0c39467189a7af1a3cc12d201dfb91bcf0868fb3 Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Fri, 29 May 2015 17:29:52 +0100 Subject: [PATCH 06/70] 8081447: System JPEG builds include in-tree jpeglib.h, resulting in build failure The include directive should be conditional on the use of the system JPEG library. Reviewed-by: prr, ihse --- jdk/make/lib/Awt2dLibraries.gmk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index aab1add5f48..211620ec3a6 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -491,7 +491,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \ SRC := $(LIBJAVAJPEG_SRC), \ INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \ OPTIMIZATION := HIGHEST, \ - CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJAVAJPEG_SRC)) \ + CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBJAVAJPEG_HEADERS) \ $(LIBJAVA_HEADER_FLAGS) \ -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \ DISABLED_WARNINGS_gcc := clobbered parentheses array-bounds, \ From 58c413e2d494749ef4dc877e99d10b22060b0545 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Mon, 1 Jun 2015 13:40:43 +0300 Subject: [PATCH 07/70] 8080086: Test javax/imageio/plugins/png/ItxtUtf8Test.java fails on Linux with G1 GC Reviewed-by: prr, serb --- jdk/test/javax/imageio/plugins/png/ItxtUtf8Test.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/test/javax/imageio/plugins/png/ItxtUtf8Test.java b/jdk/test/javax/imageio/plugins/png/ItxtUtf8Test.java index 89853c639ca..74938bcda18 100644 --- a/jdk/test/javax/imageio/plugins/png/ItxtUtf8Test.java +++ b/jdk/test/javax/imageio/plugins/png/ItxtUtf8Test.java @@ -30,7 +30,7 @@ * * @run main ItxtUtf8Test * - * @run main/othervm/timeout=10 -Xmx2m ItxtUtf8Test truncate + * @run main/othervm/timeout=10 -Xmx4m ItxtUtf8Test truncate */ import java.awt.image.BufferedImage; From 435c40f71bf4263ccd8ab7cf56a6d3730b9fbbcf Mon Sep 17 00:00:00 2001 From: Alexander Scherbatiy Date: Mon, 1 Jun 2015 17:46:28 +0400 Subject: [PATCH 08/70] 8081019: Check peer to null in CPlatformWindow.checkZoom() Reviewed-by: serb, azvegint --- .../sun/lwawt/macosx/CPlatformWindow.java | 12 +- .../swing/JOptionPane/8081019/bug8081019.java | 106 ++++++++++++++++++ 2 files changed, 113 insertions(+), 5 deletions(-) create mode 100644 jdk/test/javax/swing/JOptionPane/8081019/bug8081019.java diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index f89d27a2543..0765fae5156 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -985,11 +985,13 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } private void checkZoom() { - int state = peer.getState(); - if (state != Frame.MAXIMIZED_BOTH && isMaximized()) { - deliverZoom(true); - } else if (state == Frame.MAXIMIZED_BOTH && !isMaximized()) { - deliverZoom(false); + if (peer != null) { + int state = peer.getState(); + if (state != Frame.MAXIMIZED_BOTH && isMaximized()) { + deliverZoom(true); + } else if (state == Frame.MAXIMIZED_BOTH && !isMaximized()) { + deliverZoom(false); + } } } diff --git a/jdk/test/javax/swing/JOptionPane/8081019/bug8081019.java b/jdk/test/javax/swing/JOptionPane/8081019/bug8081019.java new file mode 100644 index 00000000000..f34c120440a --- /dev/null +++ b/jdk/test/javax/swing/JOptionPane/8081019/bug8081019.java @@ -0,0 +1,106 @@ +/* + * 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.Frame; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.concurrent.TimeUnit; + +/** + * @test + * @bug 8081019 + * @summary Check peer to null in CPlatformWindow.checkZoom() method + * @author Alexandr Scherbatiy + */ +public class bug8081019 { + + private static final String RUN_PROCESS = "RUN_PROCESS"; + private static final String RUN_TEST = "RUN_TEST"; + + public static void main(String[] args) throws Exception { + String command = RUN_PROCESS; + + if (0 < args.length) { + command = args[0]; + } + + switch (command) { + case RUN_PROCESS: + runProcess(); + break; + case RUN_TEST: + runTest(); + break; + default: + throw new RuntimeException("Unknown command: " + command); + } + } + + private static void runTest() throws Exception { + System.setSecurityManager(new SecurityManager()); + Frame f = new Frame("Test frame"); + f.setVisible(true); + f.setVisible(false); + f.dispose(); + } + + private static void runProcess() throws Exception { + String javaPath = System.getProperty("java.home", ""); + String command = javaPath + File.separator + "bin" + File.separator + "java" + + " " + bug8081019.class.getName() + " " + RUN_TEST; + + Process process = Runtime.getRuntime().exec(command); + boolean processExit = process.waitFor(20, TimeUnit.SECONDS); + + dumpStream(process.getErrorStream(), "error stream"); + dumpStream(process.getInputStream(), "input stream"); + + if (!processExit) { + process.destroy(); + throw new RuntimeException("" + + "The sub process has not exited!"); + } + } + + public static void dumpStream(InputStream in, String name) throws IOException { + System.out.println("--- dump " + name + " ---"); + String tempString; + int count = in.available(); + boolean exception = false; + while (count > 0) { + byte[] b = new byte[count]; + in.read(b); + tempString = new String(b); + if (!exception) { + exception = tempString.indexOf("Exception") != -1 + || tempString.indexOf("Error") != -1; + } + System.out.println(tempString); + count = in.available(); + } + + if (exception) { + throw new RuntimeException("Exception in the output!"); + } + } +} \ No newline at end of file From 6a907dfc021a2e74962e5700cd542115a570f2f8 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Tue, 2 Jun 2015 19:27:06 +0300 Subject: [PATCH 09/70] 8079084: Behavior of BeanProperty.enumerationValues() contradicts spec Reviewed-by: alexsch, malenkov --- .../sun/beans/introspect/PropertyInfo.java | 54 +++++++++---------- .../4058433/TestBeanProperty.java | 47 ++++++++++++++-- 2 files changed, 70 insertions(+), 31 deletions(-) diff --git a/jdk/src/java.desktop/share/classes/com/sun/beans/introspect/PropertyInfo.java b/jdk/src/java.desktop/share/classes/com/sun/beans/introspect/PropertyInfo.java index ed5843ed40d..44d6a1f7919 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/beans/introspect/PropertyInfo.java +++ b/jdk/src/java.desktop/share/classes/com/sun/beans/introspect/PropertyInfo.java @@ -125,38 +125,36 @@ public final class PropertyInfo { put(Name.visualUpdate, annotation.visualUpdate()); put(Name.description, annotation.description()); String[] values = annotation.enumerationValues(); - if (0 < values.length) { - try { - Object[] array = new Object[3 * values.length]; - int index = 0; - for (String value : values) { - Class type = info.method.getDeclaringClass(); - String name = value; - int pos = value.lastIndexOf('.'); - if (pos > 0) { - name = value.substring(0, pos); - if (name.indexOf('.') < 0) { - String pkg = type.getName(); - name = pkg.substring(0, 1 + Math.max( - pkg.lastIndexOf('.'), - pkg.lastIndexOf('$'))) + name; - } - type = findClass(name); - name = value.substring(pos + 1); - } - Field field = type.getField(name); - if (Modifier.isStatic(field.getModifiers()) && info.type.isAssignableFrom(field.getType())) { - array[index++] = name; - array[index++] = field.get(null); - array[index++] = value; + try { + Object[] array = new Object[3 * values.length]; + int index = 0; + for (String value : values) { + Class type = info.method.getDeclaringClass(); + String name = value; + int pos = value.lastIndexOf('.'); + if (pos > 0) { + name = value.substring(0, pos); + if (name.indexOf('.') < 0) { + String pkg = type.getName(); + name = pkg.substring(0, 1 + Math.max( + pkg.lastIndexOf('.'), + pkg.lastIndexOf('$'))) + name; } + type = findClass(name); + name = value.substring(pos + 1); } - if (index == array.length) { - put(Name.enumerationValues, array); + Field field = type.getField(name); + if (Modifier.isStatic(field.getModifiers()) && info.type.isAssignableFrom(field.getType())) { + array[index++] = name; + array[index++] = field.get(null); + array[index++] = value; } - } catch (Exception ignored) { - ignored.printStackTrace(); } + if (index == array.length) { + put(Name.enumerationValues, array); + } + } catch (Exception ignored) { + ignored.printStackTrace(); } } } diff --git a/jdk/test/java/beans/Introspector/4058433/TestBeanProperty.java b/jdk/test/java/beans/Introspector/4058433/TestBeanProperty.java index f074bc5b7fd..61ea26c5a19 100644 --- a/jdk/test/java/beans/Introspector/4058433/TestBeanProperty.java +++ b/jdk/test/java/beans/Introspector/4058433/TestBeanProperty.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -20,12 +20,14 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + import java.beans.BeanProperty; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.beans.PropertyDescriptor; import java.util.Arrays; -/* + +/** * @test * @bug 4058433 * @summary Tests the BeanProperty annotation @@ -34,7 +36,10 @@ import java.util.Arrays; */ public class TestBeanProperty { public static void main(String[] args) throws Exception { - Class[] types = {B.class, BL.class, BLF.class, E.class, H.class, P.class, VU.class, D.class, EV.class, EVL.class, EVX.class}; + Class[] types = + {B.class, BL.class, BLF.class, E.class, H.class, P.class, + VU.class, D.class, EVD.class, EVE.class, EV.class, EVL.class, + EVX.class}; for (Class type : types) { PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(type, "value"); if (((B.class == type) || (BLF.class == type)) && pd.isBound()) { @@ -77,6 +82,14 @@ public class TestBeanProperty { BeanUtils.reportPropertyDescriptor(pd); throw new Error("enumerationValues from another package"); } + if (EVD.class == type && !isEV(pd)) { + BeanUtils.reportPropertyDescriptor(pd); + throw new Error("EV:"+ pd.getValue("enumerationValues")); + } + if (EVE.class == type && !isEV(pd)) { + BeanUtils.reportPropertyDescriptor(pd); + throw new Error("EV:"+ pd.getValue("enumerationValues")); + } } } @@ -219,6 +232,34 @@ public class TestBeanProperty { } } + public static class EVD { + + private int value; + + public int getValue() { + return value; + } + + @BeanProperty() + public void setValue(int value) { + this.value = value; + } + } + + public static class EVE { + + private int value; + + public int getValue() { + return value; + } + + @BeanProperty(enumerationValues = {}) + public void setValue(int value) { + this.value = value; + } + } + public static class EV { private int value; From a5eab1ce93cd3e8b8b597afea2573ef1e3585fca Mon Sep 17 00:00:00 2001 From: Mikhail Cherkasov Date: Wed, 3 Jun 2015 15:21:35 +0300 Subject: [PATCH 10/70] 8077409: Drawing deviates when validate() is invoked on java.awt.ScrollPane Reviewed-by: bae --- .../share/classes/java/awt/ScrollPane.java | 3 +- .../java/awt/ScrollPane/bug8077409Test.java | 115 ++++++++++++++++++ 2 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 jdk/test/java/awt/ScrollPane/bug8077409Test.java diff --git a/jdk/src/java.desktop/share/classes/java/awt/ScrollPane.java b/jdk/src/java.desktop/share/classes/java/awt/ScrollPane.java index 3d5a8b9cd1e..65eaed68924 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ScrollPane.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ScrollPane.java @@ -499,9 +499,8 @@ public class ScrollPane extends Container implements Accessible { Point p = getScrollPosition(); Dimension cs = calculateChildSize(); Dimension vs = getViewportSize(); - Insets i = getInsets(); - c.reshape(i.left - p.x, i.top - p.y, cs.width, cs.height); + c.reshape(- p.x, - p.y, cs.width, cs.height); ScrollPanePeer peer = (ScrollPanePeer)this.peer; if (peer != null) { peer.childResized(cs.width, cs.height); diff --git a/jdk/test/java/awt/ScrollPane/bug8077409Test.java b/jdk/test/java/awt/ScrollPane/bug8077409Test.java new file mode 100644 index 00000000000..a3a7a951360 --- /dev/null +++ b/jdk/test/java/awt/ScrollPane/bug8077409Test.java @@ -0,0 +1,115 @@ +/* + * 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 8077409 + @summary Drawing deviates when validate() is invoked on java.awt.ScrollPane + @author mikhail.cherkasov@oracle.com + @run main bug8077409Test +*/ + + +import java.awt.*; +import java.awt.event.*; + +public class bug8077409Test extends Frame { + ScrollPane pane; + MyCanvas myCanvas; + + class MyCanvas extends Canvas { + public Dimension getPreferredSize() { + return new Dimension(400, 800); + } + + public void paint(Graphics g) { + g.setColor(Color.BLACK); + g.drawLine(0, 0, 399, 0); + g.setColor(Color.RED); + g.drawLine(0, 1, 399, 1); + g.setColor(Color.BLUE); + g.drawLine(0, 2, 399, 2); + g.setColor(Color.GREEN); + g.drawLine(0, 3, 399, 3); + } + + } + + public bug8077409Test() { + super(); + setLayout(new BorderLayout()); + pane = new ScrollPane(); + + myCanvas = new MyCanvas(); + pane.add(myCanvas); + + add(pane, BorderLayout.CENTER); + setSize(320, 480); + + } + + @Override + protected void processKeyEvent(KeyEvent e) { + super.processKeyEvent(e); + + } + + public static void main(String[] args) throws AWTException, InterruptedException { + final bug8077409Test obj = new bug8077409Test(); + obj.setVisible(true); + Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() { + @Override + public void eventDispatched(AWTEvent e) { + KeyEvent keyEvent = (KeyEvent) e; + if(keyEvent.getID() == KeyEvent.KEY_RELEASED) { + if (keyEvent.getKeyCode() == KeyEvent.VK_1) { + System.out.println(obj.pane.toString()); + System.out.println("obj.myCanvas.pos: " + obj.myCanvas.getBounds()); + System.out.println(obj.myCanvas.toString()); + } else if (keyEvent.getKeyCode() == KeyEvent.VK_2) { + obj.repaint(); + } else if (keyEvent.getKeyCode() == KeyEvent.VK_DOWN) { + Point scrollPosition = obj.pane.getScrollPosition(); + scrollPosition.translate(0, 1); + obj.pane.setScrollPosition(scrollPosition); + } else if (keyEvent.getKeyCode() == KeyEvent.VK_UP) { + Point scrollPosition = obj.pane.getScrollPosition(); + scrollPosition.translate(0, -1); + obj.pane.setScrollPosition(scrollPosition); + } else if (keyEvent.getKeyCode() == KeyEvent.VK_SPACE) { + obj.pane.validate(); + } + } + } + }, AWTEvent.KEY_EVENT_MASK); + Point scrollPosition = obj.pane.getScrollPosition(); + scrollPosition.translate(0, 1); + obj.pane.setScrollPosition(scrollPosition); + + int y = obj.pane.getComponent(0).getLocation().y; + obj.pane.validate(); + if(y != obj.pane.getComponent(0).getLocation().y){ + throw new RuntimeException("Wrong position of component in ScrollPane"); + } + } + +} \ No newline at end of file From f2c0051c6f1fa5b879d30f0caca1e05abba2165c Mon Sep 17 00:00:00 2001 From: Alexander Stepanov Date: Wed, 3 Jun 2015 18:39:26 +0400 Subject: [PATCH 11/70] 8077036: swing docs: fix some tidy warnings Minor fixes for docs Reviewed-by: alexsch --- .../java/swing/plaf/motif/MotifBorders.java | 2 +- .../swing/plaf/motif/MotifButtonListener.java | 1 - .../plaf/motif/MotifCheckBoxMenuItemUI.java | 1 - .../swing/plaf/motif/MotifComboBoxUI.java | 11 +++++----- .../plaf/motif/MotifInternalFrameUI.java | 2 +- .../java/swing/plaf/motif/MotifLabelUI.java | 2 +- .../java/swing/plaf/motif/MotifMenuBarUI.java | 2 +- .../swing/plaf/motif/MotifMenuItemUI.java | 1 - .../java/swing/plaf/motif/MotifMenuUI.java | 3 +-- .../plaf/motif/MotifPopupMenuSeparatorUI.java | 4 ++-- .../swing/plaf/motif/MotifPopupMenuUI.java | 2 +- .../swing/plaf/motif/MotifScrollPaneUI.java | 2 +- .../swing/plaf/motif/MotifSeparatorUI.java | 4 ++-- .../swing/plaf/motif/MotifTabbedPaneUI.java | 2 +- .../swing/plaf/windows/DesktopProperty.java | 2 +- .../swing/plaf/windows/WindowsBorders.java | 4 ++-- .../windows/WindowsCheckBoxMenuItemUI.java | 2 +- .../plaf/windows/WindowsFileChooserUI.java | 2 +- .../plaf/windows/WindowsGraphicsUtils.java | 2 +- .../plaf/windows/WindowsIconFactory.java | 2 +- .../WindowsInternalFrameTitlePane.java | 2 +- .../swing/plaf/windows/WindowsMenuItemUI.java | 2 +- .../swing/plaf/windows/WindowsMenuUI.java | 2 +- .../windows/WindowsPopupMenuSeparatorUI.java | 2 +- .../windows/WindowsRadioButtonMenuItemUI.java | 2 +- .../plaf/windows/WindowsSeparatorUI.java | 2 -- .../windows/WindowsToolBarSeparatorUI.java | 1 - .../share/classes/javax/swing/Timer.java | 2 +- .../sun/swing/AccumulativeRunnable.java | 20 +++++++++---------- .../sun/swing/PrintColorUIResource.java | 2 +- .../classes/sun/swing/PrintingStatus.java | 2 +- .../classes/sun/swing/SwingUtilities2.java | 6 ++++-- .../sun/swing/UIClientPropertyKey.java | 2 +- .../classes/sun/swing/WindowsPlacesBar.java | 1 - 34 files changed, 48 insertions(+), 53 deletions(-) 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 7a1b637850b..950f7d18b24 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 @@ -41,7 +41,7 @@ import java.awt.Point; import java.awt.Rectangle; /** - * Factory object that can vend Icons appropriate for the basic L & F. + * Factory object that can vend Icons appropriate for the basic {@literal L & F}. *

* Warning: * Serialized objects of this class will not be compatible with diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifButtonListener.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifButtonListener.java index 0e0f5d5ac9b..a1a74f1230f 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifButtonListener.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifButtonListener.java @@ -34,7 +34,6 @@ import javax.swing.event.*; /** * Button Listener - *

* * @author Rich Schiavi */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifCheckBoxMenuItemUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifCheckBoxMenuItemUI.java index fea72f0fee3..7aa206b1fc5 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifCheckBoxMenuItemUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifCheckBoxMenuItemUI.java @@ -37,7 +37,6 @@ import java.awt.event.*; /** * MotifCheckboxMenuItem implementation - *

* * @author Georges Saab * @author Rich Schiavi diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifComboBoxUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifComboBoxUI.java index fd8f885fb74..7e5c4701e11 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifComboBoxUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifComboBoxUI.java @@ -35,7 +35,8 @@ import java.beans.*; /** * ComboBox motif look and feel - *

* Warning: + *

+ * Warning: * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is appropriate * for short term storage or RMI between applications running the same @@ -261,9 +262,9 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable { } /** - * This inner class is marked "public" due to a compiler bug. - * This class should be treated as a "protected" inner class. - * Instantiate it only within subclasses of . + * This inner class is marked "public" due to a compiler bug. + * This class should be treated as a "protected" inner class. + * Instantiate it only within subclasses of {@code }. */ public class ComboBoxLayoutManager extends BasicComboBoxUI.ComboBoxLayoutManager { public ComboBoxLayoutManager() { @@ -344,7 +345,7 @@ public class MotifComboBoxUI extends BasicComboBoxUI implements Serializable { } /** - * This class should be made "protected" in future releases. + * This class should be made "protected" in future releases. */ private class MotifPropertyChangeListener extends BasicComboBoxUI.PropertyChangeHandler { diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameUI.java index bcd1cacfde9..8d9e5122ef6 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameUI.java @@ -38,7 +38,7 @@ import javax.swing.plaf.*; /** - * A Motif L&F implementation of InternalFrame. + * A Motif {@literal L&F} implementation of InternalFrame. *

* Warning: * Serialized objects of this class will not be compatible with diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLabelUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLabelUI.java index 22b224e13a7..1da0036e3fa 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLabelUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLabelUI.java @@ -32,7 +32,7 @@ import javax.swing.plaf.basic.BasicLabelUI; import javax.swing.plaf.ComponentUI; /** - * A Motif L&F implementation of LabelUI. + * A Motif {@literal L&F} implementation of LabelUI. * This merely sets up new default values in MotifLookAndFeel. *

* Warning: diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuBarUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuBarUI.java index a2256895364..cdc05400fe2 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuBarUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuBarUI.java @@ -45,7 +45,7 @@ import javax.swing.plaf.basic.BasicMenuBarUI; import javax.swing.plaf.basic.*; /** - * A Windows L&F implementation of MenuBarUI. This implementation + * A Windows {@literal L&F} implementation of MenuBarUI. This implementation * is a "combined" view/controller. *

* Warning: diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuItemUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuItemUI.java index c11ad6c4e05..52116aaf588 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuItemUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuItemUI.java @@ -37,7 +37,6 @@ import javax.swing.plaf.basic.BasicMenuItemUI; /** * MotifMenuItem implementation - *

* * @author Rich Schiavi * @author Georges Saab diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuUI.java index fd32fd0db48..c69e9df7c65 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuUI.java @@ -36,8 +36,7 @@ import javax.swing.plaf.basic.*; import javax.swing.plaf.basic.BasicMenuUI; /** - * A Motif L&F implementation of MenuUI. - *

+ * A Motif {@literal L&F} implementation of MenuUI. * * @author Georges Saab * @author Rich Schiavi diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuSeparatorUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuSeparatorUI.java index bd3aa15d6cb..164b3227034 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuSeparatorUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuSeparatorUI.java @@ -34,8 +34,8 @@ import java.awt.Rectangle; import javax.swing.plaf.*; /** - * A Motif L&F implementation of PopupMenuSeparatorUI. This implementation - * is a "combined" view/controller. + * A Motif {@literal L&F} implementation of PopupMenuSeparatorUI. + * This implementation is a "combined" view/controller. * * @author Jeff Shapiro */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuUI.java index f34c45e6d80..402bcc528b1 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuUI.java @@ -47,7 +47,7 @@ import javax.swing.plaf.basic.BasicPopupMenuUI; /** - * A Motif L&F implementation of PopupMenuUI. + * A Motif {@literal L&F} implementation of PopupMenuUI. *

* Warning: * Serialized objects of this class will not be compatible with 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 52bc7385518..8cb5028c476 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 @@ -34,7 +34,7 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; /** - * A CDE/Motif L&F implementation of ScrollPaneUI. + * A CDE/Motif {@code L&F} implementation of ScrollPaneUI. *

* Warning: * Serialized objects of this class will not be compatible with diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSeparatorUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSeparatorUI.java index db6033fd4a9..bc457b01b13 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSeparatorUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifSeparatorUI.java @@ -35,8 +35,8 @@ import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicSeparatorUI; /** - * A Motif L&F implementation of SeparatorUI. This implementation - * is a "combined" view/controller. + * A Motif {@literal L&F} implementation of SeparatorUI. + * This implementation is a "combined" view/controller. *

* Warning: * Serialized objects of this class will not be compatible with diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTabbedPaneUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTabbedPaneUI.java index ce2408ff623..e7bae098a55 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTabbedPaneUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTabbedPaneUI.java @@ -34,7 +34,7 @@ import javax.swing.plaf.basic.BasicTabbedPaneUI; import java.io.Serializable; /** - * A Motif L&F implementation of TabbedPaneUI. + * A Motif {@literal L&F} implementation of TabbedPaneUI. *

* Warning: * Serialized objects of this class will not be compatible with diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/DesktopProperty.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/DesktopProperty.java index f4058eeeb8b..ab6aa617222 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/DesktopProperty.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/DesktopProperty.java @@ -199,7 +199,7 @@ public class DesktopProperty implements UIDefaults.ActiveValue { /** * Requests that all components in the GUI hierarchy be updated - * to reflect dynamic changes in this look&feel. This update occurs + * to reflect dynamic changes in this {@literal look&feel}. This update occurs * by uninstalling and re-installing the UI objects. Requests are * batched and collapsed into a single update pass because often * many desktop properties will change at once. diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsBorders.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsBorders.java index ca840ca0c42..1e10ccce1bf 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsBorders.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsBorders.java @@ -39,7 +39,7 @@ import static com.sun.java.swing.plaf.windows.TMSchema.*; import static com.sun.java.swing.plaf.windows.XPStyle.Skin; /** - * Factory object that can vend Borders appropriate for the Windows 95 L & F. + * Factory object that can vend Borders appropriate for the Windows 95 {@literal L & F}. * @author Rich Schiavi */ @@ -142,7 +142,7 @@ public class WindowsBorders { /** * A border for the ToolBar. If the ToolBar is floatable then the handle grip is drawn - *

+ * * @since 1.4 */ @SuppressWarnings("serial") // Superclass is not serializable across versions diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxMenuItemUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxMenuItemUI.java index ab1a1bce0b6..99966cb210e 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxMenuItemUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxMenuItemUI.java @@ -76,7 +76,7 @@ public class WindowsCheckBoxMenuItemUI extends BasicCheckBoxMenuItemUI { } /** * Method which renders the text of the current menu item. - *

+ * * @param g Graphics context * @param menuItem Current menu item to render * @param textRect Bounding rectangle to render the text. 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 8e2e1489580..ca9121c225d 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 @@ -48,7 +48,7 @@ import sun.swing.*; import javax.accessibility.*; /** - * Windows L&F implementation of a FileChooser. + * Windows {@literal L&F} implementation of a FileChooser. * * @author Jeff Dinkins */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java index 8e168066d11..4bc8f0b612e 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java @@ -47,7 +47,7 @@ public class WindowsGraphicsUtils { * Renders a text String in Windows without the mnemonic. * This is here because the WindowsUI hierarchy doesn't match the Component hierarchy. All * the overriden paintText methods of the ButtonUI delegates will call this static method. - *

+ * * @param g Graphics context * @param b Current button to render * @param textRect Bounding rectangle to render the text. 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 55c79c43906..4faeba214aa 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 @@ -38,7 +38,7 @@ import static com.sun.java.swing.plaf.windows.XPStyle.Skin; import sun.swing.MenuItemCheckIconFactory; /** - * Factory object that can vend Icons appropriate for the Windows L & F. + * Factory object that can vend Icons appropriate for the Windows {@literal L & F}. *

* Warning: * Serialized objects of this class will not be compatible with diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java index f86f5964693..83717d6bf93 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java @@ -503,7 +503,7 @@ public class WindowsInternalFrameTitlePane extends BasicInternalFrameTitlePane { private Icon[] icons; /** - * @params objects an array of Icon or UIDefaults.LazyValue + * @param objects an array of Icon or UIDefaults.LazyValue *

* The constructor is public so it can be called by UIDefaults.ProxyLazyValue. */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java index dddbeeb5074..578615829ec 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java @@ -70,7 +70,7 @@ public class WindowsMenuItemUI extends BasicMenuItemUI { /** * Method which renders the text of the current menu item. - *

+ * * @param g Graphics context * @param menuItem Current menu item to render * @param textRect Bounding rectangle to render the text. diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuUI.java index a2e7795cfe3..803952b8011 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuUI.java @@ -199,7 +199,7 @@ public class WindowsMenuUI extends BasicMenuUI { /** * Method which renders the text of the current menu item. - *

+ * * @param g Graphics context * @param menuItem Current menu item to render * @param textRect Bounding rectangle to render the text. diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuSeparatorUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuSeparatorUI.java index f040812a26d..ed31f00a89b 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuSeparatorUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuSeparatorUI.java @@ -36,7 +36,7 @@ import com.sun.java.swing.plaf.windows.TMSchema.State; import com.sun.java.swing.plaf.windows.XPStyle.Skin; /** - * Windows L&F implementation of PopupMenuSeparatorUI. + * Windows {@literal L&F} implementation of PopupMenuSeparatorUI. * * @author Leif Samuelsson * @author Igor Kushnirskiy diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRadioButtonMenuItemUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRadioButtonMenuItemUI.java index c43876f38b4..cce34eb9a65 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRadioButtonMenuItemUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRadioButtonMenuItemUI.java @@ -76,7 +76,7 @@ public class WindowsRadioButtonMenuItemUI extends BasicRadioButtonMenuItemUI { /** * Method which renders the text of the current menu item. - *

+ * * @param g Graphics context * @param menuItem Current menu item to render * @param textRect Bounding rectangle to render the text. diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsSeparatorUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsSeparatorUI.java index 1f0ece18046..65526a40c1b 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsSeparatorUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsSeparatorUI.java @@ -29,7 +29,5 @@ import javax.swing.plaf.basic.*; /** * Windows Separator. - *

- * */ public class WindowsSeparatorUI extends BasicSeparatorUI { } diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsToolBarSeparatorUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsToolBarSeparatorUI.java index 997fc905403..ffd6daa3ad8 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsToolBarSeparatorUI.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsToolBarSeparatorUI.java @@ -37,7 +37,6 @@ import static com.sun.java.swing.plaf.windows.XPStyle.Skin; /** * Draws Windows toolbar separators. - *

* * @author Mark Davidson */ 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 ffaa9d53b3c..e15736c8004 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/Timer.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/Timer.java @@ -141,7 +141,7 @@ import javax.swing.event.EventListenerList; * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * - * @see java.util.Timer java.util.Timer + * @see java.util.Timer * * * @author Dave Moore diff --git a/jdk/src/java.desktop/share/classes/sun/swing/AccumulativeRunnable.java b/jdk/src/java.desktop/share/classes/sun/swing/AccumulativeRunnable.java index 8dd6e5eeede..8c83812f371 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/AccumulativeRunnable.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/AccumulativeRunnable.java @@ -49,10 +49,10 @@ import javax.swing.SwingUtilities; *

* Here is how one can do this using {@code AccumulativeRunnable}: *

- * AccumulativeRunnable doSetTextImpl =
- * new  AccumulativeRunnable() {
- *     @Override
- *     protected void run(List<String> args) {
+ * {@code AccumulativeRunnable doSetTextImpl =
+ *  new  AccumulativeRunnable()} {
+ *    {@literal @Override}
+ *    {@code protected void run(List args)} {
  *         //set to the last string being passed
  *         setTextImpl(args.get(args.size() - 1));
  *     }
@@ -66,16 +66,16 @@ import javax.swing.SwingUtilities;
  * 

* Say we want to implement addDirtyRegion(Rectangle rect) * which sends this region to the - * handleDirtyRegions(List regiouns) on the EDT. + * {@code handleDirtyRegions(List regiouns)} on the EDT. * addDirtyRegions better be accumulated before handling on the EDT. * *

* Here is how it can be implemented using AccumulativeRunnable: *

- * AccumulativeRunnable doHandleDirtyRegions =
- *     new AccumulativeRunnable() {
- *         @Override
- *         protected void run(List<Rectangle> args) {
+ * {@code AccumulativeRunnable doHandleDirtyRegions =}
+ *    {@code new AccumulativeRunnable()} {
+ *        {@literal @Override}
+ *        {@code protected void run(List args)} {
  *             handleDirtyRegions(args);
  *         }
  *     };
@@ -113,7 +113,7 @@ public abstract class AccumulativeRunnable implements Runnable {
     }
 
     /**
-     * appends arguments and sends this {@cod Runnable} for the
+     * appends arguments and sends this {@code Runnable} for the
      * execution if needed.
      * 

* This implementation uses {@see #submit} to send this diff --git a/jdk/src/java.desktop/share/classes/sun/swing/PrintColorUIResource.java b/jdk/src/java.desktop/share/classes/sun/swing/PrintColorUIResource.java index 9669be85465..6bc0d3aeba2 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/PrintColorUIResource.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/PrintColorUIResource.java @@ -72,7 +72,7 @@ public class PrintColorUIResource extends ColorUIResource { * manager. When access is disallowed, deserialization of any object * with reference to a {@code PrintColorUIResource} fails. *

- * Since {@code PrintColorUIResource) is used only by Swing's look + * Since {@code PrintColorUIResource} is used only by Swing's look * and feels, and we know that UI supplied colors are replaced after * deserialization when the UI is re-installed, the only important * aspect of the {@code PrintColorUIResource} that needs to be diff --git a/jdk/src/java.desktop/share/classes/sun/swing/PrintingStatus.java b/jdk/src/java.desktop/share/classes/sun/swing/PrintingStatus.java index 1a49c94e03f..afe4638d395 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/PrintingStatus.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/PrintingStatus.java @@ -40,7 +40,7 @@ import java.lang.reflect.InvocationTargetException; /** * The {@code PrintingStatus} provides a dialog that displays progress * of the printing job and provides a way to abort it - *

+ *

* Methods of these class are thread safe, although most Swing methods * are not. Please see * Concurrency 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 3953297184c..1d98ea049f1 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java @@ -662,7 +662,8 @@ public class SwingUtilities2 { * Point is within the actual bounds of a list item (not just in the cell) * and if the JList has the "List.isFileList" client property set. * Otherwise, this method returns -1. - * This is used to make WindowsL&F JFileChooser act like native dialogs. + * This is used to make Windows {@literal L&F} JFileChooser act + * like native dialogs. */ public static int loc2IndexFileList(JList list, Point point) { int index = list.locationToIndex(point); @@ -703,7 +704,8 @@ public class SwingUtilities2 { * item at the given row of the table. (Column must be 0). * Does not check the "Table.isFileList" property. That should be checked * before calling this method. - * This is used to make WindowsL&F JFileChooser act like native dialogs. + * This is used to make Windows {@literal L&F} JFileChooser act + * like native dialogs. */ public static boolean pointOutsidePrefSize(JTable table, int row, int column, Point p) { if (table.convertColumnIndexToModel(column) != 0 || row == -1) { diff --git a/jdk/src/java.desktop/share/classes/sun/swing/UIClientPropertyKey.java b/jdk/src/java.desktop/share/classes/sun/swing/UIClientPropertyKey.java index c52427230be..6ec361cbf45 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/UIClientPropertyKey.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/UIClientPropertyKey.java @@ -27,7 +27,7 @@ package sun.swing; /** * This interface is used only for tagging keys for client properties - * for {@code JComponent} set by UI which needs to be cleared on L&F + * for {@code JComponent} set by UI which needs to be cleared on {@literal L&F} * change and serialization. * * All such keys are removed from client properties in {@code diff --git a/jdk/src/java.desktop/share/classes/sun/swing/WindowsPlacesBar.java b/jdk/src/java.desktop/share/classes/sun/swing/WindowsPlacesBar.java index 103eaa8b2f4..76aec34d11b 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/WindowsPlacesBar.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/WindowsPlacesBar.java @@ -43,7 +43,6 @@ import sun.awt.OSInfo; * WARNING: This class is an implementation detail and is only * public so that it can be used by two packages. You should NOT consider * this public API. - *

* * @author Leif Samuelsson */ From ecfa1d7624fe3c857dd8fb2ae557fcfe67d0e09a Mon Sep 17 00:00:00 2001 From: Alexander Stepanov Date: Wed, 3 Jun 2015 18:45:27 +0400 Subject: [PATCH 12/70] 8081313: MultipleDocumentHandling.java: tidy warnings Minor fix for docs Reviewed-by: alexsch --- .../standard/MultipleDocumentHandling.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java index c7f5f5e7664..f3e02845159 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java @@ -70,8 +70,8 @@ import javax.print.attribute.PrintJobAttribute; * The standard MultipleDocumentHandling values are: *