Skip to content

Commit ed946ec

Browse files
committed
fix: yarn classic was adding an invalid @ to the version
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
1 parent 10693ba commit ed946ec

3 files changed

Lines changed: 1960 additions & 1959 deletions

File tree

src/main/java/com/redhat/exhort/providers/YarnClassicProcessor.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515
*/
1616
package com.redhat.exhort.providers;
1717

18+
import java.nio.file.Path;
19+
import java.util.HashMap;
20+
import java.util.Map;
21+
import java.util.TreeMap;
22+
1823
import com.fasterxml.jackson.databind.JsonNode;
1924
import com.fasterxml.jackson.databind.node.ArrayNode;
2025
import com.github.packageurl.PackageURL;
2126
import com.redhat.exhort.providers.javascript.model.Manifest;
2227
import com.redhat.exhort.sbom.Sbom;
23-
import java.nio.file.Path;
24-
import java.util.HashMap;
25-
import java.util.Map;
26-
import java.util.TreeMap;
2728

2829
/** Concrete implementation of the Yarn Classic processor, supporting Yarn 1.x */
2930
public final class YarnClassicProcessor extends YarnProcessor {
@@ -138,7 +139,7 @@ private static class NodeMetaData {
138139
this.nodeName = node.get("name").asText();
139140
var versionIdx = nodeName.lastIndexOf("@");
140141
this.name = nodeName.substring(0, versionIdx);
141-
this.version = nodeName.substring(versionIdx);
142+
this.version = nodeName.substring(versionIdx + 1);
142143
this.purl = JavaScriptProvider.toPurl(name, version);
143144
var shadowNode = node.get("shadow");
144145
this.shadow = shadowNode != null && shadowNode.asBoolean();

0 commit comments

Comments
 (0)