RFR: 8312444: Delete unused parameters and variables in SocketPermission [v2]

Daniel Fuchs dfuchs at openjdk.org
Thu Mar 7 16:23:55 UTC 2024


On Sat, 2 Mar 2024 13:51:04 GMT, Korov <duke at openjdk.org> wrote:

>> Removing unused parameter `defval` in `SocketPermission.initEphemeralPorts`, so the variable `PRIV_PORT_MAX` and `DEF_EPH_LOW` unused too.
>> 
>> Removing unused parameter `cname` in `SocketPermission.authorizedIPv4` and `SocketPermission.authorizedIPv6`.
>> 
>> Parameter 'action' must be not empty so `a.length > 0`, the check `a.length - 1 < 0` can be removed.
>
> Korov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Modiy the code accordingto the review

Changes requested by dfuchs (Reviewer).

Changes requested by dfuchs (Reviewer).

src/java.base/share/classes/java/net/SocketPermission.java line 230:

> 228:     private transient int[] portrange;
> 229: 
> 230:     private transient boolean defaultDeny = false;

This is used by internal whitebox test. Please revert this change.

src/java.base/share/classes/java/net/SocketPermission.java line 305:

> 303:     }
> 304: 
> 305:     private void setDeny() {

This method is used in internal whitebox tests - please revert this change

src/java.base/share/classes/java/net/SocketPermission.java line 622:

> 620:         try {
> 621:             if (!trustNameService && (defaultDeny ||
> 622:                 sun.net.www.URLConnection.isProxiedHost(hostname))) {

This is important for some internal whitebox test. Please revert this change.

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

PR Review: https://git.openjdk.org/jdk/pull/18086#pullrequestreview-1922908361
PR Review: https://git.openjdk.org/jdk/pull/18086#pullrequestreview-1922920954
PR Review Comment: https://git.openjdk.org/jdk/pull/18086#discussion_r1516455295
PR Review Comment: https://git.openjdk.org/jdk/pull/18086#discussion_r1516447605
PR Review Comment: https://git.openjdk.org/jdk/pull/18086#discussion_r1516450866



More information about the security-dev mailing list