rdfhdt / hdt-java

HDT Java library and tools.
Other
94 stars 69 forks source link

Can't use Big version of the sequence #167

Closed ate47 closed 1 year ago

ate47 commented 1 year ago

Since Java 9, we can't use the unsafe class sun/misc/Cleaner, but this class is used in the JLargeArray library, this library is used to create big sequences to allocate arrays with long indexes, this simple test show the issue:

@Test
public void allocationTest() {
    long size = LargeArray.getMaxSizeOf32bitArray() + 2L;
    new LongLargeArray(size);
}

An idea would be to update this library to Java 1.9, but it seems discontinued for years.

java.lang.NoClassDefFoundError: sun/misc/Cleaner
    at pl.edu.icm.jlargearrays.LongLargeArray.<init>(LongLargeArray.java:74)
    at pl.edu.icm.jlargearrays.LongLargeArray.<init>(LongLargeArray.java:52)
    at org.rdfhdt.hdt.compact.LargeArrayTest.allocationTest(LargeArrayTest.java:13)
mielvds commented 1 year ago

You could maintain a fork or move the necessary classes to this repo and maintain them there. in Java 9 there is a java.lang.ref.Cleaner which is a standard replacement for sun.misc.Cleaner