diff options
Diffstat (limited to 'libjava/classpath/java/nio/channels')
7 files changed, 72 insertions, 72 deletions
diff --git a/libjava/classpath/java/nio/channels/FileChannel.java b/libjava/classpath/java/nio/channels/FileChannel.java index 3aa1999..8c8029f 100644 --- a/libjava/classpath/java/nio/channels/FileChannel.java +++ b/libjava/classpath/java/nio/channels/FileChannel.java @@ -71,9 +71,9 @@ public abstract class FileChannel extends AbstractInterruptibleChannel public String toString() { if (this == READ_ONLY) - return "READ_ONLY"; + return "READ_ONLY"; else if (this == READ_WRITE) - return "READ_WRITE"; + return "READ_WRITE"; return "PRIVATE"; } diff --git a/libjava/classpath/java/nio/channels/SocketChannel.java b/libjava/classpath/java/nio/channels/SocketChannel.java index 50f2136..324c981 100644 --- a/libjava/classpath/java/nio/channels/SocketChannel.java +++ b/libjava/classpath/java/nio/channels/SocketChannel.java @@ -64,7 +64,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel * Opens a socket channel. * * @return the new <code>SocketChannel</code> object - * + * * @exception IOException If an error occurs */ public static SocketChannel open() throws IOException @@ -76,7 +76,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel * Opens a channel and connects it to a remote address. * * @return the new <code>SocketChannel</code> object - * + * * @exception AsynchronousCloseException If this channel is already connected. * @exception ClosedByInterruptException If another thread interrupts the * current thread while the connect operation is in progress, thereby closing @@ -120,7 +120,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel * Writes data to the channel. * * @return the number of bytes written, zero is valid too - * + * * @exception IOException If an error occurs * @exception NotYetConnectedException If this channel is not yet connected. */ @@ -150,7 +150,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel * * @return the number of bytes read, zero is valid too, -1 if end of stream * is reached - * + * * @exception IOException If an error occurs * @exception NotYetConnectedException If this channel is not yet connected. */ @@ -162,7 +162,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel * @return <code>true</code> if the channel got successfully connected, * <code>false</code> if the channel is in non-blocking mode and connection * operation is still in progress. - * + * * @exception AlreadyConnectedException If this channel is already connected. * @exception AsynchronousCloseException If this channel is already connected. * @exception ClosedByInterruptException If another thread interrupts the @@ -211,7 +211,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel * * @return the number of bytes read, zero is valid too, -1 if end of stream * is reached - * + * * @exception IOException If an error occurs * @exception NotYetConnectedException If this channel is not yet connected. */ @@ -229,7 +229,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel * Writes data to the channel. * * @return the number of bytes written, zero is valid too - * + * * @exception IOException If an error occurs * @exception NotYetConnectedException If this channel is not yet connected. */ @@ -239,7 +239,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel * Writes data to the channel. * * @return the number of bytes written, zero is valid too - * + * * @exception IOException If an error occurs * @exception NotYetConnectedException If this channel is not yet connected. */ diff --git a/libjava/classpath/java/nio/channels/spi/AbstractInterruptibleChannel.java b/libjava/classpath/java/nio/channels/spi/AbstractInterruptibleChannel.java index 8e5b7b0..b1ed7c7 100644 --- a/libjava/classpath/java/nio/channels/spi/AbstractInterruptibleChannel.java +++ b/libjava/classpath/java/nio/channels/spi/AbstractInterruptibleChannel.java @@ -1,4 +1,4 @@ -/* AbstractInterruptibleChannel.java -- +/* AbstractInterruptibleChannel.java -- Copyright (C) 2002, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -76,8 +76,8 @@ public abstract class AbstractInterruptibleChannel { if (! closed) { - closed = true; - implCloseChannel(); + closed = true; + implCloseChannel(); } } @@ -96,7 +96,7 @@ public abstract class AbstractInterruptibleChannel throws AsynchronousCloseException { // FIXME: check more here. - + if (closed) throw new AsynchronousCloseException(); } @@ -109,8 +109,8 @@ public abstract class AbstractInterruptibleChannel /** * Tells whether or not this channel is open. - * - * @return true if the channel is open, false otherwise + * + * @return true if the channel is open, false otherwise */ public final boolean isOpen() { diff --git a/libjava/classpath/java/nio/channels/spi/AbstractSelectableChannel.java b/libjava/classpath/java/nio/channels/spi/AbstractSelectableChannel.java index 5d5277b..97ed685 100644 --- a/libjava/classpath/java/nio/channels/spi/AbstractSelectableChannel.java +++ b/libjava/classpath/java/nio/channels/spi/AbstractSelectableChannel.java @@ -90,11 +90,11 @@ public abstract class AbstractSelectableChannel extends SelectableChannel { synchronized (blockingLock()) { - if (this.blocking != blocking) - { - implConfigureBlocking(blocking); - this.blocking = blocking; - } + if (this.blocking != blocking) + { + implConfigureBlocking(blocking); + this.blocking = blocking; + } } return this; @@ -173,14 +173,14 @@ public abstract class AbstractSelectableChannel extends SelectableChannel try { - synchronized (blockingLock()) - { - return locate(selector); - } + synchronized (blockingLock()) + { + return locate(selector); + } } catch (Exception e) { - return null; + return null; } } @@ -200,10 +200,10 @@ public abstract class AbstractSelectableChannel extends SelectableChannel while (it.hasNext()) { - SelectionKey key = (SelectionKey) it.next(); + SelectionKey key = (SelectionKey) it.next(); - if (key.selector() == selector) - return key; + if (key.selector() == selector) + return key; } return null; @@ -217,7 +217,7 @@ public abstract class AbstractSelectableChannel extends SelectableChannel * @param att an attachment for the returned selection key * * @return the registered selection key - * + * * @exception ClosedChannelException If the channel is already closed. * @exception IllegalBlockingModeException If the channel is configured in * blocking mode. @@ -230,29 +230,29 @@ public abstract class AbstractSelectableChannel extends SelectableChannel if ((ops & ~validOps()) != 0) throw new IllegalArgumentException(); - + SelectionKey key = null; AbstractSelector selector = (AbstractSelector) selin; synchronized (blockingLock()) { - if (blocking) - throw new IllegalBlockingModeException(); + if (blocking) + throw new IllegalBlockingModeException(); - key = locate(selector); + key = locate(selector); - if (key != null && key.isValid()) - { + if (key != null && key.isValid()) + { key.interestOps(ops); key.attach(att); - } - else - { - key = selector.register(this, ops, att); - - if (key != null) - addSelectionKey(key); - } + } + else + { + key = selector.register(this, ops, att); + + if (key != null) + addSelectionKey(key); + } } return key; diff --git a/libjava/classpath/java/nio/channels/spi/AbstractSelectionKey.java b/libjava/classpath/java/nio/channels/spi/AbstractSelectionKey.java index 02d09ce..e0dc03f 100644 --- a/libjava/classpath/java/nio/channels/spi/AbstractSelectionKey.java +++ b/libjava/classpath/java/nio/channels/spi/AbstractSelectionKey.java @@ -61,8 +61,8 @@ public abstract class AbstractSelectionKey extends SelectionKey { if (isValid()) { - ((AbstractSelector) selector()).cancelKey(this); - cancelled = true; + ((AbstractSelector) selector()).cancelKey(this); + cancelled = true; } } diff --git a/libjava/classpath/java/nio/channels/spi/AbstractSelector.java b/libjava/classpath/java/nio/channels/spi/AbstractSelector.java index 73f5077..b67d4ae 100644 --- a/libjava/classpath/java/nio/channels/spi/AbstractSelector.java +++ b/libjava/classpath/java/nio/channels/spi/AbstractSelector.java @@ -132,7 +132,7 @@ public abstract class AbstractSelector extends Selector { synchronized (cancelledKeys) { - cancelledKeys.add(key); + cancelledKeys.add(key); } } diff --git a/libjava/classpath/java/nio/channels/spi/SelectorProvider.java b/libjava/classpath/java/nio/channels/spi/SelectorProvider.java index b2fb7bb..821bc43 100644 --- a/libjava/classpath/java/nio/channels/spi/SelectorProvider.java +++ b/libjava/classpath/java/nio/channels/spi/SelectorProvider.java @@ -72,7 +72,7 @@ public abstract class SelectorProvider * Opens a datagram channel. * * @return a new datagram channel object - * + * * @exception IOException if an error occurs */ public abstract DatagramChannel openDatagramChannel() @@ -82,7 +82,7 @@ public abstract class SelectorProvider * Opens a pipe. * * @return a new pipe object - * + * * @exception IOException if an error occurs */ public abstract Pipe openPipe() throws IOException; @@ -91,7 +91,7 @@ public abstract class SelectorProvider * Opens a selector. * * @return a new selector object - * + * * @exception IOException if an error occurs */ public abstract AbstractSelector openSelector() throws IOException; @@ -100,7 +100,7 @@ public abstract class SelectorProvider * Opens a server socket channel. * * @return a new server socket channel object - * + * * @exception IOException if an error occurs */ public abstract ServerSocketChannel openServerSocketChannel() @@ -110,7 +110,7 @@ public abstract class SelectorProvider * Opens a socket channel. * * @return a new socket channel object - * + * * @exception IOException if an error occurs */ public abstract SocketChannel openSocketChannel() throws IOException; @@ -151,26 +151,26 @@ public abstract class SelectorProvider { if (systemDefaultProvider == null) { - String propertyValue = - System.getProperty("java.nio.channels.spi.SelectorProvider"); - - if (propertyValue == null || propertyValue.equals("")) - systemDefaultProvider = new SelectorProviderImpl(); - else - { - try - { - systemDefaultProvider = - (SelectorProvider) Class.forName(propertyValue) - .newInstance(); - } - catch (Exception e) - { - System.err.println("Could not instantiate class: " - + propertyValue); - systemDefaultProvider = new SelectorProviderImpl(); - } - } + String propertyValue = + System.getProperty("java.nio.channels.spi.SelectorProvider"); + + if (propertyValue == null || propertyValue.equals("")) + systemDefaultProvider = new SelectorProviderImpl(); + else + { + try + { + systemDefaultProvider = + (SelectorProvider) Class.forName(propertyValue) + .newInstance(); + } + catch (Exception e) + { + System.err.println("Could not instantiate class: " + + propertyValue); + systemDefaultProvider = new SelectorProviderImpl(); + } + } } return systemDefaultProvider; |