--- old/src/solaris/classes/sun/nio/fs/UnixFileSystem.java 2012-06-25 21:56:16.000000000 -0700 +++ new/src/solaris/classes/sun/nio/fs/UnixFileSystem.java 2012-06-25 21:56:15.000000000 -0700 @@ -302,7 +302,8 @@ } // return matcher - final Pattern pattern = Pattern.compile(expr); + final Pattern pattern = compilePathMatchPattern(expr); + return new PathMatcher() { @Override public boolean matches(Path path) { @@ -310,11 +311,10 @@ } }; } + private static final String GLOB_SYNTAX = "glob"; private static final String REGEX_SYNTAX = "regex"; - - @Override public final UserPrincipalLookupService getUserPrincipalLookupService() { return LookupService.instance; @@ -339,4 +339,39 @@ }; } + // BsdFileSystem overrides following methods for MacOSX path + Pattern compilePathMatchPattern(String expr) { + return Pattern.compile(expr); + } + + char[] normalizeNativePath(char[] path) { + return path; + } + + String normalizeJavaPath(String path) { + return path; + } + + public int hashCodePath(UnixPath path) { + return sun.misc.Hashing.murmur3_32(path.asByteArray()); + } + + int comparePaths(UnixPath path1, UnixPath path2) { + byte[] v1 = path1.asByteArray(); + byte[] v2 = path2.asByteArray(); + int len1 = v1.length; + int len2 = v2.length; + int n = Math.min(len1, len2); + int k = 0; + while (k < n) { + int c1 = v1[k] & 0xff; + int c2 = v2[k] & 0xff; + if (c1 != c2) { + return c1 - c2; + } + k++; + } + return len1 - len2; + } + }