fixed Problem in processData in ConnectionHandler.java
and Codecleanup
This commit is contained in:
		
							parent
							
								
									dad15d52d2
								
							
						
					
					
						commit
						61feb48a86
					
				| 
						 | 
				
			
			@ -27,8 +27,7 @@ public class ClientConnectionHandler extends ConnectionHandler implements Runnab
 | 
			
		|||
 | 
			
		||||
    private final SimpleStringProperty userName;
 | 
			
		||||
    private final SimpleObjectProperty<State> state;
 | 
			
		||||
    private final ClientMessageList
 | 
			
		||||
            messages;
 | 
			
		||||
    private final ClientMessageList messages;
 | 
			
		||||
    private final SimpleStringProperty serverAddress;
 | 
			
		||||
    private final SimpleIntegerProperty serverPort;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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" +
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue