RFR: 8353642: Deprecate URL::getPermission method and networking permission classes for removal [v4]

Daniel Fuchs dfuchs at openjdk.org
Mon May 12 15:24:52 UTC 2025


On Fri, 9 May 2025 19:19:03 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> src/java.base/share/classes/java/net/HttpURLConnection.java line 615:
>> 
>>> 613:      */
>>> 614:     @Deprecated(since = "25", forRemoval = true)
>>> 615:     @SuppressWarnings("removal")
>> 
>> Do you still need this annotation now that `SocketPermission` is not deprecated for removal?
>
> Ah - good point - I will double check.

Yes - it is needed as well. Apparently if you override a deprecated method you need both `@Deprecated` and `@SuppressWarning`:


src/java.base/share/classes/java/net/HttpURLConnection.java:615: warning: [removal] getPermission() in URLConnection has been deprecated and marked for removal
    public Permission getPermission() throws IOException {
                      ^
error: warnings found and -Werror specified

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24592#discussion_r2084927109


More information about the net-dev mailing list