fixed Problem in processData in ConnectionHandler.java
and Codecleanup
This commit is contained in:
@@ -97,7 +97,12 @@ public abstract class ConnectionHandler {
|
||||
} else if (scanner.hasNextLine()) {
|
||||
receiver.append(scanner.nextLine());
|
||||
} else {
|
||||
throw new ChatProtocolException("No Receiver found");
|
||||
throw new ChatProtocolException("No Sender found");
|
||||
}
|
||||
if (scanner.hasNextLine()) {
|
||||
receiver.append(scanner.nextLine());
|
||||
} else {
|
||||
throw new ChatProtocolException("No Reciever found");
|
||||
}
|
||||
if (scanner.hasNextLine()) {
|
||||
type.append(scanner.nextLine());
|
||||
@@ -119,7 +124,6 @@ public abstract class ConnectionHandler {
|
||||
*/
|
||||
protected void sendData(String sender, String receiver, String type, String payload) {
|
||||
if (connection.isAvailable()) {
|
||||
new StringBuilder();
|
||||
String data = sender + "\n" +
|
||||
receiver + "\n" +
|
||||
type + "\n" +
|
||||
|
||||
Reference in New Issue
Block a user