On Tue, 12 Oct 2021 07:10:56 GMT, Vyom Tewari <vtew...@openjdk.org> wrote:

>> Patrick Concannon has updated the pull request with a new target base due to 
>> a merge or a rebase. The incremental webrev excludes the unrelated changes 
>> brought in by the merge/rebase. The pull request contains three additional 
>> commits since the last revision:
>> 
>>  - 8260428: Corrected javadoc typos; combined declaration and initialization 
>> of variables in DSI; refactored dummy impls in test
>>  - Merge remote-tracking branch 'origin/master' into JDK-8260428
>>  - 8260428: Drop support for pre JDK 1.4 DatagramSocketImpl implementations
>
> src/java.base/share/classes/java/net/NetMulticastSocket.java line 346:
> 
>> 344:                         // peek at the packet to see who it is from.
>> 345:                         DatagramPacket peekPacket = new 
>> DatagramPacket(new byte[1], 1);
>> 346:                         peekPort = getImpl().peekData(peekPacket);
> 
> Is it possible for you to combine the variable declaration and assignment as 
> follows ?. This will increase the code readability little bit. 
> 
>  int peekPort = getImpl().peekData(peekPacket);
>  String peekAd = peekPacket.getAddress().getHostAddress();

Good catch, Vyom! Thanks for that. Code updated as suggested - see commit 
67265bd

> src/java.base/share/classes/java/net/NetMulticastSocket.java line 383:
> 
>> 381:                     // peek at the packet to see who it is from.
>> 382:                     DatagramPacket peekPacket = new DatagramPacket(new 
>> byte[1], 1);
>> 383:                     peekPort = getImpl().peekData(peekPacket);
> 
> same as previous comment.

Addressed as above

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

PR: https://git.openjdk.java.net/jdk/pull/5887

Reply via email to