liyafan82 commented on a change in pull request #8173:
[FLINK-12189][Runtime]Fix bugs and typos in memory management related…
URL: https://github.com/apache/flink/pull/8173#discussion_r275242037
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/memory/MemoryManager.java
##########
@@ -387,11 +387,11 @@ public void release(MemorySegment segment) {
*
* @param segments The segments to be released.
* @throws NullPointerException Thrown, if the given collection is null.
- * @throws IllegalArgumentException Thrown, id the segments are of an
incompatible type.
+ * @throws IllegalArgumentException Thrown, if the segments are of an
incompatible type.
*/
public void release(Collection<MemorySegment> segments) {
if (segments == null) {
- return;
+ throw new NullPointerException();
}
Review comment:
> Why should it throw NullPointerException? Besides, I think a test case is
needed if it should throw NullPointerException.
Hi chunweilei, thanks a lot for your comments. The Javadoc for this method
says "@throws NullPointerException Thrown, if the given collection is null."
So an NPE should be thrown, or this comment should be removed.
According to the style of the other part of the code, I think throwing an
NPE is preferred.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services