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

ASF GitHub Bot commented on MNG-7597:
-------------------------------------

kwin commented on code in PR #872:
URL: https://github.com/apache/maven/pull/872#discussion_r1023582782


##########
maven-core/src/main/java/org/apache/maven/internal/impl/PropertiesAsMap.java:
##########
@@ -67,28 +67,30 @@ public boolean hasNext()
                     @Override
                     public Entry<String, String> next()
                     {
-                        if ( next == null )
+                        if ( !hasNext() )

Review Comment:
   although functionally correct I still find it weird to change the state in 
`hasNext()`. Why not put the logic to look for the next entry in `next` and 
simplify `hasNext()` with a simple check if `next == null` Also I find it very 
confusing that `next = null` when the end of the iterator has not yet been 
reached





> Infinite loop in PropertiesAsMap
> --------------------------------
>
>                 Key: MNG-7597
>                 URL: https://issues.apache.org/jira/browse/MNG-7597
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 4.0.0-alpha-2
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>            Priority: Major
>             Fix For: 4.0.0-alpha-3
>
>




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

Reply via email to