aboutsummaryrefslogtreecommitdiffstats
path: root/version-manifest
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2017-11-08 09:33:58 -0800
committerGary Wu <gary.i.wu@huawei.com>2017-11-08 09:35:26 -0800
commit249fd8720d9b019b3f02d75ab2de8cb9479d3499 (patch)
treef4a36d371e41859c27b377cde252d70b2f8559ac /version-manifest
parent0752b7967768461e769bba56eb601490d63e75c8 (diff)
Fix NPE when artifact dependency version is null
Change-Id: I56d6813b54ea769ca4bc6f0d7bf098b12cd0c6bc Issue-ID: INT-330 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'version-manifest')
-rw-r--r--version-manifest/pom.xml2
-rw-r--r--version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java6
2 files changed, 4 insertions, 4 deletions
diff --git a/version-manifest/pom.xml b/version-manifest/pom.xml
index 0826aeb87..361262e83 100644
--- a/version-manifest/pom.xml
+++ b/version-manifest/pom.xml
@@ -8,7 +8,7 @@
</parent>
<groupId>org.onap.integration</groupId>
<artifactId>version-manifest</artifactId>
- <version>0.1.0-SNAPSHOT</version>
+ <version>0.1.1-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>ONAP Version Manifest and Maven Plugin</name>
<url>https://www.onap.org</url>
diff --git a/version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java b/version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java
index 75da50ff0..dfac6cd17 100644
--- a/version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java
+++ b/version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java
@@ -130,9 +130,9 @@ public class VersionCheckMojo extends AbstractMojo {
// used for formatting
int[] columnWidths = new int[10];
- columnWidths[0] = actualVersions.keySet().stream().mapToInt(String::length).max().orElse(1);
- columnWidths[1] = actualVersions.values().stream().mapToInt(String::length).max().orElse(1);
- columnWidths[2] = expectedVersions.values().stream().mapToInt(String::length).max().orElse(1);
+ columnWidths[0] = actualVersions.keySet().stream().mapToInt(s -> ("" + s).length()).max().orElse(1);
+ columnWidths[1] = actualVersions.values().stream().mapToInt(s -> ("" + s).length()).max().orElse(1);
+ columnWidths[2] = expectedVersions.values().stream().mapToInt(s -> ("" + s).length()).max().orElse(1);
String format = " %-" + columnWidths[0] + "s" + " %" + columnWidths[1] + "s -> %" + columnWidths[2] + "s";
if (mismatches.isEmpty()) {