Source:
<code>private IStatus validateSubsystemMapping(SubsystemMapping mapping) { ArrayList<IStatus> warningsErrors = new ArrayList<IStatus>(); String serverType = mapping.getServerType(); String[] requiredSystem = mapping.getSubsystem().getRequiredSystems(); for( int i = 0; i < requiredSystem.length; i++ ) { SubsystemMapping[] mappingsForSystem = getSubsystemMappings(serverType, requiredSystem[i]); for( int k = 0; k < mappingsForSystem.length; k++ ) { validateSubsystemMapping(mappingsForSystem[k]); } if( mappingsForSystem.length == 0 || allInvalid(mappingsForSystem)) { warningsErrors.add(new Status(IStatus.ERROR, ASWTPToolsPlugin.PLUGIN_ID, "Invalid controller: - missing required dependent system " + requiredSystem[i])); } } Map<String, String> m = mapping.getSubsystem().getRequiredSubsystems(); Iterator<String> j = m.keySet().iterator(); <START> while(j.hasNext()) { <END> String system2 = j.next(); String subsys2 = m.get(system2); SubsystemMapping[] matched = getSubsystemMappings(serverType, system2); boolean found = false; SubsystemMapping found2 = null; for( int k = 0; k < matched.length && !found; k++ ) { if( matched[k].mappedId.equals(subsys2)) { found = true; found2 = matched[k]; } } if( !found ) { warningsErrors.add(new Status(IStatus.ERROR, ASWTPToolsPlugin.PLUGIN_ID, "Invalid controller: - missing required dependent subsystem ")); } else { validateSubsystemMapping(found2); if( !found2.isValid ) { warningsErrors.add(new Status(IStatus.ERROR, ASWTPToolsPlugin.PLUGIN_ID, "Invalid controller: - required subsystem has errors: " + found2.validationError)); } } } IStatus[] allErrors = (IStatus[]) warningsErrors.toArray(new IStatus[warningsErrors.size()]); return new MultiStatus(ASWTPToolsPlugin.PLUGIN_ID, 0, allErrors, "Errors validating subsystem mapping=" + serverType + " and subsystem id " + mapping.getSubsystem().getId(), null); }</code><technical_language>iterate entryset instead,</technical_language>

Target:
private IStatus validateSubsystemMapping(SubsystemMapping mapping) { ArrayList<IStatus> warningsErrors = new ArrayList<IStatus>(); String serverType = mapping.getServerType(); String[] requiredSystem = mapping.getSubsystem().getRequiredSystems(); for( int i = 0; i < requiredSystem.length; i++ ) { SubsystemMapping[] mappingsForSystem = getSubsystemMappings(serverType, requiredSystem[i]); for( int k = 0; k < mappingsForSystem.length; k++ ) { validateSubsystemMapping(mappingsForSystem[k]); } if( mappingsForSystem.length == 0 || allInvalid(mappingsForSystem)) { warningsErrors.add(new Status(IStatus.ERROR, ASWTPToolsPlugin.PLUGIN_ID, "Invalid controller: - missing required dependent system " + requiredSystem[i])); } } Map<String, String> m = mapping.getSubsystem().getRequiredSubsystems(); for (Map.Entry<String, String> entry : m.entrySet()) { String system2 = entry.getKey(); Object subsys2 = entry.getValue(); SubsystemMapping[] matched = getSubsystemMappings(serverType, system2); boolean found = false; SubsystemMapping found2 = null; for( int k = 0; k < matched.length && !found; k++ ) { if( matched[k].mappedId.equals(subsys2)) { found = true; found2 = matched[k]; } } if( !found ) { warningsErrors.add(new Status(IStatus.ERROR, ASWTPToolsPlugin.PLUGIN_ID, "Invalid controller: - missing required dependent subsystem ")); } else { validateSubsystemMapping(found2); if( !found2.isValid ) { warningsErrors.add(new Status(IStatus.ERROR, ASWTPToolsPlugin.PLUGIN_ID, "Invalid controller: - required subsystem has errors: " + found2.validationError)); } } } IStatus[] allErrors = (IStatus[]) warningsErrors.toArray(new IStatus[warningsErrors.size()]); return new MultiStatus(ASWTPToolsPlugin.PLUGIN_ID, 0, allErrors, "Errors validating subsystem mapping=" + serverType + " and subsystem id " + mapping.getSubsystem().getId(), null); }