-
CSR
-
Resolution: Approved
-
P4
-
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>
*
- csr of
-
JDK-8276826 Clarify the ModuleDescriptor.Version specification’s treatment of repeated punctuation characters
-
- Resolved
-
- links to
-
Review openjdk/jdk18/39