@@ -397,7 +397,7 @@ def test_get_command_java_equinox():
397397 )
398398
399399
400- # Ref:https://github.com/walles/px/issues/137
400+ # Ref: https://github.com/walles/px/issues/137
401401def test_get_command_line_jdk_java_options ():
402402 commandline = """
403403/opt/homebrew/Cellar/openjdk/24.0.1/libexec/openjdk.jdk/Contents/Home/bin/java
@@ -446,6 +446,40 @@ def test_get_command_line_jdk_java_options():
446446 assert px_commandline .get_command (commandline ) == "Launcher"
447447
448448
449+ # Ref: https://github.com/walles/px/issues/139
450+ def test_get_command_line_java_issue_139 ():
451+ commandline = """
452+ /opt/homebrew/Cellar/openjdk@21/21.0.8/libexec/openjdk.jdk/Contents/Home/bin/java
453+ --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
454+ --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
455+ --add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
456+ --add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
457+ --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
458+ --add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
459+ --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
460+ --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
461+ --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
462+ --add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
463+ --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
464+ --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
465+ --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
466+ @/Users/johan/.gradle/.tmp/gradle-worker-classpath12697647132064750531txt
467+ -Xmx2g
468+ -Dfile.encoding=UTF-8
469+ -Duser.country=SE
470+ -Duser.language=sv
471+ -Duser.variant
472+ worker.org.gradle.process.internal.worker.GradleWorkerMain
473+ 'Gradle
474+ Worker
475+ Daemon
476+ 3'
477+ """ .strip ().replace ("\n " , " " )
478+ commandline = re .sub (r"\s+" , " " , commandline )
479+
480+ assert px_commandline .get_command (commandline ) == "GradleWorkerMain"
481+
482+
449483def test_prettify_java_class ():
450484 assert (
451485 px_commandline .prettify_fully_qualified_java_class ("com.example.MyClass" )
@@ -458,7 +492,7 @@ def test_prettify_java_class():
458492 assert px_commandline .prettify_fully_qualified_java_class ("" ) is None
459493
460494
461- # Ref:https://github.com/walles/px/issues/126
495+ # Ref: https://github.com/walles/px/issues/126
462496def test_get_command_flutter ():
463497 # Candidate contains no slashes => subcommand
464498 assert (
0 commit comments