Package: lwjgl / 2.9.3+dfsg-6

java9-compatibility.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Description: Fixes the compatibility with Java 9 (sun.reflect.FieldAccessor is no longer accessible)
Author: Emmanuel Bourg <ebourg@pache.org>
Forwarded: no
--- a/src/java/org/lwjgl/MemoryUtilSun.java
+++ b/src/java/org/lwjgl/MemoryUtilSun.java
@@ -37,7 +37,6 @@
 import java.nio.Buffer;
 
 import sun.misc.Unsafe;
-import sun.reflect.FieldAccessor;
 
 /**
  * MemoryUtil.Accessor implementations that depend on sun.misc.
@@ -103,33 +102,4 @@
 
 	}
 
-	/** Implementation using reflection on ByteBuffer, FieldAccessor is used directly. */
-	private static class AccessorReflectFast implements MemoryUtil.Accessor {
-
-		private final FieldAccessor addressAccessor;
-
-		AccessorReflectFast() {
-			Field address;
-			try {
-				address = MemoryUtil.getAddressField();
-			} catch (NoSuchFieldException e) {
-				throw new UnsupportedOperationException(e);
-			}
-			address.setAccessible(true);
-
-			try {
-				Method m = Field.class.getDeclaredMethod("acquireFieldAccessor", boolean.class);
-				m.setAccessible(true);
-				addressAccessor = (FieldAccessor)m.invoke(address, true);
-			} catch (Exception e) {
-				throw new UnsupportedOperationException(e);
-			}
-		}
-
-		public long getAddress(final Buffer buffer) {
-			return addressAccessor.getLong(buffer);
-		}
-
-	}
-
-}
\ No newline at end of file
+}