Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7637

Possible NPE in MavenProject#hashCode()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.8.6, 4.0.0-alpha-3
    • 3.8.7, 3.9.0, 4.0.0-alpha-4, 4.0.0
    • None
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              laeubi Christoph Läubrich
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: