Fix another mergeable if statement 17/103417/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 26 Nov 2022 10:07:50 +0000 (11:07 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 26 Nov 2022 10:07:50 +0000 (11:07 +0100)
Sonar is point out nested ifs, fix that.

Change-Id: I7081c59b9a5d617e34b9c52c267e8910ff6f08d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
plugin/yang-maven-plugin/src/main/java/org/opendaylight/yangtools/yang2sources/plugin/Util.java

index 0b645f6c360273eeb8451db211369410e9f37e18..ddfbf452b543a6c873510c27d6480fc3724b8a15 100644 (file)
@@ -129,13 +129,12 @@ final class Util {
      */
     private static void checkArtifact(final Artifact artifact, final Collection<Artifact> dependencies) {
         for (org.apache.maven.artifact.Artifact d : dependencies) {
-            if (artifact.getGroupId().equals(d.getGroupId()) && artifact.getArtifactId().equals(d.getArtifactId())) {
-                if (!artifact.getVersion().equals(d.getVersion())) {
-                    LOG.warn("{} Dependency resolution conflict:", LOG_PREFIX);
-                    LOG.warn("{} '{}' dependency [{}] has different version than one declared in current project [{}]"
-                            + ". It is recommended to fix this problem because it may cause compilation errors.",
-                            LOG_PREFIX, YangToSourcesMojo.PLUGIN_NAME, artifact, d);
-                }
+            if (artifact.getGroupId().equals(d.getGroupId()) && artifact.getArtifactId().equals(d.getArtifactId())
+                && !artifact.getVersion().equals(d.getVersion())) {
+                LOG.warn("{} Dependency resolution conflict:", LOG_PREFIX);
+                LOG.warn("{} '{}' dependency [{}] has different version than one declared in current project [{}]"
+                    + ". It is recommended to fix this problem because it may cause compilation errors.",
+                    LOG_PREFIX, YangToSourcesMojo.PLUGIN_NAME, artifact, d);
             }
         }
     }