提交 d9f3af5f 编写于 作者: J Jesse Glick

Trying to diagnose an NPE associated with cloudbees-template.

In 1.516:
java.lang.NullPointerException
	at hudson.maven.ModuleName.equals(ModuleName.java:115)
	at hudson.maven.MavenModuleSet.reconfigure(MavenModuleSet.java:1108)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.parsePoms(MavenModuleSetBuild.java:907)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:631)
上级 abb64edf
......@@ -31,6 +31,7 @@ import org.apache.maven.model.Dependency;
import org.apache.maven.model.ReportPlugin;
import java.io.Serializable;
import javax.annotation.Nonnull;
/**
* Version independent name of a Maven project. GroupID+artifactId.
......@@ -39,10 +40,16 @@ import java.io.Serializable;
* @see ModuleDependency
*/
public class ModuleName implements Comparable<ModuleName>, Serializable {
public final String groupId;
public final String artifactId;
public final @Nonnull String groupId;
public final @Nonnull String artifactId;
public ModuleName(String groupId, String artifactId) {
if (groupId == null) {
throw new NullPointerException("Must specify groupId");
}
if (artifactId == null) {
throw new NullPointerException("Must specify artifactId");
}
this.groupId = groupId;
this.artifactId = artifactId;
}
......
......@@ -37,6 +37,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.ArrayList;
import javax.annotation.Nonnull;
/**
* Serializable representation of the key information obtained from Maven POM.
......@@ -51,7 +52,7 @@ final class PomInfo implements Serializable {
public static final String PACKAGING_TYPE_PLUGIN = "maven-plugin";
public final ModuleName name;
public final @Nonnull ModuleName name;
/**
* This is a human readable name of the POM. Not necessarily unique
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册