void () { // do not change position final AntBuildTarget[] targets = getModel().getTargets(); final Map<String, AntBuildTarget> targetByName = new LinkedHashMap<>(targets.length); for (AntBuildTarget target : targets) { String targetName = target.getName(); if(targetName != null) { targetByName.put(targetName, target); } } synchronized (myOptionsLock) { myCachedExternalProperties = null; final ArrayList<TargetFilter> filters = TARGET_FILTERS.getModifiableList(myAllOptions); for (Iterator<TargetFilter> iterator = filters.iterator(); iterator.hasNext(); ) { final TargetFilter filter = iterator.next(); final String name = filter.getTargetName(); if (name == null) { iterator.remove(); } else { AntBuildTarget target = targetByName.get(name); if (target != null) { filter.updateDescription(target); targetByName.remove(name); } else { iterator.remove(); } } } // handle the rest of targets with non-null names for (AntBuildTarget target : targetByName.values()) { filters.add(TargetFilter.fromTarget(target)); } } }