apache / apache/fory

ClassID discrepancy on different fury setup

Closed
#2,095 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
4.5k
Forks
443
Avg merge
5h 59m
Merged PRs (30d)
77

Description

### Search before asking

- [x] I had searched in the [issues](https://github.com/apache/fury/issues) and found no similar issues.

### Version

v0.10

### Component(s)

Java

### Minimal reproduce step

```
ClassCompleteField subclass = new ClassCompleteField<>("subclass", "subclass2");
ClassCompleteField> classCompleteField =
new ClassCompleteField<>(subclass, subclass);
byte[] serialized = getFury(
RANDOM_CLASS_1.class,
RANDOM_CLASS_2.class,
RANDOM_CLASS_3.class,
ClassCompleteField.class,
RANDOM_CLASS_4.class,
RANDOM_CLASS_5.class,
RANDOM_CLASS_6.class,
RANDOM_CLASS_7.class,
RANDOM_CLASS_8.class,
RANDOM_CLASS_9.class
).serializeJavaObject(classCompleteField);

ClassMissingField> classMissingField =
getFury(
ClassMissingField.class,
RANDOM_CLASS_10.class,
RANDOM_CLASS_11.class,
RANDOM_CLASS_12.class
).deserializeJavaObject(serialized, ClassMissingField.class);

assertEq(classCompleteField, classMissingField);
```

reproable on my fork
https://github.com/orisgarno/fury/blob/fc07354bb388b54b6ed09c59c18f3d5f795ccf87/java/fury-core/src/test/java/org/apache/fury/serializer/compatible/DifferentPOJOCompatibleSerializerWithRegistrationTest.java#L58

### What did you expect to see?

Able to decode

### What did you see instead?

class id value may translate to different actual class

Image

and also array out of bound

Image

### Anything Else?

_No response_

### Are you willing to submit a PR?

- [x] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.