BitoAgent commented on code in PR #13786:
URL: https://github.com/apache/dubbo/pull/13786#discussion_r1543381775
##########
dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java:
##########
@@ -420,7 +420,7 @@
}
private ArgumentConfig getArgumentByIndex(MethodConfig methodConfig, int
argIndex) {
- if (methodConfig.getArguments() != null &&
methodConfig.getArguments().size() > 0) {
+ if (methodConfig.getArguments() != null &&
!methodConfig.getArguments().isEmpty()) {
Review Comment:
**Suggestion**: Simplify collection emptiness check using !isEmpty(). <br>
**Code Suggestion**:
```
+ if (methodConfig.getArguments() != null &&
!methodConfig.getArguments().isEmpty()) {
```
##########
dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java:
##########
@@ -353,14 +353,14 @@
// refresh MethodConfigs
List<MethodConfig> methodConfigs = this.getMethods();
- if (methodConfigs != null && methodConfigs.size() > 0) {
+ if (methodConfigs != null && !methodConfigs.isEmpty()) {
Review Comment:
**Suggestion**: Replace size() > 0 check with !isEmpty() for clarity and
performance. <br> **Code Suggestion**:
```
+ if (methodConfigs != null && !methodConfigs.isEmpty()) {
```
--
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]