From 09b82354eeb341ced847e2b98eb1d148308e6336 Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Thu, 7 Dec 2023 12:52:24 +0000 Subject: [PATCH] Placate linter again Signed-off-by: Stewart X Addison --- .../src/temurin/sbom/TemurinGenSBOM.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cyclonedx-lib/src/temurin/sbom/TemurinGenSBOM.java b/cyclonedx-lib/src/temurin/sbom/TemurinGenSBOM.java index 3004b13e2a..cf99ebc172 100644 --- a/cyclonedx-lib/src/temurin/sbom/TemurinGenSBOM.java +++ b/cyclonedx-lib/src/temurin/sbom/TemurinGenSBOM.java @@ -327,7 +327,7 @@ static Bom addComponentExternalReference(final String fileName, final String has return bom; } - static Bom addFormulation(final String fileName, String name) { // Method to store Formulation + static Bom addFormulation(final String fileName, final String name) { // Method to store Formulation Bom bom = readJSONfile(fileName); List formulation = bom.getFormulation(); if (formulation == null) { @@ -343,17 +343,17 @@ static Bom addFormulation(final String fileName, String name) { // Meth static Bom addFormulationComp(final String fileName, final String formulaName, final String name, final String type/*, final String version, final String description */) { Bom bom = readJSONfile(fileName); - if ( formulaName == null ) { + if (formulaName == null) { System.out.println("addFormulationComp: formulaName is null"); return bom; - } else if ( name == null ) { + } else if (name == null) { System.out.println("addFormulationComp: name is null"); return bom; } List formulation = bom.getFormulation(); // Look for the formula, and add the new component to it boolean found = false; - for ( Formula item : formulation ) { + for (Formula item : formulation) { if (item.getBomRef().equals(formulaName)) { found = true; Component comp = new Component(); @@ -368,7 +368,7 @@ static Bom addFormulationComp(final String fileName, final String formulaName, f item.setComponents(components); } } - if (found == false) { + if (!found) { System.out.println("addFormulationComp could not add component as it couldn't find an entry for formula " + formulaName); } return bom; @@ -376,21 +376,21 @@ static Bom addFormulationComp(final String fileName, final String formulaName, f static Bom addFormulationCompProp(final String fileName, final String formulaName, final String componentName, final String name, final String value) { // Method to store metadata --> Properties List --> name-values Bom bom = readJSONfile(fileName); - boolean foundFormula=false; - boolean foundComponent=false; + boolean foundFormula = false; + boolean foundComponent = false; List formulation = bom.getFormulation(); // Look for the formula, and add the new component to it - for ( Formula item : formulation ) { + for (Formula item : formulation) { if (item.getBomRef().equals(formulaName)) { - foundFormula=true; + foundFormula = true; // Search for the component in the formula and add new component to it List components = item.getComponents(); - if ( components == null ) { + if (components == null) { System.out.println("addFormulationCompProp: Components is null - has addFormulationComp been called?"); } else { for (Component comp : components) { if (comp.getName().equals(componentName)) { - foundComponent=true; + foundComponent = true; Property prop1 = new Property(); prop1.setName(name); prop1.setValue(value); @@ -401,9 +401,9 @@ static Bom addFormulationCompProp(final String fileName, final String formulaNam } } } - if (foundFormula == false) { + if (!foundFormula) { System.out.println("addFormulationCompProp could not add add property as it couldn't find an entry for formula " + formulaName); - } else if (foundComponent == false) { + } else if (!foundComponent) { System.out.println("addFormulationCompProp could not add add property as it couldn't find an entry for component " + componentName); } return bom;