Codebase list lwjgl / 28abf7d debian / patches / java9-compatibility.patch
28abf7d

Tree @28abf7d (Download .tar.gz)

java9-compatibility.patch @28abf7draw · history · blame

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
+}