Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8328501

Incorrect `@since` tags for java security interfaces

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • None
    • security-libs

      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

            nbenalla Nizar Benalla
            nbenalla Nizar Benalla
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: