Description
In AbstractEarModule.java:336-338, a NullPointerException occurs if generateId is true but the artifact has not been resolved:
if (generateId) {
Artifact theArtifact = getArtifact();
String generatedId = theArtifact.getType().toUpperCase() + "_" + theArtifact.getGroupId() + "."
+ theArtifact.getArtifactId();
getArtifact() is documented in the EarModule interface as returning null until the artifact is resolved. If a module's artifact is not yet resolved when generateId is true, .getType() throws an NPE.
Expected behavior
Add a null check before generating the ID:
if (generateId) {
Artifact theArtifact = getArtifact();
if (theArtifact == null) {
return;
}
...
}
Description
In
AbstractEarModule.java:336-338, a NullPointerException occurs ifgenerateIdis true but the artifact has not been resolved:getArtifact()is documented in theEarModuleinterface as returningnulluntil the artifact is resolved. If a module's artifact is not yet resolved whengenerateIdis true,.getType()throws an NPE.Expected behavior
Add a null check before generating the ID: