Closed shivam-Purohit closed 1 year ago
should I need to add the dependencies.
I added `
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
in pom.xml and this is my if statement code
if (!StringUtils.isEmpty(phone1) && !StringUtils.equals(target.getphone1(),phone1)) {
target.setPhone1(phone1);
}`
is this Okay?
!StringUtils.equals(target.getphone1(),phone1)
is ok. It has null checking on it.
@NyorJa should I remove the null checking part then .
if (!StringUtils.equals(target.getphone1(),phone1)) { target.setPhone1(phone1); }
This should do I guess then.
@NyorJa should I remove the null checking part then .
if (!StringUtils.equals(target.getphone1(),phone1)) { target.setPhone1(phone1); }
This should do I guess then.
Yes. That is correct.
You can have a look and suggest if anymore changes required.
Hi @mepox @bglamadrid,
I think this is good. Please confirm. Thanks.
Kudos, SonarCloud Quality Gate passed!
PR Checklist
mvn test
returns exit code 0, without errors)PR Type
Summary
Improved the if statement to make the code shorter and easy to understand