diff --git a/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/CustomResourceClassLoader.java b/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/CustomResourceClassLoader.java index b1b655d391f..f231387e98f 100644 --- a/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/CustomResourceClassLoader.java +++ b/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/CustomResourceClassLoader.java @@ -43,11 +43,13 @@ class CustomResourceClassLoader { private ClassLoader cachedClassLoader; + @SuppressWarnings("UnusedReturnValue") public CustomResourceClassLoader withParentClassLoader(ClassLoader parentClassLoader) { this.parentClassLoader = parentClassLoader; return this; } + @SuppressWarnings("UnusedReturnValue") public CustomResourceClassLoader withClasspathElement(String... classpathElements) { if (classpathElements != null) { withClasspathElements(Arrays.asList(classpathElements)); @@ -55,6 +57,7 @@ public CustomResourceClassLoader withClasspathElement(String... classpathElement return this; } + @SuppressWarnings("UnusedReturnValue") public CustomResourceClassLoader withClasspathElements(Collection classpathElements) { if (classpathElements != null) { classpathElements.stream() diff --git a/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/CustomResourceCollector.java b/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/CustomResourceCollector.java index d3b13ca8adc..fe46c3ce7f6 100644 --- a/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/CustomResourceCollector.java +++ b/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/CustomResourceCollector.java @@ -69,6 +69,7 @@ public CustomResourceCollector withParentClassLoader(ClassLoader classLoader) { return this; } + @SuppressWarnings("UnusedReturnValue") public CustomResourceCollector withClasspathElement(String... classpathElement) { this.customResourceClassLoader.withClasspathElement(classpathElement); return this; @@ -79,6 +80,7 @@ public CustomResourceCollector withClasspathElements(Collection classpat return this; } + @SuppressWarnings("UnusedReturnValue") public CustomResourceCollector withCustomResourceClass(String... className) { if (className != null) { withCustomResourceClasses(Arrays.asList(className)); @@ -86,6 +88,7 @@ public CustomResourceCollector withCustomResourceClass(String... className) { return this; } + @SuppressWarnings("UnusedReturnValue") public CustomResourceCollector withCustomResourceClasses(Collection classNames) { if (classNames != null) { classNames.stream() @@ -95,11 +98,13 @@ public CustomResourceCollector withCustomResourceClasses(Collection clas return this; } + @SuppressWarnings("UnusedReturnValue") public CustomResourceCollector withIndex(IndexView... index) { jandexCustomResourceClassScanner.withIndex(index); return this; } + @SuppressWarnings("UnusedReturnValue") public CustomResourceCollector withIndices(Collection indices) { jandexCustomResourceClassScanner.withIndices(indices); return this; diff --git a/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/JandexCustomResourceClassScanner.java b/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/JandexCustomResourceClassScanner.java index bcc69fbb882..c884b0778ea 100644 --- a/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/JandexCustomResourceClassScanner.java +++ b/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/JandexCustomResourceClassScanner.java @@ -58,11 +58,13 @@ public class JandexCustomResourceClassScanner { */ private boolean forceIndex = false; + @SuppressWarnings("UnusedReturnValue") public JandexCustomResourceClassScanner withForceIndex(boolean forceIndex) { this.forceIndex = forceIndex; return this; } + @SuppressWarnings("UnusedReturnValue") public JandexCustomResourceClassScanner withIndex(IndexView... index) { if (index != null) { withIndices(Arrays.asList(index)); @@ -70,6 +72,7 @@ public JandexCustomResourceClassScanner withIndex(IndexView... index) { return this; } + @SuppressWarnings("UnusedReturnValue") public JandexCustomResourceClassScanner withIndices(Collection indices) { if (indices != null) { indices.stream() @@ -79,6 +82,7 @@ public JandexCustomResourceClassScanner withIndices(Collection indice return this; } + @SuppressWarnings("UnusedReturnValue") public JandexCustomResourceClassScanner withFileToScan(File... files) { if (files != null) { withFilesToScan(Arrays.asList(files)); @@ -86,6 +90,7 @@ public JandexCustomResourceClassScanner withFileToScan(File... files) { return this; } + @SuppressWarnings("UnusedReturnValue") public JandexCustomResourceClassScanner withFilesToScan(Collection files) { if (files != null) { files.stream() diff --git a/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/JandexIndexer.java b/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/JandexIndexer.java index ffd182b4b2a..0d4c039cd4c 100644 --- a/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/JandexIndexer.java +++ b/crd-generator/collector/src/main/java/io/fabric8/crd/generator/collector/JandexIndexer.java @@ -52,6 +52,7 @@ class JandexIndexer { private long maxBytesReadFromJar = 100000000; // 100 MB private long maxClassFileSize = 1000000; // 1 MB + @SuppressWarnings("UnusedReturnValue") public JandexIndexer withMaxJarEntries(int maxJarEntries) { if (maxJarEntries < 1) throw new IllegalArgumentException("maxJarEntries must be greater than 0"); @@ -59,6 +60,7 @@ public JandexIndexer withMaxJarEntries(int maxJarEntries) { return this; } + @SuppressWarnings("UnusedReturnValue") public JandexIndexer withMaxClassFileSize(int maxClassFileSize) { if (maxClassFileSize < 10) throw new IllegalArgumentException("maxClassFileSize must be greater than 10"); @@ -66,6 +68,7 @@ public JandexIndexer withMaxClassFileSize(int maxClassFileSize) { return this; } + @SuppressWarnings("UnusedReturnValue") public JandexIndexer withMaxBytesReadFromJar(long maxBytesReadFromJar) { if (maxBytesReadFromJar < 10) throw new IllegalArgumentException("maxBytesReadFromJar must be greater than 10"); @@ -161,6 +164,7 @@ private long addToIndex(JarFile zip, JarEntry entry, Indexer indexer) { } } + @SuppressWarnings("UnusedReturnValue") private long addToIndex(Path file, Indexer indexer) { try (InputStream in = Files.newInputStream(file)) { return addToIndex(in, indexer);