Skip to content

Commit

Permalink
chore(cyclonedx): Simplify BOM generation code
Browse files Browse the repository at this point in the history
By now generators share the common `AbstractBomGenerator` class.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Jul 3, 2024
1 parent eae8cbe commit 70209af
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,7 @@ class CycloneDxReporter : Reporter {
val outputFile = outputDir.resolve("$outputName.${fileFormat.fileExtension}")

val bomGenerator = when (fileFormat) {
// Note that the BomXmlGenerator and BomJsonGenerator interfaces do not share a common base interface.
FileFormat.XML -> BomGeneratorFactory.createXml(schemaVersion, bom) as Any
FileFormat.XML -> BomGeneratorFactory.createXml(schemaVersion, bom)
FileFormat.JSON -> {
// JSON output cannot handle extensible types (see [1]), so simply remove them. As JSON output is
// guaranteed to be the last format serialized, it is okay to modify the BOM here without doing a
Expand Down

0 comments on commit 70209af

Please sign in to comment.