MCPcopy Index your code
hub / github.com/davidgiven/luje / equals

Method equals

lib/java/lang/StackTraceElement.java:100–136  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 1

countDuplicatesMethod · 0.95

Calls 6

getMethodNameMethod · 0.95
getClassNameMethod · 0.95
getFileNameMethod · 0.95
equalsMethod · 0.95
getLineNumberMethod · 0.95
equalsMethod · 0.65

Tested by

no test coverage detected