Description
Test contains:
Server s = null;
try {
s = new Server();
s.startServer();
...
} finally {
s.stopServer();
}
If "new Server() throws an exception we hit the finally block, s is still null and we then throw NullPointerException instead of the real exception.
The try block should at least start after "s = new Server();" and possibly after startServer() as well.
Server s = null;
try {
s = new Server();
s.startServer();
...
} finally {
s.stopServer();
}
If "new Server() throws an exception we hit the finally block, s is still null and we then throw NullPointerException instead of the real exception.
The try block should at least start after "s = new Server();" and possibly after startServer() as well.