michael-schnell opened a new issue, #2348:
URL: https://github.com/apache/fory/issues/2348

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/fory/issues) 
and found no similar issues.
   
   
   ### Version
   
   The following class was serialized fine with **Fury 0.10.3**, but fails with 
a compile error with **Fory 0.11.0**.
   
   Seems to be a regression caused by one of the changes.
   
   ```java
       public class State<K extends Comparable<K>, V> {
           Map<K, V[]> map;
           public State(Map<K, V[]> map) {
               this.map = map;
           }
       }
   ```
   
   
   ### Component(s)
   
   Java
   
   ### Minimal reproduce step
   
   ```java
   import org.apache.fory.Fory;
   import org.apache.fory.config.Language;
   
   import java.io.ByteArrayOutputStream;
   import java.io.IOException;
   import java.util.Map;
   
   public class SerTest {
   
       public static void main(String[] args) throws IOException {
   
           Fory fory = Fory.builder()
                   .withLanguage(Language.JAVA)
                   .requireClassRegistration(false)
                   .build();
   
           State original = new State(Map.of("foo", new String[]{"bar"}));
           System.out.println("ORIGINAL: " + original);
   
           try (var out = new ByteArrayOutputStream()) {
               fory.serialize(out, original);
               byte[] data = out.toByteArray();
               State copy = (State) fory.deserialize(data);
               System.out.println("COPY: " + copy);
           }
   
       }
   
       public static class State<K extends Comparable<K>, V> {
   
           Map<K, V[]> map;
   
           public State(Map<K, V[]> map) {
               this.map = map;
           }
   
       }
   
   }
   ```
   
   
   ### What did you expect to see?
   
   Should run without errors as it was the case in Fury 0.10.3
   
   ### What did you see instead?
   
   ```
   Caused by: 
org.apache.fory.shaded.org.codehaus.commons.compiler.CompileException: File 
'/SerTest_StateForyCodec_0.java', Line 27, Column 58: ';' expected instead of 
'1'
        at 
org.apache.fory.shaded.org.codehaus.janino.TokenStreamImpl.compileException(TokenStreamImpl.java:362)
        at 
org.apache.fory.shaded.org.codehaus.janino.TokenStreamImpl.read(TokenStreamImpl.java:149)
        at 
org.apache.fory.shaded.org.codehaus.janino.Parser.read(Parser.java:3804)
        at 
org.apache.fory.shaded.org.codehaus.janino.Parser.parseClassBodyDeclaration(Parser.java:1070)
        at 
org.apache.fory.shaded.org.codehaus.janino.Parser.parseClassBody(Parser.java:857)
        at 
org.apache.fory.shaded.org.codehaus.janino.Parser.parseClassDeclarationRest(Parser.java:747)
        at 
org.apache.fory.shaded.org.codehaus.janino.Parser.parsePackageMemberTypeDeclarationRest(Parser.java:493)
        at 
org.apache.fory.shaded.org.codehaus.janino.Parser.parseAbstractCompilationUnit(Parser.java:268)
        at 
org.apache.fory.shaded.org.codehaus.janino.Compiler.parseAbstractCompilationUnit(Compiler.java:316)
        at 
org.apache.fory.shaded.org.codehaus.janino.Compiler.compile2(Compiler.java:236)
        at 
org.apache.fory.shaded.org.codehaus.janino.Compiler.compile(Compiler.java:213)
        at org.apache.fory.codegen.JaninoUtils.toBytecode(JaninoUtils.java:115)
   ```
   
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to