You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/02/14 06:06:44 UTC

[GitHub] [shardingsphere] sandynz commented on pull request #15260: [issue-15259] upgrade snakeyaml due to cve

sandynz commented on pull request #15260:
URL: https://github.com/apache/shardingsphere/pull/15260#issuecomment-1038681692


   Hi @pjfanning , I tested with your PR. In fact, the unit test code could be improved to solve the exception.
   
   In `ProcessRegistrySubscriberTest.mockYamlExecuteProcessContext()`, change
   ```
   Collection<YamlExecuteProcessUnit> unitStatuses = Collections.singleton(yamlExecuteProcessUnit);
   ```
   to
   ```
   Collection<YamlExecuteProcessUnit> unitStatuses = Collections.singletonList(yamlExecuteProcessUnit);
   ```
   
   Then marshaled `YamlExecuteProcessContext` yaml is:
   ```
   unitStatuses:
   - status: EXECUTE_STATUS_DONE
     unitID: '159917166'
   ```
   And `ProcessRegistrySubscriberTest` could pass.
   
   In fact, in `YamlExecuteProcessContext` constructor:
   ```
   unitStatuses = executeProcessContext.getUnitStatuses().stream().map(YamlExecuteProcessUnit::new).collect(Collectors.toList());
   ```
   Though `unitStatuses` is type of `Collection`, it use `List`, but not `Set`.
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org