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

DefaultArtifact.equals throws NullPointerException if o.version is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.9.1, 4.0.0-alpha-5
    • 4.0.0-alpha-7, 4.0.0
    • None
    • None

    Description

      DefaultArtifact.validateIdentity() only throws if BOTH version and versionRange are null, so it's possible to create an instance of DefaultArtifact where version == null. If such an instance ever ends up in DefaultArtifact.equals(o), the check a.getVersion().equals(version) will throw a NullPointerException.

      (This was observed while debugging an issue in versions-maven-plugin)

      Attachments

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              tgr Tobias Gruetzmacher
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: