#vulnerable code 
                             protected Packet callAndGetResult(Packet request) {
		Call c = createCall(request);
	    synchronized (c) {
			try {
				out.enQueue(c);
				c.wait();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	    
	    Packet response = c.getResponse();
		return response;
	} 
                            #location 2 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                             protected Packet callAndGetResult(Packet request) {
		Call c = createCall(request);
	    return doCall(c);
	}