File: 15-java9-compatibility.patch

package info (click to toggle)
libjna-java 4.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 9,844 kB
  • sloc: java: 75,159; ansic: 4,781; xml: 4,585; makefile: 434; sh: 235
file content (22 lines) | stat: -rw-r--r-- 911 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Description: Fixes the build failure with Java 9
Author: Emmanuel Bourg <ebourg@apache.org>
Bug: https://github.com/java-native-access/jna/issues/856
Bug-Debian: https://bugs.debian.org/874649
--- a/contrib/platform/src/com/sun/jna/platform/WindowUtils.java
+++ b/contrib/platform/src/com/sun/jna/platform/WindowUtils.java
@@ -1389,14 +1389,7 @@
             whenDisplayable(w, new Runnable() {
 				@Override
                 public void run() {
-                    Object peer = w.getPeer();
-                    try {
-                        Class<?> cls = peer.getClass();
-                        Method m = cls.getMethod("setAlpha", new Class[]{ float.class });
-                        m.invoke(peer, Float.valueOf(alpha));
-                    }
-                    catch (Exception e) {
-                    }
+                    w.setOpacity(alpha);
                 }
             });
         }