replaced MethodHandles with custom reflection-less reflectivity

This commit is contained in:
Shautvast 2023-08-23 09:21:25 +02:00
parent 7d7e158b6b
commit 178977d3b9

View file

@ -4,7 +4,6 @@ import com.github.shautvast.reflective.MetaClass;
import com.github.shautvast.reflective.MetaMethod; import com.github.shautvast.reflective.MetaMethod;
import com.github.shautvast.reflective.Reflective; import com.github.shautvast.reflective.Reflective;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
@ -130,14 +129,6 @@ public class ContiguousList<E> extends NotImplementedList<E> implements List<E>
}); });
} }
private static MethodHandles.Lookup getLookup(Class<?> type) {
try {
return MethodHandles.privateLookupIn(type, MethodHandles.lookup());
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
@Override @Override
@SuppressWarnings("Contract") @SuppressWarnings("Contract")
public boolean add(E element) { public boolean add(E element) {
@ -306,8 +297,7 @@ public class ContiguousList<E> extends NotImplementedList<E> implements List<E>
private static String quote(String out) { private static String quote(String out) {
StringBuilder s = new StringBuilder(out.length() + 2); StringBuilder s = new StringBuilder(out.length() + 2);
out = s.append("\"").append(out).append("\"").toString(); return s.append("\"").append(out).append("\"").toString();
return out;
} }
/* /*