void (AntDomTarget target) { if (myStage == Stage.TARGETS_WALKUP_STAGE) { final String targetEffectiveName = myCurrentTargetEffectiveName.peek(); if (myProcessedTargets.add(targetEffectiveName)) { final List<String> depsList = myDependenciesMap.get(targetEffectiveName); if (depsList != null) { for (String dependencyName : depsList) { final AntDomTarget dependency = getTargetByName(dependencyName); if (dependency != null) { processTarget(dependencyName, dependency); } } } super.visitTarget(target); } } else if (myStage == Stage.RESOLVE_MAP_BUILDING_STAGE){ final String declaredTargetName = target.getName().getRawText(); String effectiveTargetName; final InclusionKind inclusionKind = myNameContext.getCurrentInclusionKind(); switch (inclusionKind) { case IMPORT -> { final String alias = myNameContext.getShortPrefix() + declaredTargetName; if (!myTargetsResolveMap.containsKey(declaredTargetName)) { effectiveTargetName = declaredTargetName; myTargetsResolveMap.put(alias, target); } else { effectiveTargetName = alias; } } case INCLUDE -> effectiveTargetName = myNameContext.getFQPrefix() + declaredTargetName; default -> effectiveTargetName = declaredTargetName; } if (effectiveTargetName != null) { final AntDomTarget existingTarget = myTargetsResolveMap.get(effectiveTargetName); if (existingTarget != null && Comparing.equal(existingTarget.getAntProject(), target.getAntProject())) { duplicateTargetFound(existingTarget, target, effectiveTargetName); } else { myTargetsResolveMap.put(effectiveTargetName, target); final String dependsStr = target.getDependsList().getRawText(); Map<String, Pair<AntDomTarget, String>> depsMap = Collections.emptyMap(); if (dependsStr != null) { depsMap = new HashMap<>(); final StringTokenizer tokenizer = new StringTokenizer(dependsStr, ",", false); while (tokenizer.hasMoreTokens()) { final String token = tokenizer.nextToken().trim(); final String dependentTargetEffectiveName = myNameContext.calcTargetReferenceText(token); final AntDomTarget dependent = getTargetByName(dependentTargetEffectiveName); if (dependent != null) { depsMap.put(token, Pair.create(dependent, dependentTargetEffectiveName)); } addDependency(effectiveTargetName, dependentTargetEffectiveName); } } targetDefined(target, effectiveTargetName, depsMap); } } } }