@Override public void removeUnit(Unit unit) { synchronized (modelLoader) { if (lazyUnits.remove(unit)) { for (Declaration d : unit.getDeclarations()) { compiledDeclarations.remove(d); // TODO : remove the declaration from the declaration map in AbstractModelLoader } modelLoader.removeDeclarations(unit.getDeclarations()); } else { super.removeUnit(unit); } } }