1.1 --- a/emul/src/main/java/java/lang/StackTraceElement.java Sat Sep 29 06:38:34 2012 +0200
1.2 +++ b/emul/src/main/java/java/lang/StackTraceElement.java Wed Jan 23 20:16:48 2013 +0100
1.3 @@ -25,8 +25,6 @@
1.4
1.5 package java.lang;
1.6
1.7 -import java.util.Objects;
1.8 -
1.9 /**
1.10 * An element in a stack trace, as returned by {@link
1.11 * Throwable#getStackTrace()}. Each element represents a single stack frame.
1.12 @@ -68,8 +66,8 @@
1.13 */
1.14 public StackTraceElement(String declaringClass, String methodName,
1.15 String fileName, int lineNumber) {
1.16 - this.declaringClass = Objects.requireNonNull(declaringClass, "Declaring class is null");
1.17 - this.methodName = Objects.requireNonNull(methodName, "Method name is null");
1.18 + this.declaringClass = declaringClass;
1.19 + this.methodName = methodName;
1.20 this.fileName = fileName;
1.21 this.lineNumber = lineNumber;
1.22 }
1.23 @@ -203,8 +201,8 @@
1.24 StackTraceElement e = (StackTraceElement)obj;
1.25 return e.declaringClass.equals(declaringClass) &&
1.26 e.lineNumber == lineNumber &&
1.27 - Objects.equals(methodName, e.methodName) &&
1.28 - Objects.equals(fileName, e.fileName);
1.29 + equals(methodName, e.methodName) &&
1.30 + equals(fileName, e.fileName);
1.31 }
1.32
1.33 /**
1.34 @@ -212,10 +210,14 @@
1.35 */
1.36 public int hashCode() {
1.37 int result = 31*declaringClass.hashCode() + methodName.hashCode();
1.38 - result = 31*result + Objects.hashCode(fileName);
1.39 + result = 31*result + (fileName == null ? 0 : fileName.hashCode());
1.40 result = 31*result + lineNumber;
1.41 return result;
1.42 }
1.43 +
1.44 + private static boolean equals(Object a, Object b) {
1.45 + return (a == b) || (a != null && a.equals(b));
1.46 + }
1.47
1.48 private static final long serialVersionUID = 6992337162326171013L;
1.49 }