RFR (JDK11) 8137326: Methods for comparing CharSequence, StringBuilder, and StringBuffer
huizhe.wang at oracle.com
Fri Jan 26 03:00:07 UTC 2018
Adding methods for comparing CharSequence, StringBuilder, and StringBuffer.
The Comparable implementations for StringBuilder/Buffer are similar to
that of String, allowing comparison operations between two
aStringBuilder.compareTo(anotherStringBuilder). For CharSequence
however, refer to the comments in JIRA, a static method 'compare' is
added instead of implementing the Comparable interface. This 'compare'
method may take CharSequence implementations such as String,
StringBuilder and StringBuffer, making it possible to perform comparison
among them. The previous example for example is equivalent to
Tests for java.base have been independent from each other. The new tests
are therefore created to have no dependency on each other or sharing any
More information about the core-libs-dev