hujie6 opened a new issue, #8229:
URL: https://github.com/apache/rocketmq/issues/8229

   ### Before Creating the Bug Report
   
   - [X] I found a bug, not just asking a question, which should be created in 
[GitHub Discussions](https://github.com/apache/rocketmq/discussions).
   
   - [X] I have searched the [GitHub 
Issues](https://github.com/apache/rocketmq/issues) and [GitHub 
Discussions](https://github.com/apache/rocketmq/discussions)  of this 
repository and believe that this is not a duplicate.
   
   - [X] I have confirmed that this bug belongs to the current repository, not 
other repositories of RocketMQ.
   
   
   ### Runtime platform environment
   
   mac
   
   ### RocketMQ version
   
   rocketmq5.2.0
   
   ### JDK Version
   
   jdk1.8
   
   ### Describe the Bug
   
   DefaultMQAdminExt defaultMQAdminExt = new DefaultMQAdminExt(new 
AclClientRPCHook(new SessionCredentials("rocketmq2", "12345678")));
            defaultMQAdminExt.setNamesrvAddr("127.0.0.1:9876");
           defaultMQAdminExt.start();
           
           PlainAccessConfig accessConfig = new PlainAccessConfig();
           accessConfig.setAccessKey("test-99999999");
           accessConfig.setSecretKey("sswewewewew");
           accessConfig.setAdmin(false);
           accessConfig.setGroupPerms(new ArrayList<>());
           accessConfig.setTopicPerms(new ArrayList<>());
           
defaultMQAdminExt.createAndUpdatePlainAccessConfig("127.0.0.1:10911", 
accessConfig);
   
   when groupPerms and topicPerms are empty array, 
createAndUpdatePlainAccessConfig method will cause plain_acl.yml garbled 
characters. like this:
   
   - accessKey: test-99999999
     admin: false
     defaultGroupPerm: null
     defaultTopicPerm: null
     groupPerms: &id003 []
     secretKey: sswewewewew
     topicPerms: *id003
     whiteRemoteAddress: null
   
   
   ### Steps to Reproduce
   
   topicPerms or groupPerms are empty array when creating acl
   
   ### What Did You Expect to See?
   
   if topicPerms or groupPerms are empty, donot cause garbled characters.
   
   ### What Did You See Instead?
   
   - accessKey: test-99999999
     admin: false
     defaultGroupPerm: null
     defaultTopicPerm: null
     groupPerms: []
     secretKey: sswewewewew
     topicPerms: []
     whiteRemoteAddress: null
   
   ### Additional Context
   
   How to fix:
   
   org.apache.rocketmq.common.Util.split method should not return 
Collections.EMPTY_LIST, return new ArrayList<>() instead
   


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

Reply via email to