-
Notifications
You must be signed in to change notification settings - Fork 12k
fix the problem of potential NPE in ACL plain #2893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
private String fileName = System.getProperty("rocketmq.acl.plain.file", DEFAULT_PLAIN_ACL_FILE); | ||
|
||
private Map<String/** AccessKey **/, PlainAccessResource> plainAccessResourceMap = new HashMap<>(); | ||
private Map<String/** AccessKey **/, PlainAccessResource> plainAccessResourceMap = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you check your style correct, just like here.?#2899
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you check your style correct, just like here.?#2899
yes, i checked
JSONObject.class); | ||
if (plainAclConfData == null || plainAclConfData.isEmpty()) { | ||
throw new AclException(String.format("%s file is not data", fileHome + File.separator + fileName)); | ||
throw new AclException(String.format("%s file is not data", fileHome + File.separator + fileName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the middle of file and is has two blanks, right?
Map.class); | ||
|
||
if (aclAccessConfigMap == null || aclAccessConfigMap.isEmpty()) { | ||
throw new AclException(String.format("%s file is not data", fileHome + File.separator + fileName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is file is not data, is it right sematic?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2893 +/- ##
=============================================
+ Coverage 46.67% 47.86% +1.19%
- Complexity 4418 4538 +120
=============================================
Files 552 552
Lines 36500 36524 +24
Branches 4828 4834 +6
=============================================
+ Hits 17035 17481 +446
+ Misses 17344 16817 -527
- Partials 2121 2226 +105 ☔ View full report in Codecov by Sentry. |
|
||
Map<String, Object> newAccountsMap = null; | ||
if (existedAccountMap == null) { | ||
if (existedAccoutMap == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accout -> account
Map.class); | ||
|
||
if (aclAccessConfigMap == null || aclAccessConfigMap.isEmpty()) { | ||
throw new AclException(String.format("%s file not found or empty", fileHome + File.separator + fileName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the xxx file is not found or empty " seems better.
fix the problem of potential NPE in ACL plain
fix the problem of potential NPE in ACL plain
[#2863] fix the problem of potential NPE in ACL plain and revise codeStyle