From 633f1da2a0d97e7bd39ad65af5e37ae985261e79 Mon Sep 17 00:00:00 2001 From: philwalk Date: Fri, 21 Feb 2025 11:23:47 -0700 Subject: [PATCH 1/2] replaced previous commits with a cp filter in Jar.scala [Cherry-picked f24b5d15eaa3badfeb4b712b3f2d6c234e409a85] --- compiler/src/dotty/tools/io/Jar.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/io/Jar.scala b/compiler/src/dotty/tools/io/Jar.scala index b4c2024bb487..4f70bafecae9 100644 --- a/compiler/src/dotty/tools/io/Jar.scala +++ b/compiler/src/dotty/tools/io/Jar.scala @@ -50,7 +50,7 @@ class Jar(file: File) { def mainClass: Option[String] = manifest.map(_(Name.MAIN_CLASS)) /** The manifest-defined classpath String if available. */ def classPathString: Option[String] = - for (m <- manifest ; cp <- m.attrs.get(Name.CLASS_PATH)) yield cp + for (m <- manifest ; cp <- m.attrs.get(Name.CLASS_PATH) if !cp.isBlank()) yield cp def classPathElements: List[String] = classPathString match { case Some(s) => s.split("\\s+").toList case _ => Nil From 13b6b8c36926bb4fc7b1e56fd9c9e377816f1fcd Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Fri, 21 Feb 2025 20:39:02 +0100 Subject: [PATCH 2/2] chore: Apply suggestions from code review [Cherry-picked 01fc715ee486bb2257165804f6a9ebcad2d29ddd] --- compiler/src/dotty/tools/io/Jar.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/io/Jar.scala b/compiler/src/dotty/tools/io/Jar.scala index 4f70bafecae9..6076638bff45 100644 --- a/compiler/src/dotty/tools/io/Jar.scala +++ b/compiler/src/dotty/tools/io/Jar.scala @@ -50,7 +50,7 @@ class Jar(file: File) { def mainClass: Option[String] = manifest.map(_(Name.MAIN_CLASS)) /** The manifest-defined classpath String if available. */ def classPathString: Option[String] = - for (m <- manifest ; cp <- m.attrs.get(Name.CLASS_PATH) if !cp.isBlank()) yield cp + for (m <- manifest ; cp <- m.attrs.get(Name.CLASS_PATH) if !cp.trim().isEmpty()) yield cp def classPathElements: List[String] = classPathString match { case Some(s) => s.split("\\s+").toList case _ => Nil