NullPointerException: Cannot invoke "java.lang.CharSequence.toString()" because "target" is null
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- java
- Domain
- build-system, tooling
Research direction
Run the provided Maven reproduction against commit f1028401e3d59bd42aee9ab4d26995991db1aadc, then inspect AnnouncementMojo.processTemplate and doGenerate around the reported AnnouncementMojo.java lines 536, 579, and 624. Done means the same invalid input produces an actionable logged error instead of the NullPointerException.
Written by the indexing model from the issue text.
Description
Affected version
3.0.0-M3
Bug description
Whatever the actual problem is, the plugin should log an actionable error message instead of throwing a NullPointerException.
auncher.Launcher.launch (Launcher.java:201)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.toString()" because "target" is null
at java.lang.String.replace (String.java:3085)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke (UberspectImpl.java:571)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke (UberspectImpl.java:554)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute (ASTMethod.java:221)
at org.apache.velocity.runtime.parser.node.ASTReference.execute (ASTReference.java:368)
at org.apache.velocity.runtime.parser.node.ASTReference.value (ASTReference.java:704)
at org.apache.velocity.runtime.parser.node.ASTExpression.value (ASTExpression.java:75)
at org.apache.velocity.runtime.parser.node.ASTSetDirective.render (ASTSetDirective.java:242)
at org.apache.velocity.runtime.parser.node.SimpleNode.render (SimpleNode.java:439)
at org.apache.velocity.Template.merge (Template.java:358)
at org.apache.velocity.Template.merge (Template.java:262)
at org.apache.maven.plugins.changes.announcement.AnnouncementMojo.processTemplate (AnnouncementMojo.java:624)
at org.apache.maven.plugins.changes.announcement.AnnouncementMojo.doGenerate (AnnouncementMojo.java:579)
at org.apache.maven.plugins.changes.announcement.AnnouncementMojo.doGenerate (AnnouncementMojo.java:536)
at org.apache.maven.plugins.changes.announcement.AnnouncementMojo.execute (AnnouncementMojo.java:519)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)
Reproduce with:
git clone https://github.com/apache/commons-fileupload.git
cd commons-fileupload
git checkout f1028401e3d59bd42aee9ab4d26995991db1aadc
mvn -e --non-recursive changes:announcement-generate -Prelease-notes -Dchanges.version=1.6.0
- Dominant language
- Java
- Stars
- 15
- Forks
- 22
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 7
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/maven-changes-plugin
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 55/100
apache/maven-changes-plugin#650 ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 52/100
apache/maven-changes-plugin#633 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
apache/maven-changes-plugin#619 ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
apache/maven-changes-plugin#610 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 30/100
apache/maven-changes-plugin#608 ·
All issues in apache/maven-changes-plugin
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100