if (event == UpdateListener.ADD) {
if (event == UpdateListener.ADD || event == UpdateListener.REMOVE) {
                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;                        }                    }                }