-
Bug
-
Resolution: Fixed
-
P4
-
None
-
b22
For context, I am writing tests to check for accurate use of `@since` tags in documentation comments in source code.
We're following these rules for now:
if there's no `@since`:
- for methods, look at the `@since` from the method from supertype this method overrides. If there's none from the overridden method, or if the `@since` in the enclosing class is newer that the one from the overridden method, use the `@since` from the enclosing element. Otherwise, use the `@since` from the overridden method.
- otherwise, use the `@since` from the enclosing element.
The override of `getParams` in these interfaces was added in java 22 has an `@since 22`, but the method has been inherited to these interfaces for a long times,
As pointed out by my mentor Jan,
```
import javax.crypto.interfaces.DHPublicKey;
public class DhkeyTest {
public static void main(DHPublicKey key) {
System.err.println(key.getParams());
}
}
```
this compiles using JDK 8 without any compile-time errors. The @since tag shouldn't be here
- the same goes for these other interfaces
java.security.interfaces.DSAPublicKey
java.security.interfaces.XECPublicKey
java.security.interfaces.DSAPrivateKey
java.security.interfaces.ECPrivateKey
java.security.interfaces.XECPrivateKey
java.security.interfaces.EdECPrivateKey
java.security.interfaces.ECPublicKey
java.security.interfaces.EdECPublicKey
javax.crypto.interfaces.DHPrivateKey
javax.crypto.interfaces.DHPublicKey
java.security.interfaces.RSAPublicKey
java.security.interfaces.RSAPrivateKey
We're following these rules for now:
if there's no `@since`:
- for methods, look at the `@since` from the method from supertype this method overrides. If there's none from the overridden method, or if the `@since` in the enclosing class is newer that the one from the overridden method, use the `@since` from the enclosing element. Otherwise, use the `@since` from the overridden method.
- otherwise, use the `@since` from the enclosing element.
The override of `getParams` in these interfaces was added in java 22 has an `@since 22`, but the method has been inherited to these interfaces for a long times,
As pointed out by my mentor Jan,
```
import javax.crypto.interfaces.DHPublicKey;
public class DhkeyTest {
public static void main(DHPublicKey key) {
System.err.println(key.getParams());
}
}
```
this compiles using JDK 8 without any compile-time errors. The @since tag shouldn't be here
- the same goes for these other interfaces
java.security.interfaces.DSAPublicKey
java.security.interfaces.XECPublicKey
java.security.interfaces.DSAPrivateKey
java.security.interfaces.ECPrivateKey
java.security.interfaces.XECPrivateKey
java.security.interfaces.EdECPrivateKey
java.security.interfaces.ECPublicKey
java.security.interfaces.EdECPublicKey
javax.crypto.interfaces.DHPrivateKey
javax.crypto.interfaces.DHPublicKey
java.security.interfaces.RSAPublicKey
java.security.interfaces.RSAPrivateKey
- relates to
-
JDK-8318096 Introduce AsymmetricKey interface with a getParams method
- Resolved
- links to
-
Commit openjdk/jdk/ae60d845
-
Review(master) openjdk/jdk/18373