summaryrefslogtreecommitdiff
path: root/java/nio/channels/spi
diff options
context:
space:
mode:
Diffstat (limited to 'java/nio/channels/spi')
-rw-r--r--java/nio/channels/spi/AbstractInterruptibleChannel.java12
-rw-r--r--java/nio/channels/spi/AbstractSelectableChannel.java56
-rw-r--r--java/nio/channels/spi/AbstractSelectionKey.java4
-rw-r--r--java/nio/channels/spi/AbstractSelector.java2
-rw-r--r--java/nio/channels/spi/SelectorProvider.java50
5 files changed, 62 insertions, 62 deletions
diff --git a/java/nio/channels/spi/AbstractInterruptibleChannel.java b/java/nio/channels/spi/AbstractInterruptibleChannel.java
index 8e5b7b0b1..b1ed7c7f2 100644
--- a/java/nio/channels/spi/AbstractInterruptibleChannel.java
+++ b/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/java/nio/channels/spi/AbstractSelectableChannel.java b/java/nio/channels/spi/AbstractSelectableChannel.java
index 5d5277b4a..97ed685b8 100644
--- a/java/nio/channels/spi/AbstractSelectableChannel.java
+++ b/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/java/nio/channels/spi/AbstractSelectionKey.java b/java/nio/channels/spi/AbstractSelectionKey.java
index 02d09ce10..e0dc03f53 100644
--- a/java/nio/channels/spi/AbstractSelectionKey.java
+++ b/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/java/nio/channels/spi/AbstractSelector.java b/java/nio/channels/spi/AbstractSelector.java
index 73f5077df..b67d4aecc 100644
--- a/java/nio/channels/spi/AbstractSelector.java
+++ b/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/java/nio/channels/spi/SelectorProvider.java b/java/nio/channels/spi/SelectorProvider.java
index b2fb7bb9c..821bc4361 100644
--- a/java/nio/channels/spi/SelectorProvider.java
+++ b/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;