8211031: Remove un-needed qualified export to java.desktop from java.base on macos
authorprr
Wed, 03 Oct 2018 11:10:09 -0700
changeset 52242 7bd9745e8e15
parent 52241 5fc701128281
child 52243 c70468fc7118
8211031: Remove un-needed qualified export to java.desktop from java.base on macos Reviewed-by: serb, mchung
src/java.base/macosx/classes/module-info.java.extra
src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java
src/java.desktop/macosx/classes/com/apple/laf/AquaUtils.java
--- a/src/java.base/macosx/classes/module-info.java.extra	Sat Sep 29 09:43:33 2018 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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.
- */
-
-exports jdk.internal.loader to java.desktop;
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java	Sat Sep 29 09:43:33 2018 +0530
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java	Wed Oct 03 11:10:09 2018 -0700
@@ -274,7 +274,7 @@
         // <rdar://problem/5189013> Entire Java application window refreshes when moving off Shortcut menu item
         final Boolean useOpaqueComponents = Boolean.TRUE;
 
-        final Boolean buttonShouldBeOpaque = AquaUtils.shouldUseOpaqueButtons() ? Boolean.TRUE : Boolean.FALSE;
+        final Boolean buttonShouldBeOpaque = Boolean.FALSE;
 
         // *** List value objects
         final Object listCellRendererActiveValue = new UIDefaults.ActiveValue(){
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaUtils.java	Sat Sep 29 09:43:33 2018 +0530
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaUtils.java	Wed Oct 03 11:10:09 2018 -0700
@@ -37,8 +37,6 @@
 import javax.swing.border.Border;
 import javax.swing.plaf.UIResource;
 
-import jdk.internal.loader.ClassLoaders;
-
 import sun.awt.AppContext;
 
 import sun.lwawt.macosx.CPlatformWindow;
@@ -284,7 +282,6 @@
         public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) {
             final BufferedImage img = new BufferedImage(width + blur * 2, height + blur * 2, BufferedImage.TYPE_INT_ARGB_PRE);
             paintToImage(img, x, y, width, height);
-//            debugFrame("border", img);
             g.drawImage(img, -blur, -blur, null);
         }
 
@@ -325,7 +322,6 @@
 
             final BufferedImage i = new BufferedImage(templateWidth, templateHeight, BufferedImage.TYPE_INT_ARGB_PRE);
             super.paintBorder(null, i.getGraphics(), 0, 0, templateWidth, templateHeight);
-//            debugFrame("slices", i);
             slices = new SlicedImageControl(i, leftCut, topCut, rightCut, bottomCut, false);
         }
 
@@ -335,29 +331,6 @@
         }
     }
 
-//    static void debugFrame(String name, Image image) {
-//        JFrame f = new JFrame(name);
-//        f.setContentPane(new JLabel(new ImageIcon(image)));
-//        f.pack();
-//        f.setVisible(true);
-//    }
-
-    // special casing naughty applications, like InstallAnywhere
-    // <rdar://problem/4851533> REGR: JButton: Myst IV: the buttons of 1.0.3 updater have redraw issue
-    static boolean shouldUseOpaqueButtons() {
-        // can we use ClassLoader.getSystemClassLoader here?
-        final ClassLoader launcherClassLoader = ClassLoaders.appClassLoader();
-        if (classExists(launcherClassLoader, "com.installshield.wizard.platform.macosx.MacOSXUtils")) return true;
-        return false;
-    }
-
-    private static boolean classExists(final ClassLoader classLoader, final String clazzName) {
-        try {
-            return Class.forName(clazzName, false, classLoader) != null;
-        } catch (final Throwable ignored) { }
-        return false;
-    }
-
     private static final RecyclableSingleton<Method> getJComponentGetFlagMethod = new RecyclableSingleton<Method>() {
         @Override
         protected Method getInstance() {