FULL PRODUCT VERSION :
Linux tigger 3.13.0-63-generic #103-Ubuntu SMP Fri Aug 14 21:42:59 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
ADDITIONAL OS VERSION INFORMATION :
Linux tigger 3.13.0-63-generic #103-Ubuntu SMP Fri Aug 14 21:42:59 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
Synopsis says it. Anything that implements CharSequence should be a Comparable, for example StringBuilder and StringBuffer. It's not the designer's responsibility to dictate how a class should be used. It's the designer's responsibility to provide functionality as general as possible and a CharSequence is Comparable in general.
REGRESSION. Last worked in version 8u60
ADDITIONAL REGRESSION INFORMATION:
True in every release.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create CharSequenceBug.java and compile using the code provided below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compiling CharSequenceBug.java should compile successfully.
ACTUAL -
Compiling CharSequenceBug.java fails to compile.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Resulting compile returns:
CharSequenceBug.java:8: error: cannot find symbol
System.err.println(sba.compareTo(sbb));
^
symbol: method compareTo(StringBuilder)
location: variable sba of type StringBuilder
1 error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class CharSequenceBug {
public static void main(String[] args) {
StringBuilder sba = new StringBuilder().append("a");
StringBuilder sbb = new StringBuilder().append("b");
System.err.println(sba.toString().compareTo(sbb.toString()));
System.err.println(sba.compareTo(sbb));
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Convert to String. Severity? Simple conversion allows progress, but I need to use the StringBuilder and/or StringBuffer instead.
Linux tigger 3.13.0-63-generic #103-Ubuntu SMP Fri Aug 14 21:42:59 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
ADDITIONAL OS VERSION INFORMATION :
Linux tigger 3.13.0-63-generic #103-Ubuntu SMP Fri Aug 14 21:42:59 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
Synopsis says it. Anything that implements CharSequence should be a Comparable, for example StringBuilder and StringBuffer. It's not the designer's responsibility to dictate how a class should be used. It's the designer's responsibility to provide functionality as general as possible and a CharSequence is Comparable in general.
REGRESSION. Last worked in version 8u60
ADDITIONAL REGRESSION INFORMATION:
True in every release.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create CharSequenceBug.java and compile using the code provided below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compiling CharSequenceBug.java should compile successfully.
ACTUAL -
Compiling CharSequenceBug.java fails to compile.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Resulting compile returns:
CharSequenceBug.java:8: error: cannot find symbol
System.err.println(sba.compareTo(sbb));
^
symbol: method compareTo(StringBuilder)
location: variable sba of type StringBuilder
1 error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class CharSequenceBug {
public static void main(String[] args) {
StringBuilder sba = new StringBuilder().append("a");
StringBuilder sbb = new StringBuilder().append("b");
System.err.println(sba.toString().compareTo(sbb.toString()));
System.err.println(sba.compareTo(sbb));
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Convert to String. Severity? Simple conversion allows progress, but I need to use the StringBuilder and/or StringBuffer instead.
- csr for
-
JDK-8195867 Methods for comparing CharSequence, StringBuilder, and StringBuffer
- Closed
- relates to
-
JDK-8196710 Intrinsify new StringLatin1/StringUTF16 methods
- Open
-
JDK-6664636 [Col] API improvements to minimize memory allocations during unicode processing
- Open
-
JDK-5082260 StringBuffer should implement equals(Object), should take String, CharSequence
- Closed
-
JDK-8035473 [javadoc] Revamp the existing Doclet APIs
- Closed
-
JDK-8203477 reference to [method] is ambiguous
- Closed
(1 relates to)