software-jessies-org / jessies

Terminator, Evergreen, lwm and friends
GNU General Public License v2.0
84 stars 19 forks source link

Illegal reflective access operation warning when launching evergreen on OpenJDK 10 #25

Open jonathan-teh opened 6 years ago

jonathan-teh commented 6 years ago

As before, OpenJDK 10 on Ubuntu 18.04:

$ java -version
openjdk version "10.0.1" 2018-04-17
OpenJDK Runtime Environment (build 10.0.1+10-Ubuntu-3ubuntu1)
OpenJDK 64-Bit Server VM (build 10.0.1+10-Ubuntu-3ubuntu1, mixed mode)

gives this warning when launching evergreen, which works fine otherwise:

$ evergreen
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by e.gui.BirdView (file:/home/jteh/usr/share/software.jessies.org/evergreen/Resources/evergreen/.generated/classes.jar) to method javax.swing.plaf.basic.BasicScrollBarUI.getTrackBounds()
WARNING: Please consider reporting this to the maintainers of e.gui.BirdView
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
martindorey commented 6 years ago

Thanks Jonathan, closing per your citation of the commit that fixed it.

enh commented 6 years ago

(yeah, i left it open because strictly i haven't fixed Terminator, but since this bug was specifically about Evergreen, and since fixing Terminator would seem to require removal of a feature that @martindorey uses or persuading Sun^wOracle to fix a Java bug/limitation from ~2007, we're not likely to fix that any time soon, and leaving the bug open had no obvious value. sgtm.)

martindorey commented 6 years ago

Having tried it with a shinier Java than I have been using, I think he's talking about my use of translucency. I've addressed that, so that it'll warn less (for me) and won't warn at all unless, like me, you use the dubious feature. I wonder which Java issue he was alluding to because, if it was https://bugs.java.com/view_bug.do?bug_id=6633275, which was the only Sun bug cited in that part of the source, they think they fixed that. (He doesn't say on https://web.archive.org/web/20140405184323/http://elliotth.blogspot.com/2007/08/transparent-java-windows-on-x11.html.)

I still get:

WARNING: Illegal reflective access by e.util.GuiUtilities (file:/u2/home/mad/jessies/work/salma-hayek/.generated/classes/) to field sun.awt.X11.XToolkit.awtAppClassName at e.util.GuiUtilities.fixWmClass(GuiUtilities.java:444) at e.util.GuiUtilities.initLookAndFeel(GuiUtilities.java:417) at terminator.Terminator$4.run(Terminator.java:224) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764) at java.desktop/java.awt.EventQueue.access$500(EventQueue.java:97) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:717) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:711) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:89) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:734) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:199) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

... so I'll reopen this.

enh commented 6 years ago

yeah, i can't find the relevant bug ("why is it only undecorated windows that can be transparent?") either. i'd file another, except i'm pretty sure Sun/Oracle never fixed a single bug i filed anyway.

i do wonder if their docs point to another possible solution: what happens if we lie by overriding isUndecorated to always return true? would that break anything else? might be worth exploring if/when we have to.

https://bugs.openjdk.java.net/browse/JDK-6528430 is the (unfixed) WM_CLASS bug. i'll add that link to the code comment.

martindorey commented 6 years ago

(I guess /tmp/trc makes:

https://bugs.java.com/view_bug.do?bug_id=6354700 (LD_LIBRARY_PATH polluted in children)

... more likely to have been me than you.)

On Sun, Oct 7, 2018 at 22:10 Elliott Hughes notifications@github.com wrote:

yeah, i can't find the relevant bug ("why is it only undecorated windows that can be transparent?") either. i'd file another, except i'm pretty sure Sun/Oracle never fixed a single bug i filed anyway.

i do wonder if their docs point to another possible solution: what happens if we lie by overriding isUndecorated to always return true? would that break anything else? might be worth exploring if/when we have to.

https://bugs.openjdk.java.net/browse/JDK-6528430 is the (unfixed) WM_CLASS bug. i'll add that link to the code comment.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/software-jessies-org/jessies/issues/25#issuecomment-427723198, or mute the thread https://github.com/notifications/unsubscribe-auth/AQM-muR283jghC-VMIa61d6GxFeFrZPtks5uit5TgaJpZM4T3bho .

martindorey commented 6 years ago

Further to that check-in comment, with that, transparency started working on Windows for me.

enh commented 6 years ago

So is the decorated thing a lie?

On Mon, Oct 8, 2018, 17:15 Martin Dorey notifications@github.com wrote:

Further to that check-in comment, with that, transparency started working on Windows for me.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/software-jessies-org/jessies/issues/25#issuecomment-428018715, or mute the thread https://github.com/notifications/unsubscribe-auth/ACR2LX0wCtTcXB-i9NupI7BMmk_rQ-Ohks5ui-qkgaJpZM4T3bho .

martindorey commented 6 years ago

If you mean, "does translucency still work with the patch below?" then "no", it fails with:

Caused by: java.awt.IllegalComponentStateException: The frame is decorated at java.awt.Frame.setOpacity(Frame.java:960)

If you mean "does there seem to be any good reason for translucency not to be supported for decorated windows?", then "not as far as I've noticed yet". Perhaps there was on Solaris or something. I'm pretty confident that I won't find any regression because, far as I see so far on Linux, the new code's effect looks exactly like the old code's. There's the bonus taste of sick, ameliorated perhaps by the removal of quite a bit of code that we don't think anyone was actively using.

--- a/salma-hayek/src/e/util/GuiUtilities.java
+++ b/salma-hayek/src/e/util/GuiUtilities.java
@@ -479,7 +479,7 @@ public class GuiUtilities {
             Log.warn("http://docs.oracle.com/javase/7/docs/api/java/awt/Window.html#setOpacity%28float%29.");
             Log.warn("Perhaps you'd like to override that but only for the duration of this call,");
             Log.warn("otherwise you won't be able to move, resize or close your window.");
-            return;
+            //return;
         }
         try {
             // This is only available on Java 7 and later.
--- a/terminator/src/terminator/TerminatorFrame.java
+++ b/terminator/src/terminator/TerminatorFrame.java
@@ -393,7 +393,7 @@ public class TerminatorFrame extends JFrame implements TerminalPaneHost {

     private void updateTransparency() {
         double alpha = Terminator.getPreferences().getDouble(TerminatorPreferences.ALPHA);
-        settingAlpha = true;
+        settingAlpha = false;
         GuiUtilities.setFrameAlpha(this, alpha);
         settingAlpha = false;
     }
enh commented 5 years ago

Works for me. (Both literally and figuratively.)

On Mon, Oct 8, 2018, 17:53 Martin Dorey <notifications@github.com wrote:

If you mean, "does translucency still work with the patch below?" then "no", it fails with:

Caused by: java.awt.IllegalComponentStateException: The frame is decorated at java.awt.Frame.setOpacity(Frame.java:960)

If you mean "does there seem to be any good reason for translucency not to be supported for decorated windows?", then "not as far as I've noticed yet". Perhaps there was on Solaris or something. I'm pretty confident that I won't find any regression because, far as I see so far on Linux, the new code's effect looks exactly like the old code's. There's the bonus taste of sick, ameliorated perhaps by the removal of quite a bit of code that we don't think anyone was actively using.

--- a/salma-hayek/src/e/util/GuiUtilities.java +++ b/salma-hayek/src/e/util/GuiUtilities.java @@ -479,7 +479,7 @@ public class GuiUtilities { Log.warn("http://docs.oracle.com/javase/7/docs/api/java/awt/Window.html#setOpacity%28float%29."); Log.warn("Perhaps you'd like to override that but only for the duration of this call,"); Log.warn("otherwise you won't be able to move, resize or close your window.");

  • return;
  • //return; } try { // This is only available on Java 7 and later. --- a/terminator/src/terminator/TerminatorFrame.java +++ b/terminator/src/terminator/TerminatorFrame.java @@ -393,7 +393,7 @@ public class TerminatorFrame extends JFrame implements TerminalPaneHost {

    private void updateTransparency() { double alpha = Terminator.getPreferences().getDouble(TerminatorPreferences.ALPHA);

  • settingAlpha = true;
  • settingAlpha = false; GuiUtilities.setFrameAlpha(this, alpha); settingAlpha = false; }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/software-jessies-org/jessies/issues/25#issuecomment-428024313, or mute the thread https://github.com/notifications/unsubscribe-auth/ACR2LfBM8rlaCrIGgzPCTw-8p5w_qEbrks5ui_ONgaJpZM4T3bho .