diff options
author | gjoranv <gv@verizonmedia.com> | 2019-07-16 13:59:38 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2019-07-16 13:59:38 +0200 |
commit | 9f283f29d3e3780186936fcf92df1e50886a12bb (patch) | |
tree | 2528573cebdfc000bc4c8d2b7b0dbbe1061fc461 /bundle-plugin | |
parent | c36e334429991e8c18e837e3c4d9431e9b2ae5ab (diff) |
minor: simplify with not-operator and remove exception not thrown
Diffstat (limited to 'bundle-plugin')
-rw-r--r-- | bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java index 9c9957ae718..c9c4091d927 100644 --- a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java +++ b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java @@ -90,7 +90,7 @@ public class GenerateOsgiManifestMojo extends AbstractMojo { @Parameter(alias = "X-Jersey-Binding") private String jerseyBinding = null; - public void execute() throws MojoExecutionException, MojoFailureException { + public void execute() throws MojoExecutionException { try { Artifacts.ArtifactSet artifactSet = Artifacts.getArtifacts(project); warnOnUnsupportedArtifacts(artifactSet.getNonJarArtifacts()); @@ -133,7 +133,7 @@ public class GenerateOsgiManifestMojo extends AbstractMojo { private static void warnIfPackagesDefinedOverlapsGlobalPackages(Set<String> internalPackages, List<String> globalPackages) throws MojoExecutionException { Set<String> overlap = Sets.intersection(internalPackages, new HashSet<>(globalPackages)); - if (overlap.isEmpty() == false) { + if (! overlap.isEmpty()) { throw new MojoExecutionException( "The following packages are both global and included in the bundle:\n " + String.join("\n ", overlap)); } @@ -173,7 +173,7 @@ public class GenerateOsgiManifestMojo extends AbstractMojo { Pair.of("WebInfUrl", webInfUrl), // Pair.of("Import-Package", importPackage), // Pair.of("Export-Package", exportPackage))) { - if (element.getValue() != null && element.getValue().isEmpty() == false) { + if (element.getValue() != null && ! element.getValue().isEmpty()) { ret.put(element.getKey(), element.getValue()); } } @@ -232,7 +232,7 @@ public class GenerateOsgiManifestMojo extends AbstractMojo { } private void warnOnUnsupportedArtifacts(Collection<Artifact> nonJarArtifacts) { - List<Artifact> unsupportedArtifacts = nonJarArtifacts.stream().filter(a -> "pom".equals(a.getType()) == false) + List<Artifact> unsupportedArtifacts = nonJarArtifacts.stream().filter(a -> ! a.getType().equals("pom")) .collect(Collectors.toList()); unsupportedArtifacts.forEach(artifact -> getLog() @@ -258,7 +258,7 @@ public class GenerateOsgiManifestMojo extends AbstractMojo { List<ClassFileMetaData> analyzedClasses = new ArrayList<>(); for (Enumeration<JarEntry> entries = jarFile.entries(); entries.hasMoreElements();) { JarEntry entry = entries.nextElement(); - if (entry.isDirectory() == false && entry.getName().endsWith(".class")) { + if (! entry.isDirectory() && entry.getName().endsWith(".class")) { analyzedClasses.add(analyzeClass(jarFile, entry)); } } @@ -305,10 +305,10 @@ public class GenerateOsgiManifestMojo extends AbstractMojo { } private static Optional<String> emptyToNone(String str) { - return Optional.ofNullable(str).map(String::trim).filter(s -> s.isEmpty() == false); + return Optional.ofNullable(str).map(String::trim).filter(s -> ! s.isEmpty()); } private static boolean isClassToAnalyze(String name) { - return name.endsWith(".class") && name.endsWith("module-info.class") == false; + return name.endsWith(".class") && ! name.endsWith("module-info.class"); } } |