Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the class name is too long, an ArrayIndexOutOfBoundsException will be reported #1835

Closed
1 of 2 tasks
yunshen-Lee opened this issue Sep 11, 2024 · 0 comments · Fixed by #1837
Closed
1 of 2 tasks
Labels
bug Something isn't working

Comments

@yunshen-Lee
Copy link

yunshen-Lee commented Sep 11, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Version

fury 0.7.0
JDK 1.8

Component(s)

Java

Minimal reproduce step

public class TestClassLengthTestClassLengthTestClassLengthTestClassLengthTestClassLengthTestClassLengthTestClassLength implements Serializable {

  private static final long serialVersionUID = 612789657789099089L;

  private String name;

  private InnerClassTestLengthInnerClassTestLengthInnerClassTestLength innerClassTestLength;
  
  public static class InnerClassTestLengthInnerClassTestLengthInnerClassTestLength implements Serializable {

    private static final long serialVersionUID = -867612757789099089L;

    private Long itemId;

  }

}

fury = Fury.builder()
              .withLanguage(Language.JAVA)
              .requireClassRegistration(false)
              .withAsyncCompilation(true)
              .withRefTracking(true)
              .withCompatibleMode(CompatibleMode.COMPATIBLE)
              .withJdkClassSerializableCheck(false)
              .build();
fury.serializeJavaObjectAndClass() and fury.deserializeJavaObjectAndClass()

After defining a class with a relatively long class name, an ArrayIndexOutOfBoundsEException will be reported during deserialization. If there is an inner class, an Invalid character value for LOWERS_SPECIAL: 31 will be reported

What did you expect to see?

Do not encounter errors during deserialization

What did you see instead?

There are no internal classes:

org.apache.fury.exception.DeserializationException: Deserialize failed, read objects are: [{}]
	at org.apache.fury.util.ExceptionUtils.handleReadFailed(ExceptionUtils.java:63)
	at org.apache.fury.Fury.deserializeJavaObjectAndClass(Fury.java:1227)
	at org.apache.fury.Fury.deserializeJavaObjectAndClass(Fury.java:1208)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -30469
	at org.apache.fury.resolver.ClassResolver.getRegisteredClass(ClassResolver.java:507)
	at org.apache.fury.meta.ClassDef$RegisteredFieldType.toTypeToken(ClassDef.java:458)
	at org.apache.fury.meta.ClassDef$FieldInfo.toDescriptor(ClassDef.java:307)
	at org.apache.fury.meta.ClassDef.getDescriptors(ClassDef.java:237)

There are internal classes available:

org.apache.fury.exception.DeserializationException: Deserialize failed, read objects are: []
	at org.apache.fury.util.ExceptionUtils.handleReadFailed(ExceptionUtils.java:63)
	at org.apache.fury.Fury.deserializeJavaObjectAndClass(Fury.java:1227)
	at org.apache.fury.Fury.deserializeJavaObjectAndClass(Fury.java:1208)
Caused by: java.lang.IllegalArgumentException: Invalid character value for LOWER_SPECIAL: 31

Anything Else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@yunshen-Lee yunshen-Lee added the bug Something isn't working label Sep 11, 2024
chaokunyang added a commit that referenced this issue Sep 12, 2024
## What does this PR do?
fix long type name meta string encoding
<!-- Describe the purpose of this PR. -->

## Related issues

Closes #1835 
## Does this PR introduce any user-facing change?

<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/fury/issues/new/choose) describing the
need to do so and update the document if necessary.
-->

- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?

## Benchmark

<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant