Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import io.smallrye.common.constraint.Assert;
import sun.misc.Unsafe;

final class JDK24Specific {
final class DefaultSerialization {
// IMPORTANT NOTE: Do not be alarmed at the complexity/inefficiency/use of Unsafe here.
// The Java24+ version delegates directly to the JDK without doing all of this stuff.
// Also, maybe don't look at the JDK implementation either :-I
Expand Down Expand Up @@ -47,19 +47,19 @@ final class JDK24Specific {
ObjectStreamField_field_offset = unsafe.objectFieldOffset(fieldField);
try {
readObjectHandle = MethodHandles.lookup().findStatic(
JDK24Specific.class,
DefaultSerialization.class,
"defaultReadObject",
MethodType.methodType(void.class, List.class, Object.class, ObjectInputStream.class));
writeObjectHandle = MethodHandles.lookup().findStatic(
JDK24Specific.class,
DefaultSerialization.class,
"defaultWriteObject",
MethodType.methodType(void.class, List.class, Object.class, ObjectOutputStream.class));
} catch (NoSuchMethodException | IllegalAccessException e) {
throw Util.asError(e);
}
}

private JDK24Specific() {
private DefaultSerialization() {
}

static MethodHandle defaultWriteObjectForSerialization(final Class<?> type) {
Expand Down
2 changes: 1 addition & 1 deletion serial/src/main/java/io/smallrye/serial/impl/ReadUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected MethodHandle computeValue(final Class<?> type) {
static final ClassValue<MethodHandle> defaultReadObjects = new ClassValue<MethodHandle>() {
protected MethodHandle computeValue(final Class<?> type) {
// todo: inline on JDK 24+ (MR-JAR layer already handles this)
return JDK24Specific.defaultReadObjectForSerialization(type);
return DefaultSerialization.defaultReadObjectForSerialization(type);
}
};
static final ClassValue<MethodHandle> readResolves = new ClassValue<MethodHandle>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected MethodHandle computeValue(final Class<?> type) {
static final ClassValue<MethodHandle> defaultWriteObjects = new ClassValue<MethodHandle>() {
protected MethodHandle computeValue(final Class<?> type) {
// todo: inline on JDK 24+ (MR-JAR layer already handles this)
return JDK24Specific.defaultWriteObjectForSerialization(type);
return DefaultSerialization.defaultWriteObjectForSerialization(type);
}
};

Expand Down
Loading