You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2022/12/18 10:19:00 UTC
[jira] [Commented] (MNG-7637) NPE in MavenProject#hashCode if erornous xml
[ https://issues.apache.org/jira/browse/MNG-7637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17648980#comment-17648980 ]
Michael Osipov commented on MNG-7637:
-------------------------------------
Can they really be null at times?
> 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:
> public int hashCode()
> {
> int hash = 17;
> hash = 31 * hash + getGroupId().hashCode();
> hash = 31 * hash + getArtifactId().hashCode();
> hash = 31 * hash + getVersion().hashCode();
> return hash;
> }
> 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)