GutoVeronezi commented on pull request #5386:
URL: https://github.com/apache/cloudstack/pull/5386#issuecomment-946156616
Hi @RodrigoDLopez, thanks for the review!
This PR intended to standardize the using of
`org.apache.commons.lang3.StringUtils` and add some minor improvements, like
changing:
```java
if (StringUtils.isEmpty(a) || StringUtils.isEmpty(b)) {
```
to
```java
if (StringUtils.isAnyEmpty(a, b)) {
```
And so on.
These minor improvements were made looking for code reducing and improving
readability.
Changing:
```java
StringUtils.defaultIfEmpty(entry.get(VmDetailConstants.IP4_ADDRESS), null);
```
To:
```java
StringUtils.isEmpty(entry.get(VmDetailConstants.IP4_ADDRESS) ? null :
entry.get(VmDetailConstants.IP4_ADDRESS;
```
Or:
```java
String var = entry.get(VmDetailConstants.IP4_ADDRESS);
StringUtils.defaultIfEmpty(var, null);
```
To:
```java
String var = entry.get(VmDetailConstants.IP4_ADDRESS);
StringUtils.isEmpty(var) ? null : var;
```
Don't sounds neither more nor less readable, for me.
Is there any technical reason to change it?
--
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]