hdt-java icon indicating copy to clipboard operation
hdt-java copied to clipboard

Can't use Big version of the sequence

Open ate47 opened this issue 1 year ago • 1 comments

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)

ate47 avatar Jul 26 '22 15:07 ate47

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

mielvds avatar Jul 30 '22 13:07 mielvds