[ 
https://issues.apache.org/jira/browse/MNG-7637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17648981#comment-17648981
 ] 

Christoph Läubrich commented on MNG-7637:
-----------------------------------------

I see this NPE in test of m2eclipse where the user supplies the following pom:


{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
  <modelVersion>4.0.0</modelVersion>

  some garbage maven project builder can't parse

</project>
{code}



> NPE in MavenProject#hashCode if erornous xml
> --------------------------------------------
>
>                 Key: MNG-7637
>                 URL: https://issues.apache.org/jira/browse/MNG-7637
>             Project: Maven
>          Issue Type: Bug
>            Reporter: Christoph Läubrich
>            Priority: Major
>
> org.apache.maven.project.MavenProject.hashCode() has the following code:
> {code:java}
> public int hashCode()
>     {
>         int hash = 17;
>         hash = 31 * hash + getGroupId().hashCode();
>         hash = 31 * hash + getArtifactId().hashCode();
>         hash = 31 * hash + getVersion().hashCode();
>         return hash;
>     }
> {code}
> if any of those values is null, a NPE is thrown from the method.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to