You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the issue: ImmutableCollections#contains(Object) throw a NullPointerException if the argument is null. Checking if collection contains null will always throw a NullPointerException
Example Arrays.asList("java").contains(null) => false List.of("java").contains(null) => NullPointerException
There is several place where the following pattern is apply : Preconditions.checkArgument(!entrypoint.contains(null), "entrypoint contains null elements");
Passing an ImmutableCollections as entrypoint always fail
Expected behavior:
No NullPointerException exception
Steps to reproduce:
./gradlew jibDockerBuild
jib-gradle-plugin Configuration:
plugins {
id 'java-library'
id 'com.google.cloud.tools.jib' version '2.5.0'
}
java {
targetCompatibility =JavaVersion.VERSION_11
sourceCompatibility =JavaVersion.VERSION_11
}
jib {
container {
entrypoint =List.of('java', '-jar', 'my-jar')
}
}
Log output:
Caused by: java.lang.NullPointerException
at com.google.cloud.tools.jib.configuration.ContainerConfiguration$Builder.setEntrypoint(ContainerConfiguration.java:265)
at com.google.cloud.tools.jib.api.JibContainerBuilder.setEntrypoint(JibContainerBuilder.java:274)
at com.google.cloud.tools.jib.plugins.common.PluginConfigurationProcessor.processCommonConfiguration(PluginConfigurationProcessor.java:403)
at com.google.cloud.tools.jib.plugins.common.PluginConfigurationProcessor.processCommonConfiguration(PluginConfigurationProcessor.java:455)
at com.google.cloud.tools.jib.plugins.common.PluginConfigurationProcessor.createJibBuildRunnerForDockerDaemonImage(PluginConfigurationProcessor.java:132)
at com.google.cloud.tools.jib.gradle.BuildDockerTask.buildDocker(BuildDockerTask.java:110)
Additional Information:
I know that not a conventional way to write a List, I'm just trying to provided the shorter possible example.
The text was updated successfully, but these errors were encountered:
Environment:
Description of the issue:
ImmutableCollections#contains(Object)
throw aNullPointerException
if the argument isnull
. Checking if collection containsnull
will always throw aNullPointerException
Example
Arrays.asList("java").contains(null)
=>false
List.of("java").contains(null)
=>NullPointerException
There is several place where the following pattern is apply :
Preconditions.checkArgument(!entrypoint.contains(null), "entrypoint contains null elements");
Passing an ImmutableCollections as
entrypoint
always failExpected behavior:
No
NullPointerException
exceptionSteps to reproduce:
jib-gradle-plugin
Configuration:Log output:
Additional Information:
I know that not a conventional way to write a
List
, I'm just trying to provided the shorter possible example.The text was updated successfully, but these errors were encountered: