diff --git a/integration-tests/src/main/java/io/quarkiverse/fury/it/Foo.java b/integration-tests/src/main/java/io/quarkiverse/fury/it/Foo.java index d0ac0f0..d740be5 100644 --- a/integration-tests/src/main/java/io/quarkiverse/fury/it/Foo.java +++ b/integration-tests/src/main/java/io/quarkiverse/fury/it/Foo.java @@ -24,6 +24,6 @@ import io.quarkiverse.fury.FurySerialization; -@FurySerialization +@FurySerialization(classId = 300) public record Foo(int f1, String f2, List f3, Map f4) { } diff --git a/runtime/src/main/java/io/quarkiverse/fury/FuryRecorder.java b/runtime/src/main/java/io/quarkiverse/fury/FuryRecorder.java index 57acc16..8218453 100644 --- a/runtime/src/main/java/io/quarkiverse/fury/FuryRecorder.java +++ b/runtime/src/main/java/io/quarkiverse/fury/FuryRecorder.java @@ -27,9 +27,9 @@ public RuntimeValue createFury( } public void registerClass( - final RuntimeValue fury, final Class clazz, + final RuntimeValue furyValue, final Class clazz, final int classId, Class serializer) { - BaseFury furyValue = fury.getValue(); + BaseFury fury = furyValue.getValue(); if (classId > 0) { Preconditions.checkArgument( classId >= 256 && classId <= Short.MAX_VALUE, @@ -38,12 +38,12 @@ public void registerClass( Short.MAX_VALUE); Class registeredClass; if (fury instanceof ThreadSafeFury) { - ThreadSafeFury threadSafeFury = (ThreadSafeFury) furyValue; + ThreadSafeFury threadSafeFury = (ThreadSafeFury) fury; registeredClass = (threadSafeFury).execute(f -> f.getClassResolver().getRegisteredClass((short) classId)); // Generate serializer bytecode. threadSafeFury.execute(f -> f.getClassResolver().getSerializerClass(clazz)); } else { - ClassResolver classResolver = ((Fury) furyValue).getClassResolver(); + ClassResolver classResolver = ((Fury) fury).getClassResolver(); registeredClass = classResolver.getRegisteredClass((short) classId); // Generate serializer bytecode. classResolver.getSerializerClass(clazz); @@ -53,12 +53,13 @@ public void registerClass( "ClassId %s has been registered for class %s", classId, registeredClass); + fury.register(clazz, (short) classId); } else { // Generate serializer bytecode. - furyValue.register(clazz, true); + fury.register(clazz, true); } if (serializer != null) { - furyValue.registerSerializer(clazz, serializer); + fury.registerSerializer(clazz, serializer); } } }