@@ -138,7 +138,7 @@ Sbom getDependenciesSbom(Path manifestPath, boolean buildTree) throws IOExceptio
138138 boolean matchManifestVersions =
139139 Environment .getBoolean (Provider .PROP_MATCH_MANIFEST_VERSIONS , false );
140140 if (matchManifestVersions ) {
141- String [] goModGraphLines = goModulesResult .split (System . lineSeparator () );
141+ String [] goModGraphLines = goModulesResult .split (Operations . GENERIC_LINE_SEPARATOR );
142142 performManifestVersionsCheck (goModGraphLines , manifestPath );
143143 }
144144 if (!buildTree ) {
@@ -152,7 +152,7 @@ Sbom getDependenciesSbom(Path manifestPath, boolean buildTree) throws IOExceptio
152152 private void performManifestVersionsCheck (String [] goModGraphLines , Path manifestPath ) {
153153 try {
154154 String goModLines = Files .readString (manifestPath );
155- String [] lines = goModLines .split (System . lineSeparator () );
155+ String [] lines = goModLines .split (Operations . GENERIC_LINE_SEPARATOR );
156156 String root = getParentVertex (goModGraphLines [0 ]);
157157 List <String > comparisonLines =
158158 Arrays .stream (goModGraphLines )
@@ -271,7 +271,8 @@ private Sbom buildSbomFromGraph(
271271 // iterate over go mod graph line by line and create map , with each entry to contain module as
272272 // a key , and
273273 // value of list of that module' dependencies.
274- List <String > linesList = Arrays .asList (goModulesResult .split (System .lineSeparator ()));
274+ List <String > linesList =
275+ Arrays .asList (goModulesResult .split (Operations .GENERIC_LINE_SEPARATOR ));
275276
276277 int startingIndex = 0 ;
277278 for (String line : linesList ) {
@@ -325,7 +326,7 @@ private Map<String, List<String>> getFinalPackagesVersionsForModule(
325326 String finalVersionsForAllModules =
326327 Operations .runProcessGetOutput (manifestPath .getParent (), "go" , "list" , "-m" , "all" );
327328 Map <String , String > finalModulesVersions =
328- Arrays .stream (finalVersionsForAllModules .split (System . lineSeparator () ))
329+ Arrays .stream (finalVersionsForAllModules .split (Operations . GENERIC_LINE_SEPARATOR ))
329330 .filter (string -> string .trim ().split (" " ).length == 2 )
330331 .collect (
331332 Collectors .toMap (
@@ -437,7 +438,7 @@ private String buildGoModulesDependencies(Path manifestPath) {
437438 }
438439
439440 private Sbom buildSbomFromList (String golangDeps , List <PackageURL > ignoredDeps ) {
440- String [] allModulesFlat = golangDeps .split (System . lineSeparator () );
441+ String [] allModulesFlat = golangDeps .split (Operations . GENERIC_LINE_SEPARATOR );
441442 String parentVertex = getParentVertex (allModulesFlat [0 ]);
442443 PackageURL root = toPurl (parentVertex , "@" , this .goEnvironmentVariableForPurl );
443444 // Get only direct dependencies of root package/module, and that's it.
0 commit comments