Skip to content

Commit

Permalink
Fix a lint error
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 620895298
Change-Id: I63c114e64097bc9d2bf5691d4f66ee7d1633d825
  • Loading branch information
cushon authored and copybara-github committed Apr 1, 2024
1 parent 1cea31d commit 852273f
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,6 @@ private void addStarlarkFilesToElement(
*/
private static Element createValueElement(
Document doc, Type<?> type, Iterable<Object> values, LabelPrinter labelPrinter) {
// "Import static" with method scope:
Type<?> LABEL_LIST = BuildType.LABEL_LIST;
Type<?> LICENSE = BuildType.LICENSE;
Type<?> STRING_LIST = Types.STRING_LIST;

final Element elem;
final boolean hasMultipleValues = Iterables.size(values) > 1;
Type<?> elemType = type.getListElementType();
Expand All @@ -339,18 +334,18 @@ private static Element createValueElement(
}
}
}
} else if (type == LICENSE) {
} else if (type == BuildType.LICENSE) {
elem = createSingleValueElement(doc, "license", hasMultipleValues);
if (!hasMultipleValues) {
License license = (License) Iterables.getOnlyElement(values);

Element exceptions =
createValueElement(doc, LABEL_LIST, license.getExceptions(), labelPrinter);
createValueElement(doc, BuildType.LABEL_LIST, license.getExceptions(), labelPrinter);
exceptions.setAttribute("name", "exceptions");
elem.appendChild(exceptions);

Element licenseTypes =
createValueElement(doc, STRING_LIST, license.getLicenseTypes(), labelPrinter);
createValueElement(doc, Types.STRING_LIST, license.getLicenseTypes(), labelPrinter);
licenseTypes.setAttribute("name", "license-types");
elem.appendChild(licenseTypes);
}
Expand Down

0 comments on commit 852273f

Please sign in to comment.