Compare two paths after normalization of them.
@param path1 first path for comparison
@param path2 second path for comparison
@return whether the two paths are equivalent after normalization
631
public static boolean pathEquals(String path1, String path2) {
        return cleanPath(path1).equals(cleanPath(path2));
    }
1024349
def compare_root_path(path_cost1, path_cost2, bridge_id1, bridge_id2,
                          port_id1, port_id2):
        
        result = Stp._cmp_value(path_cost1, path_cost2)
        if not result:
            result = Stp._cmp_value(bridge_id1, bridge_id2)
            if not result:
                result = Stp._cmp_value(port_id1, port_id2)
        return result
772797
public static boolean compare(Document d1, Document d2) throws MarshalException {
		d1.normalize();
		d2.normalize();
		return d1.isEqualNode(d2);
	}
639885
public static boolean entryEquals(ZipFile zf1, ZipFile zf2, String path1, String path2) {
    try {
      return doEntryEquals(zf1, zf2, path1, path2);
    }
    catch (IOException e) {
      throw ZipExceptionUtil.rethrow(e);
    }
  }
1024240
public boolean areEquals(String str1, String str2) {

		return (str1 == null && str2 == null || str1 != null && str2 != null && str1.equals(str2));
	}
1349226
public static int compareVersions(String v1, String v2) {
		String s1 = normalisedVersion(v1);
		String s2 = normalisedVersion(v2);
		return s1 != null ? (s2 != null ? s1.compareTo(s2) : 1)
				: (s2 != null ? -1 : 0);
	}
581102
protected final boolean compareKeys(K k1, K k2) {
        return k1 == k2 || (k1 != null && k1.equals(k2));
    }
161239
public int compareTo(Path o) {

        // Sanity check.
        if (o == null) {
            throw new NullPointerException();
        }

        // If these are not the same type, do the simple comparison.
        if (this.type != o.type) {
            return type.compareTo(o.type);
        }

        // Same type of path, so check first the number of terms. If not equal,
        // then it is easy to decide the order. (Longer paths come before
        // shorter ones.)
        int mySize = this.terms.length;
        int otherSize = o.terms.length;
        if (mySize != otherSize) {
            return (mySize < otherSize) ? 1 : -1;
        }

        // Ok, the hard case, the two paths are of the same type and have the
        // same number of terms.
        for (int i = 0; i < mySize; i++) {
            Term myTerm = this.terms[i];
            Term otherTerm = o.terms[i];
            int comparison = myTerm.compareTo(otherTerm);
            if (comparison != 0) {
                return comparison;
            }
        }

        // We've gone through all of the checks, so the two paths must be equal;
        // return zero.
        return 0;
    }
194963
public static boolean entryEquals(File f1, File f2, String path) {
    return entryEquals(f1, f2, path, path);
  }
529062
public int comparePath(String[] otherPath) {
        if (path == null)
            return -1;
        else if (otherPath == null)
            return 1;

        int minLen = (path.length < otherPath.length) ? path.length : otherPath.length;

        for (int i = 0; i < minLen; i++) {
            int result = path[i].compareTo(otherPath[i]);
            if (result != 0)
                return result;
        }

        return path.length - otherPath.length;
    }
1359976
function(p1, p2)
	{
		var min = Math.min(p1.length, p2.length);
		var comp = 0;
		
		for (var i = 0; i < min; i++)
		{
			if (p1[i] != p2[i])
			{
				if (p1[i].length == 0 ||
					p2[i].length == 0)
				{
					comp = (p1[i] == p2[i]) ? 0 : ((p1[i] > p2[i]) ? 1 : -1);
				}
				else
				{
					var t1 = parseInt(p1[i]);
					var t2 = parseInt(p2[i]);
					
					comp = (t1 == t2) ? 0 : ((t1 > t2) ? 1 : -1);
				}
				
				break;
			}
		}
		
		// Compares path length if both paths are equal to this point
		if (comp == 0)
		{
			var t1 = p1.length;
			var t2 = p2.length;
			
			if (t1 != t2)
			{
				comp = (t1 > t2) ? 1 : -1;
			}
		}
		
		return comp;
	}
797281
def samefile(path1, path2, user=None):
    
    def tr(p):
        return abspath(normpath(realpath(p)), user=user)
    return tr(path1) == tr(path2)
1341075
public static boolean pathEquals(File file1, File file2) {
		if (isWindows()) {
			// Windows环境
			try {
				if (StrUtil.equalsIgnoreCase(file1.getCanonicalPath(), file2.getCanonicalPath())) {
					return true;
				}
			} catch (Exception e) {
				if (StrUtil.equalsIgnoreCase(file1.getAbsolutePath(), file2.getAbsolutePath())) {
					return true;
				}
			}
		} else {
			// 类Unix环境
			try {
				if (StrUtil.equals(file1.getCanonicalPath(), file2.getCanonicalPath())) {
					return true;
				}
			} catch (Exception e) {
				if (StrUtil.equals(file1.getAbsolutePath(), file2.getAbsolutePath())) {
					return true;
				}
			}
		}
		return false;
	}
371886
public static boolean isSibling(String p1, String p2)
   {
      int pos1 = p1.lastIndexOf('/');
      int pos2 = p2.lastIndexOf('/');
      return (pos1 == pos2 && pos1 >= 0 && p1.regionMatches(0, p2, 0, pos1));
   }
470475
@Override
    public int compare(DependencyReportToArchiveEdgeModel o1, DependencyReportToArchiveEdgeModel o2)
    {
        String path1 = o1.getFullPath();
        String path2 = o2.getFullPath();
        return filePathComparator.compare(path1, path2);
    }
604287
private void sortPathByDepth(Path[] paths) {
    Arrays.sort(paths, new Comparator<Path> (){
      @Override
      public int compare(Path o1, Path o2) {
        return ((Integer)o1.depth()).compareTo(o2.depth());
      }});
  }
548662
public static boolean areEquals(final String s1, final String s2) {
        return s1 == null ? s2 == null : s1.equals(s2);
    }