Source:
private void loadLabelSections(Config rc) throws IOException { labelSections = Maps.newLinkedHashMap(); for (String name : rc.getSubsections(LABEL)) { List<LabelValue> values = Lists.newArrayList(); for (String value : rc.getStringList(LABEL, name, KEY_VALUE)) { try { values.add(parseLabelValue(value)); } catch (IllegalArgumentException notValue) { error(new ValidationError(PROJECT_CONFIG, String.format( "Invalid %s \"%s\" for label \"%s\": %s", KEY_VALUE, value, name, notValue.getMessage()))); } } LabelType label; String id = rc.getString(LABEL, name, KEY_ID); if (id == null || id.length() > 4) { error(new ValidationError(PROJECT_CONFIG, String.format( "Invalid label ID \"%s\" for label \"%s\": " + "Label ID may have at most 4 characters", id, name))); continue; } try { label = new LabelType(id, name, values); } catch (IllegalArgumentException badName) { error(new ValidationError(PROJECT_CONFIG, String.format( "Invalid label \"%s\"", name))); continue; } String abbr = rc.getString(LABEL, name, KEY_ABBREVIATION); if (abbr != null) { label.setAbbreviatedName(abbr); } String functionName = Objects.firstNonNull( rc.getString(LABEL, name, KEY_FUNCTION), "MaxWithBlock"); if (CategoryFunction.forName(functionName) != null) { label.setFunctionName(functionName); } else { error(new ValidationError(PROJECT_CONFIG, String.format( "Invalid %s for label \"%s\"", KEY_FUNCTION, name))); label.setFunctionName(null); } label.setCopyMinScore( rc.getBoolean(LABEL, name, KEY_COPY_MIN_SCORE, false)); label.setCanOverride( rc.getBoolean(LABEL, name, KEY_CAN_OVERRIDE, false)); labelSections.put(name, label); } }

Target:
private void loadLabelSections(Config rc) throws IOException { labelSections = Maps.newLinkedHashMap(); for (String name : rc.getSubsections(LABEL)) { List<LabelValue> values = Lists.newArrayList(); for (String value : rc.getStringList(LABEL, name, KEY_VALUE)) { try { values.add(parseLabelValue(value)); } catch (IllegalArgumentException notValue) { error(new ValidationError(PROJECT_CONFIG, String.format( "Invalid %s \"%s\" for label \"%s\": %s", KEY_VALUE, value, name, notValue.getMessage()))); } } LabelType label; String id = rc.getString(LABEL, name, KEY_ID); if (id == null || id.length() > 4) { error(new ValidationError(PROJECT_CONFIG, String.format( "Invalid label ID \"%s\" for label \"%s\": " + "Label ID may have at most 4 characters", id, name))); continue; } try { label = new LabelType(id, name, values); } catch (IllegalArgumentException badName) { error(new ValidationError(PROJECT_CONFIG, String.format( "Invalid label \"%s\"", name))); continue; } String abbr = rc.getString(LABEL, name, KEY_ABBREVIATION); if (abbr != null) { label.setAbbreviatedName(abbr); } String functionName = Objects.firstNonNull( rc.getString(LABEL, name, KEY_FUNCTION), "MaxWithBlock"); if (CategoryFunction.forName(functionName) != null) { label.setFunctionName(functionName); } else { error(new ValidationError(PROJECT_CONFIG, String.format( "Invalid %s for label \"%s\"", KEY_FUNCTION, name))); label.setFunctionName(null); } label.setCopyMinScore( rc.getBoolean(LABEL, name, KEY_COPY_MIN_SCORE, false)); label.setCanOverride( rc.getBoolean(LABEL, name, KEY_CAN_OVERRIDE, true)); labelSections.put(name, label); } }