diff options
author | jfrijters <jfrijters> | 2011-01-24 19:40:22 +0300 |
---|---|---|
committer | jfrijters <jfrijters> | 2011-01-24 19:40:22 +0300 |
commit | bc2c6b1a72cff1846469b418f8a8a272f5190528 (patch) | |
tree | ce8a853125e6a5a5942a5db397acd31376dd67a2 /openjdk/sun/nio/ch/Util.java | |
parent | e6457788e8098e8cfde737cbc14bbc056222dc58 (diff) |
Integrated OpenJDK 6 b21.
Diffstat (limited to 'openjdk/sun/nio/ch/Util.java')
-rw-r--r-- | openjdk/sun/nio/ch/Util.java | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/openjdk/sun/nio/ch/Util.java b/openjdk/sun/nio/ch/Util.java index 71771abb..e074c5b2 100644 --- a/openjdk/sun/nio/ch/Util.java +++ b/openjdk/sun/nio/ch/Util.java @@ -1,12 +1,12 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2000, 2007, 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 * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this + * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. + * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @@ -18,9 +18,9 @@ * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package sun.nio.ch; @@ -54,9 +54,9 @@ class Util { this.sel = sel; } public void run () { - try { + try { sel.close(); - } catch (Throwable th) { + } catch (Throwable th) { throw new Error(th); } } @@ -79,8 +79,8 @@ class Util { SoftReference ref = (SoftReference)localSelector.get(); SelectorWrapper selWrapper = null; Selector sel = null; - if (ref == null - || ((selWrapper = (SelectorWrapper) ref.get()) == null) + if (ref == null + || ((selWrapper = (SelectorWrapper) ref.get()) == null) || ((sel = selWrapper.get()) == null) || (sel.provider() != sc.provider())) { sel = sc.provider().openSelector(); @@ -91,16 +91,16 @@ class Util { return sel; } - static void releaseTemporarySelector(Selector sel) + static void releaseTemporarySelector(Selector sel) throws IOException - { + { // Selector should be empty sel.selectNow(); // Flush cancelled keys assert sel.keys().isEmpty() : "Temporary selector not empty"; - localSelectorWrapper.set(null); + localSelectorWrapper.set(null); } - + // -- Random stuff -- static ByteBuffer[] subsequence(ByteBuffer[] bs, int offset, int length) { @@ -148,7 +148,7 @@ class Util { }; } - + private static volatile Constructor directByteBufferConstructor = null; private static void initDBBConstructor() { @@ -243,7 +243,7 @@ class Util { return dbb; } - + // -- Bug compatibility -- private static volatile String bugLevel = null; @@ -252,18 +252,18 @@ class Util { if (bugLevel == null) { if (!sun.misc.VM.isBooted()) return false; - java.security.PrivilegedAction pa = - new GetPropertyAction("sun.nio.ch.bugLevel"); - String value = (String)AccessController.doPrivileged(pa); + String value = AccessController.doPrivileged( + new GetPropertyAction("sun.nio.ch.bugLevel")); bugLevel = (value != null) ? value : ""; } return bugLevel.equals(bl); } - + // -- Initialization -- + static void load() { } |