Markus Spann created JXR-170: -------------------------------- Summary: NullPointerException while parsing Java 15 multi-line String source containing reserved Java keyword Key: JXR-170 URL: https://issues.apache.org/jira/browse/JXR-170 Project: Maven JXR Issue Type: Bug Components: maven2 jxr plugin Affects Versions: 3.2.0 Reporter: Markus Spann
Encountering {{NullPointerException}} in the aggregate goal while parsing a Java source that makes use of new Java 15 multi-line Strings containing a reserved Java keyword i.e. {{{}import{}}}. Caused by: java.lang.NullPointerException: Cannot invoke "String.length()" because "name" is null at org.apache.maven.jxr.pacman.JavaFileImpl.parseRecursive (JavaFileImpl.java:128) at org.apache.maven.jxr.pacman.JavaFileImpl.parseRecursive (JavaFileImpl.java:144) at org.apache.maven.jxr.pacman.JavaFileImpl.parse (JavaFileImpl.java:74) at org.apache.maven.jxr.pacman.JavaFileImpl.<init> (JavaFileImpl.java:59) Command-line: {color:#e01e5a}mvn org.apache.maven.plugins:maven-jxr-plugin:3.2.0:aggregate{color} The plugin stumbles at following statement in my project (a code generator): {code:java} Code codeImport = new Code().addFormat(""" import {0}; import java.util.List; """, constantsClass.getName() ); {code} Same error in older versions of the plugin. The only work-around I found was to exclude the source from jxr in its Maven configuration: {code:java} <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jxr-plugin</artifactId> <configuration> <linkJavadoc>false</linkJavadoc> <skip>false</skip> <excludes> <exclude>**/ClassFailinginJxr.java</exclude> </excludes> </configuration> </plugin> </plugins> </pluginManagement> {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)