>
> *4) NIOUtilities*
> WARNING: Illegal reflective access by org.geotools.resources.NIOUtilities
> (file:/home/aaime/devel/git-gt/modules/library/metadata/target/gt-metadata-21-SNAPSHOT.jar)
> to method java.nio.DirectByteBuffer.cleaner()
>
> This is legit, but without that cleaner on Windows shapefile reading will
> not last long before making the JVM explode.
> Will have to check if there are replacements (might be). Task created.
>

Looks like they made a public API for it:
- https://docs.oracle.com/javase/9/docs/api/java/lang/ref/Cleaner.html
-
https://docs.oracle.com/javase/9/docs/api/java/lang/ref/Cleaner.Cleanable.html#clean--

With lots of complaints online about the api breaking :)

Best I found is the following:
https://stackoverflow.com/questions/3496508/deallocating-direct-buffer-native-memory-in-java-for-jogl/26777380#26777380

Linking to examples:
-
https://sourceforge.net/p/tuer/code/HEAD/tree/pre_beta/src/main/java/engine/misc/DeallocationHelper.java
(GPL License)
-
https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-core/src/main/java/com/jme3/util/ReflectionAllocator.java#L100
(BSD License)

Quoting:

> sun.misc.Cleaner has been moved into jdk.internal.ref.Cleaner in Java 1.9
> in the module "java.base" but the latter implements java.lang.Runnable ...
> you just have to cast the cleaner to a Runnable and to call the method
> run() (don't call it by reflection to avoid getting a
> java.lang.IllegalAccessException).
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to