--- old/src/java.base/windows/classes/sun/nio/fs/WindowsChannelFactory.java 2016-05-30 16:31:32.000000000 +0100 +++ new/src/java.base/windows/classes/sun/nio/fs/WindowsChannelFactory.java 2016-05-30 16:31:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,8 +34,6 @@ import java.nio.file.StandardOpenOption; import java.util.Set; -import com.sun.nio.file.ExtendedOpenOption; - import jdk.internal.misc.JavaIOFileDescriptorAccess; import jdk.internal.misc.SharedSecrets; import sun.nio.ch.FileChannelImpl; @@ -103,15 +101,6 @@ } continue; } - if (option instanceof ExtendedOpenOption) { - switch ((ExtendedOpenOption)option) { - case NOSHARE_READ : flags.shareRead = false; break; - case NOSHARE_WRITE : flags.shareWrite = false; break; - case NOSHARE_DELETE : flags.shareDelete = false; break; - default: throw new UnsupportedOperationException(); - } - continue; - } if (option == LinkOption.NOFOLLOW_LINKS) { flags.noFollowLinks = true; continue; @@ -120,6 +109,18 @@ flags.openReparsePoint = true; continue; } + if (ExtendedOptions.NOSHARE_READ.matches(option)) { + flags.shareRead = false; + continue; + } + if (ExtendedOptions.NOSHARE_WRITE.matches(option)) { + flags.shareWrite = false; + continue; + } + if (ExtendedOptions.NOSHARE_DELETE.matches(option)) { + flags.shareDelete = false; + continue; + } if (option == null) throw new NullPointerException(); throw new UnsupportedOperationException();