hg: jdk7/tl/jdk: 6991528: Support making Throwable.suppressedExceptions immutable
Rémi Forax
forax at univ-mlv.fr
Thu Dec 9 09:37:05 UTC 2010
Le 09/12/2010 05:57, Joe Darcy a écrit :
> Rémi Forax wrote:
>> Le 14/11/2010 16:23, joe.darcy at oracle.com a écrit :
>>> Changeset: e1a1a2f5d7e1
>>> Author: darcy
>>> Date: 2010-11-14 07:22 -0800
>>> URL: http://hg.openjdk.java.net/jdk7/tl/jdk/rev/e1a1a2f5d7e1
>>>
>>> 6991528: Support making Throwable.suppressedExceptions immutable
>>> Reviewed-by: mchung, dholmes
>>>
>>> ! src/share/classes/java/lang/StackTraceElement.java
>>> ! src/share/classes/java/lang/Throwable.java
>>> ! test/java/lang/Throwable/StackTraceSerialization.java
>>> ! test/java/lang/Throwable/SuppressedExceptions.java
>>>
>>
>> Hi Joe,
>> StackTraceElement.equals checks if methodName is null
>> even if it can not be null by construction.
>> Also the code can be a little more efficient
>> if the lineNumber are checked before checking the declaring class.
>>
>> The code should be:
>>
>> return e.lineNumber == lineNumber &&
>> e.declaringClass.equals(declaringClass) &&
>> methodName.equals(e.methodName) &&
>> Objects.equals(fileName, e.fileName);
>>
>> Rémi
>
> Hi Rémi.
>
> I'll consider making those changes when I go back to make the
> Throwable.stackTrace field immutable (6998871).
>
> Thanks,
>
> -Joe
Hi Joe,
Thanks for tracking this.
In my opinion you should also get ride of PrintStreamOrWriter by using
an Appendable
or by introducing a common interface for PrintWriter and PrintStream
declaring
print/println.
Rémi
More information about the core-libs-dev
mailing list