When verifying code with string concatenation that involves local variables (see example below), the plugin fails with a NullPointerException:
[ERROR] Failed to execute goal com.exasol:error-code-crawler-maven-plugin:0.7.1:verify (default-cli) on project postgresql-virtual-schema: Execution default-cli of goal com.exasol:error-code-crawler-maven-plugin:0.7.1:verify failed.: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.exasol:error-code-crawler-maven-plugin:0.7.1:verify (default-cli) on project postgresql-virtual-schema: Execution default-cli of goal com.exasol:error-code-crawler-maven-plugin:0.7.1:verify failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal com.exasol:error-code-crawler-maven-plugin:0.7.1:verify failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.NullPointerException
at com.exasol.errorcodecrawlermavenplugin.crawler.ArgumentReader.readStringArgumentValue (ArgumentReader.java:43)
at com.exasol.errorcodecrawlermavenplugin.crawler.ArgumentReader.readStringArgumentValue (ArgumentReader.java:39)
at com.exasol.errorcodecrawlermavenplugin.crawler.ArgumentReader.readStringArgumentValue (ArgumentReader.java:38)
at com.exasol.errorcodecrawlermavenplugin.crawler.ArgumentReader.readStringArgumentValue (ArgumentReader.java:38)
at com.exasol.errorcodecrawlermavenplugin.crawler.AbstractTextWithParametersStepReader.read (AbstractTextWithParametersStepReader.java:44)
at com.exasol.errorcodecrawlermavenplugin.crawler.ErrorMessageDeclarationCrawler.addBuilderStep (ErrorMessageDeclarationCrawler.java:200)
at com.exasol.errorcodecrawlermavenplugin.crawler.ErrorMessageDeclarationCrawler.readErrorCode (ErrorMessageDeclarationCrawler.java:162)
at com.exasol.errorcodecrawlermavenplugin.crawler.ErrorMessageDeclarationCrawler.crawl (ErrorMessageDeclarationCrawler.java:123)
at com.exasol.errorcodecrawlermavenplugin.crawler.ErrorMessageDeclarationCrawler.crawl (ErrorMessageDeclarationCrawler.java:70)
at com.exasol.errorcodecrawlermavenplugin.ErrorCodeCrawlerMojo.execute (ErrorCodeCrawlerMojo.java:88)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
public static PostgreSQLIdentifierMapping parse(final String mapping) {
if (mapping != null) {
switch (mapping) {
case "CONVERT_TO_UPPER":
return CONVERT_TO_UPPER;
case "PRESERVE_ORIGINAL_CASE":
return PRESERVE_ORIGINAL_CASE;
default:
throw new IllegalArgumentException(ExaError.messageBuilder("E-PGVS-2")
.message("Unable to parse PostgreSQL identifier mapping \"" + mapping + "\".").toString());
}
} else {
throw new IllegalArgumentException(ExaError.messageBuilder("E-PGVS-1")
.message("Unable to parse PostgreSQL identifier mapping from a null value.").toString());
}
}
To fix this, add a not-null-check to ArgumentReader.java, line 46.
We couldn't reproduce this.
Are you sure you're using the latest version? We got the correct finding with 1 of your exceptions.
Message me or @jakobbraun if you still have the problem. Closing this for now.
When verifying code with string concatenation that involves local variables (see example below), the plugin fails with a NullPointerException:
To fix this, add a not-null-check to ArgumentReader.java, line 46.