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

Improve warning for module names ending with digits

XMLWordPrintable

    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      Relates to: JDK-8176802, JDK-8160181, JDK-8216185

      When compiling a module declaration which declares a module with a name ending with a digit, javac emits the following warning:
      > warning: [module] module name component auth0 should avoid terminal digits

      It appears the intention is to prevent users from encoding version information module names (see also JDK-8176802). However, the current warning message does not make this clear.
      Instead it confuses users, as seen with https://mail.openjdk.java.net/pipermail/discuss/2021-March/005775.html
      For that case the correct module name is `com.auth0.jwt`, because:
      - The "principal exported package" is `com.auth0.jwt`
      - The domain is `auth0.com`
      (both being recommended by JLS 16 §6.1)
      However, due to the unspecific javac warning message the user might now end up choosing a different, irritating module name.

      It would therefore be good to improve the warning message emitted by javac, e.g.:
      > warning: [module] Module name ends with a digit. Module names should not encode version information in module names.

      This would not irritate the user anymore but instead they could ignore it as 'false positive' in the case described above.



            sstenzel Sebastian Stenzel
            webbuggrp Webbug Group
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: