You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Hudson (Jira)" <ji...@apache.org> on 2020/03/28 14:58:02 UTC

[jira] [Commented] (MNG-5075) MavenProject.getParent throws undocumented ISE

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

Hudson commented on MNG-5075:
-----------------------------

Build failed in Jenkins: Maven TLP » maven-studies » maven-metrics #4

See https://builds.apache.org/job/maven-box/job/maven-studies/job/maven-metrics/4/

> MavenProject.getParent throws undocumented ISE
> ----------------------------------------------
>
>                 Key: MNG-5075
>                 URL: https://issues.apache.org/jira/browse/MNG-5075
>             Project: Maven
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 3.0.3
>            Reporter: Jesse N. Glick
>            Assignee: stephenconnolly
>            Priority: Major
>             Fix For: 3.2.1
>
>         Attachments: MavenProject-getParent-ISE.diff
>
>
> http://bugzilla-attachments-197994.netbeans.org/bugzilla/attachment.cgi?id=107899 shows a stack trace encountered when calling {{MavenProject.getParent}} on a project with some errors (probably POMs missing in the local repository).
> This method has no Javadoc comment, so it is hard to know exactly what it is permitted/supposed to do, but {{hasParent}} implies that {{null}} is a valid return value, and there is no {{throws IllegalStateException}} clause. The attached patch brings the behavior in line with that signature. (I think I got the {{PlexusTestCase}} infrastructure working with all the required wiring but it may be possible to simplify the test case.)
> Cleaner might be to just declare {{getParent}} (and also {{hasParent}}?) to throw {{ProjectBuildingException}}, though this would be a source-incompatible change. (Only binary-incompatible for clients which are already catching {{IllegalStateException}}!)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)