XenoAmess commented on a change in pull request #48:
URL:
https://github.com/apache/maven-javadoc-plugin/pull/48#discussion_r443129539
##########
File path: src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
##########
@@ -1815,7 +1831,7 @@ private static CloseableHttpClient createHttpClient(
Settings settings, URL url
builder.setUserAgent( "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.0)" );
// Some server reject requests that do not have an Accept header
- builder.setDefaultHeaders( Arrays.asList( new BasicHeader(
HttpHeaders.ACCEPT, "*/*" ) ) );
+ builder.setDefaultHeaders( Collections.singletonList( new BasicHeader(
HttpHeaders.ACCEPT, "*/*" ) ) );
Review comment:
@elharo
> Immutability makes Collections.singletonList not semantically equivalent
to Arrays.asList
Yes but I don't think a immutable collection used here can be any problem.
I see no change to this collection after passed in as parameter here(in the
codes).
Or please give me an example where can it break.
----------------------------------------------------------------
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]