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

Clarify the ModuleDescriptor.Version specification’s treatment of repeated punctuation characters

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 18, 19
    • core-libs
    • None
    • minimal
    • This is a specification clarification; there is no change to any code.
    • Java API
    • SE

      Summary

      Clarify the specification of the java.lang.ModuleDescriptor.Version class to say that consecutive repeated punctuation characters are treated as a single punctuation character, which is the behavior of the implementation.

      Problem

      The specification does not presently address the question of how repeated punctuation characters are handled. This came up in the PR discussion of JDK-8250678, which fixed an inconsistency in the treatment of repeated punctuation characters in the pre-release and build segments of a version string.

      Specification

      --- a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
      +++ b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
      @@ -893,7 +893,8 @@ public class ModuleDescriptor
            * integer or a string.  Tokens are separated by the punctuation characters
            * {@code '.'}, {@code '-'}, or {@code '+'}, or by transitions from a
            * sequence of digits to a sequence of characters that are neither digits
      -     * nor punctuation characters, or vice versa.
      +     * nor punctuation characters, or vice versa.  Consecutive repeated
      +     * punctuation characters are treated as a single punctuation character.
            *
            * <ul>
            *

            mr Mark Reinhold
            mchung Mandy Chung (Inactive)
            Alan Bateman, Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: