package org.eclipse.tracecompass.tmf.core.event.lookup;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.equalsNullable;
/**
* TMF call site information for source code lookup.
*
- * @since 2.0
* @author Bernd Hufmann
*/
public class TmfCallsite implements ITmfCallsite {
// ------------------------------------------------------------------------
/** The file name string. */
- final private String fFileName;
+ private final String fFileName;
/** The function name. */
- final private String fFunctionName;
+ private final String fFunctionName;
/** The line number. */
- final private long fLineNumber;
+ private final long fLineNumber;
// ------------------------------------------------------------------------
// Constructors
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + fFileName.hashCode(); // fFileName cannot be null
+ // fFileName cannot be null!
+ result = prime * result + fFileName.hashCode();
result = prime * result + ((fFunctionName == null) ? 0 : fFunctionName.hashCode());
result = prime * result + (int) (fLineNumber ^ (fLineNumber >>> 32));
return result;
return false;
}
- if (fFunctionName == null) {
- if (other.fFunctionName != null) {
- return false;
- }
- } else if (!fFunctionName.equals(other.fFunctionName)) {
+ if (!equalsNullable(fFunctionName, other.fFunctionName)) {
return false;
}
if (fLineNumber != other.fLineNumber) {