+ public void dump(PrintWriter pw, int indent)
+ {
+ String margin = String.format("%" + indent + "s", "");
+ String tab = margin + " ";
+ pw.println(margin + "Location");
+ if (null != m_className) {
+ pw.println(tab + "classname = " + m_className);
+ }
+ if (null != m_methodName) {
+ if (null != m_methodRole) {
+ pw.println(tab + "method = " + m_methodName + " (" + m_methodRole + ")");
+ }
+ else {
+ pw.println(tab + "method = " + m_methodName);
+ }
+ }
+ if (null != m_startLine) {
+ pw.println(tab + "lines = " + m_startLine + " .. " + m_endLine);
+ }
+ }
+
+ public boolean fuzzyEquals(Location that)
+ {
+ if (null == that) {
+ return false;
+ }
+
+ if (! Util.objsAreEqual(this.m_className, that.m_className)) {
+ return false;
+ }
+
+ if (! Util.objsAreEqual(this.m_methodName, that.m_methodName)) {
+ return false;
+ }
+
+ if (! Util.objsAreEqual(this.m_methodRole, that.m_methodRole)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public boolean equals(Object other)
+ {
+ if (null == other) {
+ return false;
+ }
+ if (other instanceof Location) {
+ return fuzzyEquals((Location)other);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return Util.objHashCode(m_className)
+ ^ Util.objHashCode(m_methodName)
+ ^ Util.objHashCode(m_methodRole);
+ }
+