rickiehsu opened a new issue, #12591:
URL: https://github.com/apache/dubbo/issues/12591

   ### Environment
   
   * Dubbo version: 3.2.2
   * Operating System version: win 10
   * Java version: 1.8
   * Fastjson2: both 2.0.31,2.0.34
   
   ### Steps to reproduce this issue
   This code reproduce the problem
   
   ```
   public void testWriteReadString() throws Exception {
           QueryVo model = new QueryVo();
           model.addOrderClause(new OrderClause("task_no", false));
   
           FrameworkModel frameworkModel = new FrameworkModel();
           Serialization serialization = 
frameworkModel.getExtensionLoader(Serialization.class).getExtension("fastjson2");
           URL url = URL.valueOf("").setScopeModel(frameworkModel);
           // write pojo, read failed
           ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
           ObjectOutput objectOutput = serialization.serialize(url, 
outputStream);
           objectOutput.writeObject(model);
           objectOutput.flushBuffer();
   
           byte[] bytes = outputStream.toByteArray();
           ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
           ObjectInput objectInput = serialization.deserialize(url, 
inputStream);
           Object obj = objectInput.readObject();
           Assertions.assertEquals(obj, objectInput.readObject());
           
           frameworkModel.destroy();
       }
   
   **QueryVo.java**
   public class QueryVo implements Serializable {
       private int limit;
       private int offset;
       private Map<String, Object> queryObj;
       private List<OrderClause> orderClauses;
   
       public int getLimit() {
           return limit;
       }
   
       public void setLimit(int limit) {
           this.limit = limit;
       }
   
       public int getOffset() {
           return offset;
       }
   
       public void setOffset(int offset) {
           this.offset = offset;
       }
   
       public Map<String, Object> getQueryObj() {
           return queryObj;
       }
   
       public void setQueryObj(Map<String, Object> queryObj) {
           this.queryObj = queryObj;
       }
   
       public List<OrderClause> getOrderClauses() {
           return orderClauses;
       }
   
       public void addOrderClause(OrderClause orderClause) {
           if (this.orderClauses == null) {
               this.orderClauses = new ArrayList<>();
           }
           this.orderClauses.add(orderClause);
       }
   }
   
   **OrderClause.java**
   public class OrderClause implements Serializable {
       private String fieldName;
       private boolean ascending = true;
   
       public OrderClause(){
   
       }
   
       public OrderClause(String fieldName){
           this.fieldName = fieldName;
       }
   
       public OrderClause(String fieldName, boolean ascending){
           this.fieldName = fieldName;
           this.ascending = ascending;
       }
   
       public String getFieldName() {
           return fieldName;
       }
   
       public void setFieldName(String fieldName) {
           this.fieldName = fieldName;
       }
   
       public boolean isAscending() {
           return ascending;
       }
   
       public void setAscending(boolean ascending) {
           this.ascending = ascending;
       }
   }
   
   ```


-- 
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