Remove nulls

This commit is contained in:
Alex Theedom 2016-08-25 22:07:52 +01:00
parent 0e1d0b4092
commit 393106be61
6 changed files with 18 additions and 18 deletions

View File

@ -4,9 +4,9 @@ import java.io.*;
import java.net.*; import java.net.*;
public class EchoClient { public class EchoClient {
private Socket clientSocket = null; private Socket clientSocket;
private PrintWriter out = null; private PrintWriter out;
private BufferedReader in = null; private BufferedReader in;
public void startConnection(String ip, int port) { public void startConnection(String ip, int port) {
try { try {

View File

@ -4,7 +4,7 @@ import java.net.*;
import java.io.*; import java.io.*;
public class EchoMultiServer { public class EchoMultiServer {
private ServerSocket serverSocket = null; private ServerSocket serverSocket;
public void start(int port) { public void start(int port) {
try { try {
@ -32,8 +32,8 @@ public class EchoMultiServer {
private static class EchoClientHandler extends Thread { private static class EchoClientHandler extends Thread {
private Socket clientSocket; private Socket clientSocket;
private PrintWriter out = null; private PrintWriter out;
private BufferedReader in = null; private BufferedReader in;
public EchoClientHandler(Socket socket) { public EchoClientHandler(Socket socket) {
this.clientSocket = socket; this.clientSocket = socket;

View File

@ -4,10 +4,10 @@ import java.net.*;
import java.io.*; import java.io.*;
public class EchoServer { public class EchoServer {
private ServerSocket serverSocket = null; private ServerSocket serverSocket;
private Socket clientSocket = null; private Socket clientSocket;
private PrintWriter out = null; private PrintWriter out;
private BufferedReader in = null; private BufferedReader in;
public void start(int port) { public void start(int port) {
try { try {

View File

@ -7,9 +7,9 @@ import java.io.PrintWriter;
import java.net.Socket; import java.net.Socket;
public class GreetClient { public class GreetClient {
private Socket clientSocket = null; private Socket clientSocket;
private PrintWriter out = null; private PrintWriter out;
private BufferedReader in = null; private BufferedReader in;
public void startConnection(String ip, int port) { public void startConnection(String ip, int port) {
try { try {

View File

@ -4,10 +4,10 @@ import java.net.*;
import java.io.*; import java.io.*;
public class GreetServer { public class GreetServer {
private ServerSocket serverSocket = null; private ServerSocket serverSocket;
private Socket clientSocket = null; private Socket clientSocket;
private PrintWriter out = null; private PrintWriter out;
private BufferedReader in = null; private BufferedReader in;
public void start(int port) { public void start(int port) {

View File

@ -2,8 +2,8 @@ package com.baeldung.socket;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;