if (event == UpdateListener.ADD) {
if (event == UpdateListener.ADD || event == UpdateListener.REMOVE) {
    protected void registerUpdateListener() {        if (listener == null) {            listener = new UpdateListener() {                public void documentUpdated(DocumentImpl document, int event) {                    if (event == UpdateListener.ADD) {                        // clear all                        cachedArgs = null;                        cached = null;                        cachedDocs = null;                    } else {                        if (cachedDocs != null                                && cachedDocs.contains(document.getDocId())) {                            cachedDocs = null;                            cached = null;                            cachedArgs = null;                        }                    }                }                                public void debug() {                	LOG.debug("UpdateListener: Line: " + getASTNode().getLine() + ": " + ExtDocument.this.toString());                	                }            };            context.registerUpdateListener(listener);        }    }