#fixed code
                                protected void processEvent(final SelectionKey key) {
        IOSessionImpl session = (IOSessionImpl) key.attachment();
        try {
            if (key.isAcceptable()) {
                acceptable(key);
            }
            if (key.isConnectable()) {
                connectable(key);
            }
            if (key.isReadable()) {
                session.resetLastRead();
                readable(key);
            }
            if (key.isWritable()) {
                session.resetLastWrite();
                writable(key);
            }
        } catch (CancelledKeyException ex) {
            queueClosedSession(session);
            key.attach(null);
        }
    }
#vulnerable code 
                                protected void processEvent(final SelectionKey key) {
        SessionHandle handle = (SessionHandle) key.attachment();
        IOSession session = handle.getSession();
        try {
            if (key.isAcceptable()) {
                acceptable(key);
            }
            if (key.isConnectable()) {
                connectable(key);
            }
            if (key.isReadable()) {
                handle.resetLastRead();
                readable(key);
            }
            if (key.isWritable()) {
                handle.resetLastWrite();
                writable(key);
            }
        } catch (CancelledKeyException ex) {
            queueClosedSession(session);
            key.attach(null);
        }
    } 
                            #location 12 
                            #vulnerability type THREAD_SAFETY_VIOLATION