0

I'm debugging a simple server-client socket application, and I have problems at the line

inputStream = new ObjectInputStream(inStream);

When stepping over this line of code, the debugger flat-out stops working, hanging up the debugged program. When I tried (force) stepping into it, after seeing the window to accept terms and conditions of a decompiler I've arrived at a step when it says "Source code does not match the bytecode" in the file "Launcher.class"

This is the faulty function: (arguments passed are "localhost" and 8080)

 public void connect(String host, int port) throws IOException {
    if (connected) {
        throw new IOException("Already connected.");
    }

    clientSocket = new Socket(host, port);
    outStream = clientSocket.getOutputStream();
    outputStream = new ObjectOutputStream(outStream);
    inStream = clientSocket.getInputStream();
    inputStream = new ObjectInputStream(inStream);
    connected=true;
    System.out.println("Connected to "+host+" over port "+ port);
}
Mark
  • 103
  • 1
  • 4
  • Did you clean the project and rebuild? – chb May 09 '18 at 10:40
  • @chb Rebuilding the project doesn't help. I've also tried going over a BufferedInputStream and creating an ObjectInputStream from that, but alas. – Mark May 09 '18 at 10:42
  • Have a look at this question: https://stackoverflow.com/questions/36753524/library-source-does-not-match-the-bytecode-for-class Another poster also suggested that it might be an issue with caching in Gradle. – chb May 09 '18 at 10:50

0 Answers0