Rémi Forax wrote:
Le 14/11/2010 16:23, [email protected] 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