summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-11-12 03:31:15 (EST)
committerEike Stepper2007-11-12 03:31:15 (EST)
commit72a48cd95510d3750891014920b8c2dc3497e025 (patch)
tree6391375c015c16c61c335be9f1de3ae595a17b75
parent5ab66b90e49b2b7ab4006eb625fe97b22b2943c8 (diff)
downloadcdo-72a48cd95510d3750891014920b8c2dc3497e025.zip
cdo-72a48cd95510d3750891014920b8c2dc3497e025.tar.gz
cdo-72a48cd95510d3750891014920b8c2dc3497e025.tar.bz2
Removed all System.outs
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/net4j/org/eclipse/net4j/tests/AbstractOMTest.java25
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFTest.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TDD.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java8
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/SessionManager.java6
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/FacilityPane.java5
-rw-r--r--plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/ServerConsumer.java5
-rw-r--r--plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSSeparatedTest.java3
-rw-r--r--plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSTest.java3
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ConnectorTest.java37
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/HugeData.java18
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java8
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestBufferPool.java7
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocol.java3
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java25
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SortedFileMapTest.java2
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SynchronizingCorrelatorTest.java12
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/cache/RevisionManager.java4
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java1
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/GZIPStreamWrapper.java3
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/NIOUtil.java18
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/IChannel.java2
23 files changed, 99 insertions, 118 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/net4j/org/eclipse/net4j/tests/AbstractOMTest.java b/plugins/org.eclipse.emf.cdo.tests/net4j/org/eclipse/net4j/tests/AbstractOMTest.java
index d3603a4..b5d03ba 100644
--- a/plugins/org.eclipse.emf.cdo.tests/net4j/org/eclipse/net4j/tests/AbstractOMTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/net4j/org/eclipse/net4j/tests/AbstractOMTest.java
@@ -13,6 +13,7 @@ package org.eclipse.net4j.tests;
import org.eclipse.net4j.internal.util.om.log.PrintLogHandler;
import org.eclipse.net4j.internal.util.om.trace.PrintTraceHandler;
import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
+import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.net4j.util.om.OMPlatform;
import junit.framework.TestCase;
@@ -32,9 +33,9 @@ public abstract class AbstractOMTest extends TestCase
public final void setUp() throws Exception
{
super.setUp();
- System.out.println("************************************************");
- System.out.println(getName());
- System.out.println("************************************************");
+ IOUtil.OUT().println("************************************************");
+ IOUtil.OUT().println(getName());
+ IOUtil.OUT().println("************************************************");
OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
@@ -42,21 +43,21 @@ public abstract class AbstractOMTest extends TestCase
enableConsole();
doSetUp();
- System.out.println();
- System.out.println("------------------------ START ------------------------");
+ IOUtil.OUT().println();
+ IOUtil.OUT().println("------------------------ START ------------------------");
}
@Override
public final void tearDown() throws Exception
{
sleep(200);
- System.out.println("------------------------ END --------------------------");
- System.out.println();
+ IOUtil.OUT().println("------------------------ END --------------------------");
+ IOUtil.OUT().println();
doTearDown();
super.tearDown();
- System.out.println();
- System.out.println();
+ IOUtil.OUT().println();
+ IOUtil.OUT().println();
}
@Override
@@ -68,7 +69,7 @@ public abstract class AbstractOMTest extends TestCase
}
catch (Throwable t)
{
- t.printStackTrace(System.out);
+ t.printStackTrace(IOUtil.OUT());
throw t;
}
}
@@ -109,8 +110,8 @@ public abstract class AbstractOMTest extends TestCase
{
if (consoleEnabled)
{
- System.out.println();
- System.out.println("--> " + m);
+ IOUtil.OUT().println();
+ IOUtil.OUT().println("--> " + m);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java
index b34bccf..f1f752c 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java
@@ -21,6 +21,8 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.net4j.util.io.IOUtil;
+
import java.util.Iterator;
/**
@@ -75,9 +77,9 @@ public class ChunkingTest extends AbstractCDOTest
int i = 0;
for (Iterator<SalesOrder> it = salesOrders.iterator(); it.hasNext();)
{
- System.out.println(i++);
+ IOUtil.OUT().println(i++);
SalesOrder salesOrder = it.next();
- System.out.println(salesOrder);
+ IOUtil.OUT().println(salesOrder);
}
}
@@ -174,7 +176,7 @@ public class ChunkingTest extends AbstractCDOTest
resource.getContents().add(customer);
for (EObject element : resource.getContents())
{
- System.out.println(element);
+ IOUtil.OUT().println(element);
}
transaction.commit();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFTest.java
index f079be1..3cead51 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFTest.java
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.net4j.tests.AbstractOMTest;
+import org.eclipse.net4j.util.io.IOUtil;
/**
* @author Eike Stepper
@@ -38,10 +39,10 @@ public class EMFTest extends AbstractOMTest
EClass type = (EClass)reference.getEType();
dumpProxy(type);
- System.out.println(type.getName());
+ IOUtil.OUT().println(type.getName());
dumpProxy(type);
- System.out.println();
+ IOUtil.OUT().println();
if (false)
{
@@ -58,7 +59,7 @@ public class EMFTest extends AbstractOMTest
}
dumpProxy(type);
- System.out.println(type.getName());
+ IOUtil.OUT().println(type.getName());
dumpProxy(type);
}
@@ -67,7 +68,7 @@ public class EMFTest extends AbstractOMTest
InternalEObject eObject = (InternalEObject)object;
String label = eObject.eClass().getName();
- System.out.println(label + ": " + eObject.eIsProxy());
- System.out.println(label + ": " + eObject.eProxyURI());
+ IOUtil.OUT().println(label + ": " + eObject.eIsProxy());
+ IOUtil.OUT().println(label + ": " + eObject.eProxyURI());
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TDD.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TDD.java
index 4abcedc..d6f10f1 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TDD.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/TDD.java
@@ -11,6 +11,7 @@
package org.eclipse.emf.cdo.tests;
import org.eclipse.net4j.tests.AbstractOMTest;
+import org.eclipse.net4j.util.io.IOUtil;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -44,7 +45,7 @@ public class TDD
}
}
- System.out.println("******* COMPLETED *******");
+ IOUtil.OUT().println("******* COMPLETED *******");
}
private static void runTest(AbstractOMTest test, String methodName) throws Exception, Throwable
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
index 8aebe26..0ad8d3c 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
@@ -276,10 +276,6 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl implements Adapter.In
if (instanceElement != null && feature.isReference())
{
instanceElement = view.convertObjectToID(instanceElement);
- if (!(instanceValue instanceof CDOID))
- {
- System.out.println(instanceValue);
- }
}
revisionList.add(instanceElement);
@@ -297,10 +293,6 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl implements Adapter.In
if (instanceValue != null && feature.isReference())
{
instanceValue = view.convertObjectToID(instanceValue);
- if (!(instanceValue instanceof CDOID))
- {
- System.out.println(instanceValue);
- }
}
revision.setValue(feature, instanceValue);
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/SessionManager.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/SessionManager.java
index 7bcc4ae..4c06a8b 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/SessionManager.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/SessionManager.java
@@ -107,16 +107,10 @@ public class SessionManager extends Lifecycle implements ISessionManager, IListe
throw new IllegalStateException("connector == null");
}
- System.out.println("********* WAITFORCONNECTION *********");
- long start = System.currentTimeMillis();
boolean connected = connector.waitForConnection(5000L);
- System.out.println("WAITFORCONNECTION = " + (System.currentTimeMillis() - start));
if (connected)
{
- System.out.println("********* OPENSESSION *********");
- start = System.currentTimeMillis();
session = BuddiesUtil.openSession(connector, getUserID(), getPassword(), 5000L);
- System.out.println("OPENSESSION = " + (System.currentTimeMillis() - start));
if (session != null)
{
if (connecting)
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/FacilityPane.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/FacilityPane.java
index be6c3fc..7922ba0 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/FacilityPane.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/FacilityPane.java
@@ -233,11 +233,6 @@ public abstract class FacilityPane extends Composite implements IListener
CoolBar coolBarControl = getCoolBarControl();
if (coolBarControl != null)
{
- if (coolBarControl.getItemCount() == 0)
- {
- System.out.println("FALSE");
- }
-
return coolBarControl.getItemCount() > 0;
}
diff --git a/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/ServerConsumer.java b/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/ServerConsumer.java
index 68df669..1931f9b 100644
--- a/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/ServerConsumer.java
+++ b/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/ServerConsumer.java
@@ -15,6 +15,7 @@ import org.eclipse.net4j.internal.jms.MessageImpl;
import org.eclipse.net4j.jms.internal.server.bundle.OM;
import org.eclipse.net4j.jms.internal.server.protocol.JMSServerMessageRequest;
import org.eclipse.net4j.jms.server.IStoreTransaction;
+import org.eclipse.net4j.util.io.IOUtil;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -120,7 +121,7 @@ public class ServerConsumer
for (MessageImpl message : messages.values())
{
transaction.messageAcknowledged(message, id);
- System.out.println("\nMessage acknowledged: " + message.getJMSMessageID() + " (consumer=" + id + ")\n");
+ IOUtil.OUT().println("\nMessage acknowledged: " + message.getJMSMessageID() + " (consumer=" + id + ")\n");
}
messages.clear();
@@ -138,7 +139,7 @@ public class ServerConsumer
for (MessageImpl message : messages.values())
{
- System.out.println("\nRecovering message: " + message.getJMSMessageID() + " (consumer=" + id + ")\n");
+ IOUtil.OUT().println("\nRecovering message: " + message.getJMSMessageID() + " (consumer=" + id + ")\n");
session.getConnection().getServer().addWork(message);
}
}
diff --git a/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSSeparatedTest.java b/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSSeparatedTest.java
index fa9ba96..4d4834f 100644
--- a/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSSeparatedTest.java
+++ b/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSSeparatedTest.java
@@ -28,6 +28,7 @@ import org.eclipse.net4j.jms.server.jdbc.JDBCUtil;
import org.eclipse.net4j.tcp.TCPUtil;
import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.net4j.util.om.OMPlatform;
import javax.jms.Connection;
@@ -137,7 +138,7 @@ public class JMSSeparatedTest
try
{
Object object = ((ObjectMessage)message).getObject();
- System.out.println("\n------> MESSAGE for " + name + ": " + object + "\n");
+ IOUtil.OUT().println("\n------> MESSAGE for " + name + ": " + object + "\n");
message.acknowledge();
}
catch (JMSException ex)
diff --git a/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSTest.java b/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSTest.java
index 2d34756..93467b7 100644
--- a/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSTest.java
+++ b/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSTest.java
@@ -28,6 +28,7 @@ import org.eclipse.net4j.jms.server.jdbc.JDBCUtil;
import org.eclipse.net4j.tcp.TCPUtil;
import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.net4j.util.om.OMPlatform;
import javax.jms.Connection;
@@ -122,7 +123,7 @@ public class JMSTest
try
{
Object object = ((ObjectMessage)message).getObject();
- System.out.println("\n------> MESSAGE for " + name + ": " + object + "\n");
+ IOUtil.OUT().println("\n------> MESSAGE for " + name + ": " + object + "\n");
message.acknowledge();
}
catch (JMSException ex)
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ConnectorTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ConnectorTest.java
index d5825a8..a8c9b48 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ConnectorTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/ConnectorTest.java
@@ -23,6 +23,7 @@ import org.eclipse.net4j.internal.util.security.ResponseNegotiator;
import org.eclipse.net4j.internal.util.security.UserManager;
import org.eclipse.net4j.tcp.ITCPSelector;
import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
+import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.tests.AbstractOMTest;
@@ -148,15 +149,15 @@ public class ConnectorTest extends AbstractOMTest
{
for (int i = 0; i < 100; i++)
{
- System.out.println();
- System.out.println();
- System.out.println();
- System.out.println("#####################################################");
- System.out.println(" RUN = " + i);
- System.out.println("#####################################################");
- System.out.println();
- System.out.println();
- System.out.println();
+ IOUtil.OUT().println();
+ IOUtil.OUT().println();
+ IOUtil.OUT().println();
+ IOUtil.OUT().println("#####################################################");
+ IOUtil.OUT().println(" RUN = " + i);
+ IOUtil.OUT().println("#####################################################");
+ IOUtil.OUT().println();
+ IOUtil.OUT().println();
+ IOUtil.OUT().println();
testDeferredActivation();
cleanup();
}
@@ -220,15 +221,15 @@ public class ConnectorTest extends AbstractOMTest
{
for (int i = 0; i < 100; i++)
{
- System.out.println();
- System.out.println();
- System.out.println();
- System.out.println("#####################################################");
- System.out.println(" RUN = " + i);
- System.out.println("#####################################################");
- System.out.println();
- System.out.println();
- System.out.println();
+ IOUtil.OUT().println();
+ IOUtil.OUT().println();
+ IOUtil.OUT().println();
+ IOUtil.OUT().println("#####################################################");
+ IOUtil.OUT().println(" RUN = " + i);
+ IOUtil.OUT().println("#####################################################");
+ IOUtil.OUT().println();
+ IOUtil.OUT().println();
+ IOUtil.OUT().println();
testNegotiationSuccess();
cleanup();
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/HugeData.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/HugeData.java
index 4e8579d..25caf38 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/HugeData.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/HugeData.java
@@ -111,7 +111,7 @@ public final class HugeData
+ NL + " return state;" + NL + " }" + NL + "" + NL
+ " public void setState(State newState) throws ConnectorException" + NL + " {" + NL
+ " State oldState = getState();" + NL + " if (newState != oldState)" + NL + " {" + NL
- + " System.out.println(toString() + \": Setting state \" + newState + \" (was \"" + NL
+ + " IOUtil.OUT().println(toString() + \": Setting state \" + newState + \" (was \"" + NL
+ " + oldState.toString().toLowerCase() + \")\");" + NL + " state = newState;" + NL
+ " fireStateChanged(newState, oldState);" + NL + "" + NL + " switch (newState)" + NL + " {"
+ NL + " case DISCONNECTED:" + NL + " if (finishedConnecting != null)" + NL + " {" + NL
@@ -135,7 +135,7 @@ public final class HugeData
+ " public boolean waitForConnection(long timeout) throws ConnectorException" + NL + " {" + NL
+ " State state = getState();" + NL + " if (state == State.DISCONNECTED)" + NL + " {" + NL
+ " return false;" + NL + " }" + NL + "" + NL + " try" + NL + " {" + NL
- + " System.out.println(toString() + \": Waiting for connection...\");" + NL
+ + " IOUtil.OUT().println(toString() + \": Waiting for connection...\");" + NL
+ " return finishedNegotiating.await(timeout, TimeUnit.MILLISECONDS);" + NL + " }" + NL
+ " catch (InterruptedException ex)" + NL + " {" + NL + " return false;" + NL + " }" + NL + " }"
+ NL + "" + NL + " public boolean connect(long timeout) throws ConnectorException" + NL + " {" + NL
@@ -161,9 +161,9 @@ public final class HugeData
+ " throw new ConnectorException(ex);" + NL + " }" + NL + "" + NL + " return channel;" + NL + " }"
+ NL + "" + NL + " public ChannelImpl createChannel(short channelIndex, String protocolID)" + NL + " {" + NL
+ " Protocol protocol = createProtocol(protocolID);" + NL + " if (protocol == null)" + NL + " {" + NL
- + " System.out.println(toString() + \": Opening channel without protocol\");" + NL + " }" + NL
+ + " IOUtil.OUT().println(toString() + \": Opening channel without protocol\");" + NL + " }" + NL
+ " else" + NL + " {" + NL
- + " System.out.println(toString() + \": Opening channel with protocol \" + protocolID);" + NL + " }"
+ + " IOUtil.OUT().println(toString() + \": Opening channel with protocol \" + protocolID);" + NL + " }"
+ NL + "" + NL + " ChannelImpl channel = new ChannelImpl(receiveExecutor);" + NL
+ " channel.setChannelIndex(channelIndex);" + NL + " channel.setMultiplexer(this);" + NL
+ " channel.setReceiveHandler(protocol);" + NL
@@ -173,7 +173,7 @@ public final class HugeData
+ NL + " if (channel == null || channel == NULL_CHANNEL)" + NL + " {" + NL
+ " throw new NullPointerException();" + NL + " }" + NL + "" + NL + " return channel;" + NL
+ " }" + NL + " catch (IndexOutOfBoundsException ex)" + NL + " {" + NL
- + " System.out.println(toString() + \": Invalid channelIndex \" + channelIndex);" + NL
+ + " IOUtil.OUT().println(toString() + \": Invalid channelIndex \" + channelIndex);" + NL
+ " return null;" + NL + " }" + NL + " }" + NL + "" + NL
+ " protected List<BufferQueue> getChannelBufferQueues()" + NL + " {" + NL
+ " final List<BufferQueue> result = new ArrayList<BufferQueue>();" + NL + " synchronized (channels)"
@@ -193,7 +193,7 @@ public final class HugeData
+ " protected void removeChannel(ChannelImpl channel)" + NL + " {" + NL
+ " channel.removeLifecycleListener(channelLifecycleListener);" + NL
+ " int channelIndex = channel.getChannelIndex();" + NL + "" + NL
- + " System.out.println(toString() + \": Removing channel \" + channelIndex);" + NL
+ + " IOUtil.OUT().println(toString() + \": Removing channel \" + channelIndex);" + NL
+ " channels.set(channelIndex, NULL_CHANNEL);" + NL + " }" + NL + "" + NL
+ " protected Protocol createProtocol(String protocolID)" + NL + " {" + NL
+ " if (protocolID == null || protocolID.length() == 0)" + NL + " {" + NL + " return null;" + NL
@@ -201,7 +201,7 @@ public final class HugeData
+ NL + " if (registry == null)" + NL + " {" + NL + " return null;" + NL + " }" + NL + "" + NL
+ " ProtocolFactory factory = registry.lookup(protocolID);" + NL + " if (factory == null)" + NL + " {"
+ NL + " return null;" + NL + " }" + NL + "" + NL
- + " System.out.println(toString() + \": Creating protocol \" + protocolID);" + NL
+ + " IOUtil.OUT().println(toString() + \": Creating protocol \" + protocolID);" + NL
+ " return factory.createProtocol();" + NL + " }" + NL + "" + NL
+ " protected void fireChannelOpened(Channel channel)" + NL + " {" + NL
+ " for (ChannelListener listener : channelListeners)" + NL + " {" + NL + " try" + NL + " {"
@@ -220,9 +220,9 @@ public final class HugeData
+ " super.onAccessBeforeActivate();" + NL + " if (bufferProvider == null)" + NL + " {" + NL
+ " throw new IllegalStateException(\"bufferProvider == null\");" + NL + " }" + NL + "" + NL
+ " if (protocolFactoryRegistry == null)" + NL + " {" + NL
- + " System.out.println(toString() + \": (INFO) protocolFactoryRegistry == null\");" + NL + " }" + NL
+ + " IOUtil.OUT().println(toString() + \": (INFO) protocolFactoryRegistry == null\");" + NL + " }" + NL
+ "" + NL + " if (receiveExecutor == null)" + NL + " {" + NL
- + " System.out.println(toString() + \": (INFO) receiveExecutor == null\");" + NL + " }" + NL + " }"
+ + " IOUtil.OUT().println(toString() + \": (INFO) receiveExecutor == null\");" + NL + " }" + NL + " }"
+ NL + "" + NL + " @Override" + NL + " protected void onActivate() throws Exception" + NL + " {" + NL
+ " super.onActivate();" + NL + " setState(State.CONNECTING);" + NL + " }" + NL + "" + NL
+ " @Override" + NL + " protected void onDeactivate() throws Exception" + NL + " {" + NL
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java
index 3108f94..e329d55 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java
@@ -200,7 +200,7 @@ public class TCPTransportTest extends AbstractTransportTest
String line;
while ((line = reader.readLine()) != null)
{
- System.out.println(line);
+ msg(line);
}
isr.close();
@@ -269,7 +269,7 @@ public class TCPTransportTest extends AbstractTransportTest
String line;
while ((line = reader.readLine()) != null)
{
- System.out.println(line);
+ msg(line);
}
isr.close();
@@ -351,7 +351,7 @@ public class TCPTransportTest extends AbstractTransportTest
String line;
while ((line = reader.readLine()) != null)
{
- System.out.println(line);
+ msg(line);
}
isr.close();
@@ -412,6 +412,6 @@ public class TCPTransportTest extends AbstractTransportTest
dataInput.read(b);
dataInput.close();
- System.out.println(new String(b));
+ msg(new String(b));
}
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestBufferPool.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestBufferPool.java
index 9021a99..dd18f75 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestBufferPool.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestBufferPool.java
@@ -14,6 +14,7 @@ import org.eclipse.net4j.IBuffer;
import org.eclipse.net4j.IBufferPool;
import org.eclipse.net4j.Net4jUtil;
import org.eclipse.net4j.util.ReflectUtil;
+import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.tests.AbstractOMTest;
@@ -56,14 +57,14 @@ public class TestBufferPool extends AbstractOMTest
private static void msg()
{
- System.out.println("pooledBuffers = " + Net4jUtil.getPooledBuffers(bufferPool));
+ IOUtil.OUT().println("pooledBuffers = " + Net4jUtil.getPooledBuffers(bufferPool));
}
private static boolean allocate()
{
try
{
- System.out.println("allocating from " + Runtime.getRuntime().freeMemory());
+ IOUtil.OUT().println("allocating from " + Runtime.getRuntime().freeMemory());
for (int i = 0; i < 10; i++)
{
memory.add(new byte[1000000]);
@@ -82,7 +83,7 @@ public class TestBufferPool extends AbstractOMTest
private static void gc()
{
msg();
- System.out.println("collecting garbage");
+ IOUtil.OUT().println("collecting garbage");
System.gc();
msg();
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocol.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocol.java
index b81b125..2690706 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocol.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocol.java
@@ -1,6 +1,7 @@
package org.eclipse.net4j.tests;
import org.eclipse.net4j.IBuffer;
+import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.internal.net4j.Protocol;
@@ -23,7 +24,7 @@ public final class TestProtocol extends Protocol
public void handleBuffer(IBuffer buffer)
{
- System.out.println("BUFFER ARRIVED");
+ IOUtil.OUT().println("BUFFER ARRIVED");
buffer.release();
if (getInfraStructure() instanceof CountDownLatch)
{
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
index c37b2bf..3af7c58 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
@@ -13,6 +13,7 @@ package org.eclipse.net4j.util.tests;
import org.eclipse.net4j.internal.util.om.log.PrintLogHandler;
import org.eclipse.net4j.internal.util.om.trace.PrintTraceHandler;
import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
+import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.net4j.util.om.OMPlatform;
import junit.framework.TestCase;
@@ -32,9 +33,9 @@ public abstract class AbstractOMTest extends TestCase
public final void setUp() throws Exception
{
super.setUp();
- System.out.println("************************************************");
- System.out.println(getName());
- System.out.println("************************************************");
+ IOUtil.OUT().println("************************************************");
+ IOUtil.OUT().println(getName());
+ IOUtil.OUT().println("************************************************");
OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
@@ -42,21 +43,21 @@ public abstract class AbstractOMTest extends TestCase
enableConsole();
doSetUp();
- System.out.println();
- System.out.println("------------------------ START ------------------------");
+ IOUtil.OUT().println();
+ IOUtil.OUT().println("------------------------ START ------------------------");
}
@Override
public final void tearDown() throws Exception
{
sleep(200);
- System.out.println("------------------------ END --------------------------");
- System.out.println();
+ IOUtil.OUT().println("------------------------ END --------------------------");
+ IOUtil.OUT().println();
doTearDown();
super.tearDown();
- System.out.println();
- System.out.println();
+ IOUtil.OUT().println();
+ IOUtil.OUT().println();
}
@Override
@@ -68,7 +69,7 @@ public abstract class AbstractOMTest extends TestCase
}
catch (Throwable t)
{
- t.printStackTrace(System.out);
+ t.printStackTrace(IOUtil.OUT());
throw t;
}
}
@@ -109,8 +110,8 @@ public abstract class AbstractOMTest extends TestCase
{
if (consoleEnabled)
{
- System.out.println();
- System.out.println("--> " + m);
+ IOUtil.OUT().println();
+ IOUtil.OUT().println("--> " + m);
}
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SortedFileMapTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SortedFileMapTest.java
index 3628256..3472d37 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SortedFileMapTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SortedFileMapTest.java
@@ -44,7 +44,7 @@ public class SortedFileMapTest extends AbstractOMTest
for (int i = 0; i < 500; i++)
{
String value = map.get(i);
- System.out.println(value);
+ IOUtil.OUT().println(value);
}
}
finally
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SynchronizingCorrelatorTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SynchronizingCorrelatorTest.java
index 2158ffb..1c75a3a 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SynchronizingCorrelatorTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/SynchronizingCorrelatorTest.java
@@ -29,7 +29,7 @@ public class SynchronizingCorrelatorTest extends AbstractOMTest
{
ISynchronizer<Boolean> eike = correlator.correlate("eike");
result[0] = eike.get(5000);
- System.out.println("RESULT: " + result[0]);
+ msg("RESULT: " + result[0]);
}
};
@@ -60,7 +60,7 @@ public class SynchronizingCorrelatorTest extends AbstractOMTest
{
ISynchronizer<Boolean> eike = correlator.correlate("eike");
result[0] = eike.get(5000);
- System.out.println("RESULT: " + result[0]);
+ msg("RESULT: " + result[0]);
}
};
@@ -68,7 +68,7 @@ public class SynchronizingCorrelatorTest extends AbstractOMTest
Thread.sleep(10);
boolean consumed = correlator.put("eike", true, 1000);
- System.out.println("Consumed: " + consumed);
+ msg("Consumed: " + consumed);
assertTrue(consumed);
consumer.join(100);
@@ -96,7 +96,7 @@ public class SynchronizingCorrelatorTest extends AbstractOMTest
{
ISynchronizer<Boolean> eike = correlator.correlate("eike");
result[0] = eike.get(5000);
- System.out.println("RESULT: " + result[0]);
+ msg("RESULT: " + result[0]);
}
};
@@ -120,7 +120,7 @@ public class SynchronizingCorrelatorTest extends AbstractOMTest
final Boolean[] result = { false };
final SynchronizingCorrelator<String, Boolean> correlator = new SynchronizingCorrelator<String, Boolean>();
boolean consumed = correlator.put("eike", true, 50);
- System.out.println("Consumed: " + consumed);
+ msg("Consumed: " + consumed);
assertFalse(consumed);
final Thread consumer = new Thread()
@@ -130,7 +130,7 @@ public class SynchronizingCorrelatorTest extends AbstractOMTest
{
ISynchronizer<Boolean> eike = correlator.correlate("eike");
result[0] = eike.get(5000);
- System.out.println("RESULT: " + result[0]);
+ msg("RESULT: " + result[0]);
}
};
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/cache/RevisionManager.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/cache/RevisionManager.java
index 3fb6d4a..ad7095f 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/cache/RevisionManager.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/cache/RevisionManager.java
@@ -15,7 +15,6 @@ import org.eclipse.net4j.internal.util.cache.Cache;
import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
-import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -58,8 +57,6 @@ public class RevisionManager extends Cache<Revision>
protected Revision loadRevision(int id, int version)
{
Revision revision = new Revision(this, id, version);
- System.out.println(MessageFormat.format("Loaded {0} (free={1}, total={2}, max={3})", revision, Runtime.getRuntime()
- .freeMemory(), Runtime.getRuntime().totalMemory(), Runtime.getRuntime().maxMemory()));
return revision;
}
@@ -72,7 +69,6 @@ public class RevisionManager extends Cache<Revision>
@Override
protected void unreachableElement(Reference<? extends Revision> reference)
{
- System.out.println("Unreachable: " + reference);
}
/**
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java
index 9aa3bb5..19024b2 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java
@@ -79,7 +79,6 @@ public class NullMonitor implements OMMonitor, OMSubMonitor
public void setTask(String task)
{
- // System.out.println("NullMonitor: " + task);
}
public void worked()
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/GZIPStreamWrapper.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/GZIPStreamWrapper.java
index b3ad602..559ac54 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/GZIPStreamWrapper.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/GZIPStreamWrapper.java
@@ -10,7 +10,6 @@
**************************************************************************/
package org.eclipse.net4j.util.io;
-import org.eclipse.net4j.util.HexUtil;
import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
import java.io.IOException;
@@ -82,7 +81,6 @@ public class GZIPStreamWrapper implements IStreamWrapper
byte[] in = new byte[out.length];
gis.read(in);
gis.close();
- System.out.println("Read: " + HexUtil.bytesToHex(in));
}
catch (IOException ex)
{
@@ -96,7 +94,6 @@ public class GZIPStreamWrapper implements IStreamWrapper
gos.write(out);
gos.close();
- System.out.println("Written: " + HexUtil.bytesToHex(out));
ConcurrencyUtil.sleep(2000);
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/NIOUtil.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/NIOUtil.java
index da97926..5ff9adf 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/NIOUtil.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/NIOUtil.java
@@ -82,17 +82,16 @@ public final class NIOUtil
* overwrite destination file
* @exception IOException
* I/O problem
- * @exception IllegalArgumentException
- * illegal argument
*/
@SuppressWarnings("unused")
- private static void copy(final File src, File dst, final boolean overwrite) throws IOException,
- IllegalArgumentException
+ private static void copy(final File src, File dst, final boolean overwrite) throws IOException
{
long q = System.currentTimeMillis();
- // checks
if (!src.isFile() || !src.exists())
+ {
throw new IllegalArgumentException("Source file '" + src.getAbsolutePath() + "' not found!");
+ }
+
if (dst.exists()) if (dst.isDirectory()) // Directory? -> use source file
// name
dst = new File(dst, src.getName());
@@ -189,13 +188,10 @@ public final class NIOUtil
{
fos.close();
}
- catch (IOException e)
+ catch (IOException ex)
{
}
}
- } // else
-
- System.out.println(">>> " + String.valueOf(src.length() / 1024) + " Kb, "
- + String.valueOf(System.currentTimeMillis() - q));
- } // copy
+ }
+ }
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/IChannel.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/IChannel.java
index 521e35b..add0922 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/IChannel.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/IChannel.java
@@ -63,7 +63,7 @@ import org.eclipse.net4j.util.event.INotifier;
* public void handleBuffer(IBuffer buffer)
* {
* ByteBuffer byteBuffer = buffer.getByteBuffer();
- * System.out.println(&quot;Received &quot; + byteBuffer.getDouble());
+ * IOUtil.OUT().println(&quot;Received &quot; + byteBuffer.getDouble());
* buffer.release();
* }
* };