RFR: 8303755: Clean up around JavacElements.getAllMembers [v3]

Pavel Rappo prappo at openjdk.org
Wed Mar 8 10:08:10 UTC 2023


On Wed, 8 Mar 2023 08:37:54 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

>> Pavel Rappo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Respond to feedback
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/util/Iterators.java line 83:
> 
>> 81:     }
>> 82: 
>> 83:     // Iterator is assumed to never return null from next()
> 
> Not sure about this comment - it seems to explain what is wrong in the code that is removed?

It's a coincidence: it just happens so that the removed code also implements Iterator.next() by returning null unconditionally. But that comment and the removed code are unrelated.

That comment captures the fact that the filter iterator _below_ that comment relies on the input iterator never to return null from input.next().

-------------

PR: https://git.openjdk.org/jdk/pull/12904


More information about the compiler-dev mailing list