RFR: 8353642: Deprecate URL::getPermission method and networking permission classes for removal [v4]
Daniel Fuchs
dfuchs at openjdk.org
Mon May 12 15:18:53 UTC 2025
On Fri, 9 May 2025 19:18:58 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> src/java.base/share/classes/sun/net/www/protocol/file/FileURLConnection.java line 214:
>>
>>> 212: */
>>> 213: @Override
>>> 214: @Deprecated(since = "25", forRemoval = true)
>>
>> Is this annotation required or more as a reminder that the superclass method is deprecated?
>
> I think it's needed because the superclass method is deprecated for removal. Will double check.
Yes - it is needed. If you override a deprecated method you need to carry the deprecation annotation over. Here is what I got when I tried to remove the annotation on `HttpURLConnection::getPermission()` (the same error occurred on any subclass where I attempted to remove the annotation):
java/net/HttpURLConnection.java:615: warning: [dep-ann] deprecated item is not annotated with @Deprecated
public Permission getPermission() throws IOException {
^
error: warnings found and -Werror specified
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24592#discussion_r2084915172
More information about the net-dev
mailing list