changeset 11809:45e87c514367

Workaround JDK-8046200 to unblock client/deploy
author mchung
date Mon, 09 Feb 2015 14:03:06 -0800
parents 6da0692ee77d
children 499abd45618d
files src/java.desktop/share/classes/javax/swing/UIDefaults.java
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/javax/swing/UIDefaults.java	Sat Feb 07 10:33:02 2015 +0000
+++ b/src/java.desktop/share/classes/javax/swing/UIDefaults.java	Mon Feb 09 14:03:06 2015 -0800
@@ -767,7 +767,14 @@
                     m = uiClass.getMethod("createUI", new Class<?>[]{JComponent.class});
                     put(uiClass, m);
                 }
-                uiObject = MethodUtil.invoke(m, null, new Object[]{target});
+
+                // ## workaround until JDK-8046200 is resolved
+                if (uiClass.getModule() == ComponentUI.class.getModule()) {
+                    // uiClass is a system LAF if it's in java.desktop module
+                    uiObject = m.invoke(null, new Object[]{target});
+                } else {
+                    uiObject = MethodUtil.invoke(m, null, new Object[]{target});
+                }
             }
             catch (NoSuchMethodException e) {
                 getUIError("static createUI() method not found in " + uiClass);