juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [juneau] lcc commented on a change in pull request #55: Java api fixes
Date Thu, 12 Nov 2020 21:18:11 GMT

lcc commented on a change in pull request #55:
URL: https://github.com/apache/juneau/pull/55#discussion_r522431953



##########
File path: juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/IOUtils.java
##########
@@ -473,10 +474,7 @@ public static int getBufferSize(String contentLength) {
 	 * @param is The input stream to close.
 	 */
 	public static void closeQuietly(InputStream is) {
-		try {
-			if (is != null)
-				is.close();
-		} catch (IOException e) {}
+

Review comment:
       This method calls is.close() and is is an InputStream. Java's documentation states
that [InputStream close()](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html#close--)
doesn't do anything.
   
   Since is.close() doesn't do anything (including throwing an IOException), having a closeQuietly
method is IMHO a little confusing.




----------------------------------------------------------------
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:
users@infra.apache.org



Mime
View raw message