[insubstantial] 04/05: Fixed the build failure with Java 9 (Closes: #894288)

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Fri Apr 6 09:53:22 UTC 2018


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository insubstantial.

commit 4ace7632337ed7824b921680bf4a8372423f5ae0
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Fri Apr 6 11:44:26 2018 +0200

    Fixed the build failure with Java 9 (Closes: #894288)
---
 debian/changelog                         |  1 +
 debian/patches/java9-compatibility.patch | 96 ++++++++++++++++++++++++++++++++
 debian/patches/series                    |  1 +
 3 files changed, 98 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 247470e..04af1f4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 insubstantial (7.3+dfsg3-3) UNRELEASED; urgency=medium
 
   * Team upload.
+  * Fixed the build failure with Java 9 (Closes: #894288)
   * Standards-Version updated to 4.1.4
   * Switch to debhelper level 11
 
diff --git a/debian/patches/java9-compatibility.patch b/debian/patches/java9-compatibility.patch
new file mode 100644
index 0000000..5469507
--- /dev/null
+++ b/debian/patches/java9-compatibility.patch
@@ -0,0 +1,96 @@
+Description: Fixes the compatibility with Java 9
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: no
+--- a/substance/src/main/java/org/pushingpixels/substance/internal/ui/SubstanceRootPaneUI.java
++++ b/substance/src/main/java/org/pushingpixels/substance/internal/ui/SubstanceRootPaneUI.java
+@@ -84,7 +84,6 @@
+ import javax.swing.plaf.UIResource;
+ import javax.swing.plaf.basic.BasicRootPaneUI;
+ 
+-import com.sun.awt.AWTUtilities;
+ import org.pushingpixels.substance.api.SubstanceLookAndFeel;
+ import org.pushingpixels.substance.api.SubstanceSkin;
+ import org.pushingpixels.substance.internal.animation.RootPaneDefaultButtonTracker;
+@@ -1678,7 +1677,7 @@
+                         || (!SubstanceCoreUtilities.isRoundedCorners(jrp)))
+                     {
+                         // special case, for undecorated windows and maximized windows
+-                        AWTUtilities.setWindowShape(w, null);
++                        w.setShape(null);
+                         return;
+                     }
+                 }
+@@ -1686,12 +1685,12 @@
+                     // only round the corners if the screen is reasonably sized, as in
+                     // smaller than archival versions of The Godfather, which is at 4096x2160
+                     if (SubstanceCoreUtilities.isRoundedCorners(w) && w.getWidth() * w.getHeight() < (4096*4096)) {
+-                        AWTUtilities.setWindowShape(w, new RoundRectangle2D.Double(0, 0, w.getWidth(), w.getHeight(), 12, 12));
++                        w.setShape(new RoundRectangle2D.Double(0, 0, w.getWidth(), w.getHeight(), 12, 12));
+                     } else {
+-                        AWTUtilities.setWindowShape(w, null);
++                        w.setShape(null);
+                     }
+                 } catch (OutOfMemoryError oome) {
+-                    AWTUtilities.setWindowShape(w, null);
++                    w.setShape(null);
+                     //System.out.println("Rounded panel size on OOOME : " + w.getWidth() + "x" + w.getHeight() + " for an area of " + w.getWidth()*w.getHeight() + "px");
+                     //throw oome;
+                 }
+--- a/substance/src/main/java/org/pushingpixels/substance/internal/utils/SubstanceCoreUtilities.java
++++ b/substance/src/main/java/org/pushingpixels/substance/internal/utils/SubstanceCoreUtilities.java
+@@ -43,7 +43,6 @@
+ import javax.swing.plaf.*;
+ import javax.swing.text.JTextComponent;
+ 
+-import com.sun.awt.AWTUtilities;
+ import org.pushingpixels.lafwidget.LafWidgetUtilities;
+ import org.pushingpixels.lafwidget.utils.TrackableThread;
+ import org.pushingpixels.substance.api.*;
+@@ -501,7 +500,10 @@
+ 
+             // next step, check AWTUtilities capabilities
+             if (globalRoundingEnable) {
+-                globalRoundingEnable = AWTUtilities.isTranslucencySupported(AWTUtilities.Translucency.PERPIXEL_TRANSPARENT);
++                GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
++                GraphicsDevice d = e.getDefaultScreenDevice();
++
++                globalRoundingEnable = e.getDefaultScreenDevice().isWindowTranslucencySupported(GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSPARENT);
+             }
+ 
+             // finally, add one listener to listen to the UIManager defaults value when the default changes.
+--- a/flamingo/src/main/java/org/pushingpixels/flamingo/api/ribbon/JRibbonFrame.java
++++ b/flamingo/src/main/java/org/pushingpixels/flamingo/api/ribbon/JRibbonFrame.java
+@@ -130,15 +130,7 @@
+ 
+ 			// Support placing heavyweight components in the ribbon frame. See
+ 			// http://today.java.net/article/2009/11/02/transparent-panel-mixing-heavyweight-and-lightweight-components.
+-			try {
+-				Class awtUtilitiesClass = Class
+-						.forName("com.sun.awt.AWTUtilities");
+-				Method mSetComponentMixing = awtUtilitiesClass.getMethod(
+-						"setComponentMixingCutoutShape", Component.class,
+-						Shape.class);
+-				mSetComponentMixing.invoke(null, this, new Rectangle());
+-			} catch (Throwable ignored) {
+-			}
++			setMixingCutoutShape(new Rectangle());
+ 		}
+ 
+ 		@Override
+--- a/substance/src/main/java/org/pushingpixels/substance/internal/contrib/randelshofer/quaqua/QuaquaUtilities.java
++++ b/substance/src/main/java/org/pushingpixels/substance/internal/contrib/randelshofer/quaqua/QuaquaUtilities.java
+@@ -19,7 +19,6 @@
+ import java.awt.event.*;
+ import java.awt.font.*;
+ import java.awt.image.*;
+-import java.awt.peer.*;
+ import java.net.*;
+ import javax.swing.*;
+ import javax.swing.text.*;
+@@ -700,4 +699,4 @@
+         }
+         return null;
+     }
+-}
+\ No newline at end of file
++}
diff --git a/debian/patches/series b/debian/patches/series
index a6344ad..4caa86a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ no_android.patch
 version.patch
 javadoc_encoding.patch
 asm5.patch
+java9-compatibility.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/insubstantial.git



More information about the pkg-java-commits mailing list