MrChang0 opened a new issue, #1640:
URL: https://github.com/apache/incubator-fury/issues/1640

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-fury/issues) and found no similar 
issues.
   
   
   ### Version
   
   master
   
   ### Component(s)
   
   Java
   
   ### Minimal reproduce step
   
   suche code
   ```java
     @Data
     abstract static class Foo {
         private int f1;
     }
   
     static class Foo1 extends Foo {}
   
       @Data
       static class CollectionAbstractTest {
         private List<Foo> foos;
       }
   
       @Test
       public void testCollectionAbstractCodegen() {
           Fury fury =
                   Fury.builder()
                           .withCodegen(true)
                           .requireClassRegistration(false)
                           .build();
           CollectionAbstractTest test = new CollectionAbstractTest();
           test.foos = new ArrayList<>(ImmutableList.of(new Foo1(), new 
Foo1()));
           CollectionAbstractTest object = serDe(fury, test);
   ```
   it create `sameElementClassWrite` function as
   ```java
     private void sameElementClassWrite(int value0, MemoryBuffer memoryBuffer1, 
java.util.List list2, boolean value1) {
         for (int i = 0; i < value0; i+=1) {
           Object object = list2.get(i);
           if (value1) {
               if ((object == null)) {
                   memoryBuffer1.writeByte(((byte)-3));
               } else {
                   memoryBuffer1.writeByte(((byte)0));
                   fooClassInfoHolder.getSerializer().write(memoryBuffer1, 
object);
               }
           } else {
               fooClassInfoHolder.getSerializer().write(memoryBuffer1, object);
           }
         }
     }
   ```
   casuse of it don't know abstract class will be same class or not. so it take 
a deseralize error.
   
   ### What did you expect to see?
   
   i want it will be could deserialize right.
   
   ### What did you see instead?
   
   deserialize error.
   
   ### Anything Else?
   
   btw. it have to iterator all data for check collection is same class. mostly 
time we won't take different class in one collection unless it like 
`Set<Object>`. maybe it can reduce array traversal.
   
   I'd like to fix it and keep binary compatibility. because my code is running 
on prod. but I have to move house this weekend, so I have no time to fix it 
those day.
   
   ### 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