Compares this instance with the specified object and indicates if they are equal. In order to be equal, the following conditions must be fulfilled: obj must be a stack trace element, the method names of this stack trace element and of obj must not be null,</
(Object obj)
| 98 | * @see #hashCode |
| 99 | */ |
| 100 | @Override |
| 101 | public boolean equals(Object obj) { |
| 102 | if (!(obj instanceof StackTraceElement)) { |
| 103 | return false; |
| 104 | } |
| 105 | StackTraceElement castObj = (StackTraceElement) obj; |
| 106 | |
| 107 | /* |
| 108 | * Unknown methods are never equal to anything (not strictly to spec, |
| 109 | * but spec does not allow null method/class names) |
| 110 | */ |
| 111 | if ((methodName == null) || (castObj.methodName == null)) { |
| 112 | return false; |
| 113 | } |
| 114 | |
| 115 | if (!getMethodName().equals(castObj.getMethodName())) { |
| 116 | return false; |
| 117 | } |
| 118 | if (!getClassName().equals(castObj.getClassName())) { |
| 119 | return false; |
| 120 | } |
| 121 | String localFileName = getFileName(); |
| 122 | if (localFileName == null) { |
| 123 | if (castObj.getFileName() != null) { |
| 124 | return false; |
| 125 | } |
| 126 | } else { |
| 127 | if (!localFileName.equals(castObj.getFileName())) { |
| 128 | return false; |
| 129 | } |
| 130 | } |
| 131 | if (getLineNumber() != castObj.getLineNumber()) { |
| 132 | return false; |
| 133 | } |
| 134 | |
| 135 | return true; |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * Returns the fully qualified name of the class belonging to this |
no test coverage detected