[Minor] code cleanup
This commit is contained in:
parent
2159c68a71
commit
bf72c96905
|
@ -170,7 +170,7 @@ public class CommunicationConnection implements Runnable {
|
|||
public void configure() {
|
||||
this.messageVisitor.configure(this);
|
||||
this.endpoint.configure(this, this.messageVisitor);
|
||||
this.notifyStateChange(ConnectionState.INITIALIZED, ConnectionState.INITIALIZED.name());
|
||||
notifyStateChange(ConnectionState.INITIALIZED, ConnectionState.INITIALIZED.name());
|
||||
}
|
||||
|
||||
public void start() {
|
||||
|
@ -187,7 +187,7 @@ public class CommunicationConnection implements Runnable {
|
|||
if (this.queueThread != null) {
|
||||
logger.warn(MessageFormat.format("{0}: Already connected!", this.id)); //$NON-NLS-1$
|
||||
} else {
|
||||
logger.info(MessageFormat.format("Starting Connection {0} to {1}...", this.id, this.getRemoteUri())); //$NON-NLS-1$
|
||||
logger.info(MessageFormat.format("Starting Connection {0} to {1}...", this.id, getRemoteUri())); //$NON-NLS-1$
|
||||
this.run = true;
|
||||
this.queueThread = new Thread(this, MessageFormat.format("{0}_OUT", this.id)); //$NON-NLS-1$
|
||||
this.queueThread.start();
|
||||
|
|
|
@ -37,7 +37,7 @@ public class IoMessageStateObserver implements ConnectionObserver {
|
|||
this.state = message.getState();
|
||||
|
||||
synchronized (this) {
|
||||
this.notifyAll();
|
||||
notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ public class ChatClient implements ConnectionObserver, ConnectionStateObserver {
|
|||
this.connected = newState == ConnectionState.CONNECTED || newState == ConnectionState.IDLE
|
||||
|| newState == ConnectionState.WORKING;
|
||||
synchronized (this) {
|
||||
this.notifyAll();
|
||||
notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ public class ChatServer implements ConnectionObserver, ConnectionStateObserver {
|
|||
this.connected = newState == ConnectionState.CONNECTED || newState == ConnectionState.IDLE
|
||||
|| newState == ConnectionState.WORKING;
|
||||
synchronized (this) {
|
||||
this.notifyAll();
|
||||
notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,9 +75,9 @@ public class ConsoleEndpoint implements CommunicationEndpoint {
|
|||
this.connection.notifyStateChange(ConnectionState.IDLE, ConnectionState.IDLE.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void simulate(IoMessage message) throws Exception {
|
||||
this.send(message);
|
||||
send(message);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -584,7 +584,7 @@ public class ServerSocketEndpoint implements CommunicationEndpoint, Runnable {
|
|||
|
||||
@Override
|
||||
public void simulate(IoMessage message) throws Exception {
|
||||
this.send(message);
|
||||
send(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -63,7 +63,7 @@ public class SocketEndpointConstants {
|
|||
* Default is to connect on start of the connection
|
||||
*/
|
||||
public static final boolean CONNECT_ON_START = true;
|
||||
|
||||
|
||||
/**
|
||||
* Default is to not close after sending
|
||||
*/
|
||||
|
|
|
@ -48,8 +48,8 @@ public interface FileClient {
|
|||
public boolean deleteFile(FileDeletion fileDeletion) throws RemoteException;
|
||||
|
||||
/**
|
||||
* Remote method which a client can request part of a file. The server will fill the given {@link FilePart} with
|
||||
* a byte array of the file, with bytes from the file, respecting the desired offset. It is up to the client to call
|
||||
* Remote method which a client can request part of a file. The server will fill the given {@link FilePart} with a
|
||||
* byte array of the file, with bytes from the file, respecting the desired offset. It is up to the client to call
|
||||
* this method multiple times for the entire file. It is a decision of the concrete implementation how much data is
|
||||
* returned in each part, the client may pass a request, but this is not definitive
|
||||
*
|
||||
|
|
|
@ -51,13 +51,13 @@ public enum StringMatchMode {
|
|||
public boolean matches(String value1, String value2) {
|
||||
DBC.PRE.assertNotNull("value1 must be set!", value1); //$NON-NLS-1$
|
||||
DBC.PRE.assertNotNull("value2 must be set!", value2); //$NON-NLS-1$
|
||||
if (!this.isEquals() && !this.isCaseSensitve())
|
||||
if (!isEquals() && !isCaseSensitve())
|
||||
return value1.toLowerCase().contains(value2.toLowerCase());
|
||||
|
||||
if (!this.isCaseSensitve())
|
||||
if (!isCaseSensitve())
|
||||
return value1.toLowerCase().equals(value2.toLowerCase());
|
||||
|
||||
if (!this.isEquals())
|
||||
if (!isEquals())
|
||||
return value1.contains(value2);
|
||||
|
||||
return value1.equals(value2);
|
||||
|
|
|
@ -50,7 +50,7 @@ public class ConsoleEndpointTest extends AbstractEndpointTest {
|
|||
public void testConsoleEndpoint() throws InterruptedException {
|
||||
|
||||
this.connection.start();
|
||||
|
||||
|
||||
CommandKey key = CommandKey.key(CONNECTION_ID, "logger"); //$NON-NLS-1$
|
||||
TestIoMessage msg = createTestMessage(key, CONNECTION_ID);
|
||||
|
||||
|
|
|
@ -100,9 +100,9 @@ public class ObjectFilterTest {
|
|||
|
||||
try {
|
||||
filter.add(myObj);
|
||||
fail("Should have failed adding twice!");
|
||||
fail("Should have failed adding twice!");
|
||||
} catch (RuntimeException e) {
|
||||
assertEquals("Stale State exception: Invalid + after +", e.getMessage());
|
||||
assertEquals("Stale State exception: Invalid + after +", e.getMessage());
|
||||
}
|
||||
|
||||
testAssertions(filter, 1, 1, 1, 0, 0);
|
||||
|
@ -118,9 +118,9 @@ public class ObjectFilterTest {
|
|||
|
||||
try {
|
||||
filter.remove(myObj);
|
||||
fail("Should have failed removing twice!");
|
||||
fail("Should have failed removing twice!");
|
||||
} catch (RuntimeException e) {
|
||||
assertEquals("Stale State exception: Invalid - after -", e.getMessage());
|
||||
assertEquals("Stale State exception: Invalid - after -", e.getMessage());
|
||||
}
|
||||
|
||||
testAssertions(filter, 1, 1, 0, 0, 1);
|
||||
|
@ -158,9 +158,9 @@ public class ObjectFilterTest {
|
|||
|
||||
try {
|
||||
filter.add(myObj);
|
||||
fail("Should have failed add after modify");
|
||||
fail("Should have failed add after modify");
|
||||
} catch (RuntimeException e) {
|
||||
assertEquals("Stale State exception: Invalid + after +=", e.getMessage());
|
||||
assertEquals("Stale State exception: Invalid + after +=", e.getMessage());
|
||||
}
|
||||
|
||||
testAssertions(filter, 1, 1, 0, 1, 0);
|
||||
|
@ -186,9 +186,9 @@ public class ObjectFilterTest {
|
|||
|
||||
try {
|
||||
filter.update(myObj);
|
||||
fail("Should have failed modify after remove");
|
||||
fail("Should have failed modify after remove");
|
||||
} catch (RuntimeException e) {
|
||||
assertEquals("Stale State exception: Invalid += after -", e.getMessage());
|
||||
assertEquals("Stale State exception: Invalid += after -", e.getMessage());
|
||||
}
|
||||
|
||||
testAssertions(filter, 1, 1, 0, 0, 1);
|
||||
|
|
Loading…
Reference in New Issue