RFR: 8297778: Modernize and improve module jdk.sctp

Per Minborg pminborg at openjdk.org
Wed Nov 30 08:34:20 UTC 2022


On Tue, 29 Nov 2022 17:17:12 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> This PR proposes a variety of modernisations to the `jdk.sctp` module.
>> 
>> During the fix of https://bugs.openjdk.org/browse/JDK-8296024, several improvement areas were identified including: 
>> 
>> * Replacing duplicate code segments 
>> * Making certain fields final 
>> * Using enhanced switch 
>> * Using records 
>> * Fixing typos 
>> * Marking fields participating in serialisation with `@Serial` 
>> * Modernizing toString() implementations 
>> * Using pattern matching 
>> * Using diamond operators
>
> src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java line 33:
> 
>> 31: import java.io.FileDescriptor;
>> 32: import java.io.IOException;
>> 33: import java.util.*;
> 
> It would be better to avoid wildcards in regular imports.

Agreed. I would have to find the settings in my IDE to prevent this automatic "feature".

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

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



More information about the security-dev mailing list