#vulnerable code 
                             @Override
	protected boolean setState(RequestState state) {
		boolean success = super.setState(state);
		if (!success) {
			return false;
		}
		if (listener != null) {
			if (state == RequestState.Succeeded) {
				listener.onRequestSucceeded(this);
			} else if (state == RequestState.Failed) {
				listener.onRequestFailed(getException());
			} else if (state == RequestState.TimeOut) {
				listener.onRequestTimeout(this);
			}
		}
		if (state == RequestState.Succeeded || state == RequestState.Failed || state == RequestState.TimeOut) {
			synchronized (signal) {
				signal.notifyAll();
			}
		}
		return true;
	} 
                            #location 13 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                             @Override
	protected boolean setState(RequestState state) {
		boolean success = super.setState(state);
		if (!success) {
			return false;
		}
		if (!listeners.isEmpty()) {
			if (state == RequestState.Succeeded) {
				for (RequestListener listener : listeners) {
					listener.onRequestSucceeded(this);
				}
			} else if (state == RequestState.Failed) {
				for (RequestListener listener : listeners) {
					listener.onRequestFailed(getException());
				}
			} else if (state == RequestState.TimeOut) {
				for (RequestListener listener : listeners) {
					listener.onRequestTimeout(this);
				}
			}
		}
		if (state == RequestState.Succeeded || state == RequestState.Failed || state == RequestState.TimeOut) {
			synchronized (signal) {
				signal.notifyAll();
			}
		}
		return true;
	}