From 9a09f204acc1a9110dd9b04edb0b299d40ad7b5e Mon Sep 17 00:00:00 2001 From: Chris Newland Date: Fri, 16 Aug 2024 20:51:36 +0100 Subject: [PATCH] fix src.zip loading from modules --- .../jitwatch/loader/BytecodeLoader.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/src/main/java/org/adoptopenjdk/jitwatch/loader/BytecodeLoader.java b/core/src/main/java/org/adoptopenjdk/jitwatch/loader/BytecodeLoader.java index fe12b311..4195da2d 100644 --- a/core/src/main/java/org/adoptopenjdk/jitwatch/loader/BytecodeLoader.java +++ b/core/src/main/java/org/adoptopenjdk/jitwatch/loader/BytecodeLoader.java @@ -306,6 +306,26 @@ else if (line.startsWith(S_BYTECODE_CLASSFILE)) classBytecode.setModuleName(moduleName); } } + else + { + String jrt = "jrt:/"; + + startIndex = line.indexOf(jrt); + + if (startIndex != -1) + { + startIndex += jrt.length(); + + int endIndex = line.indexOf('/', startIndex); + + if (endIndex != -1) + { + String moduleName = line.substring(startIndex, endIndex); + + classBytecode.setModuleName(moduleName); + } + } + } } else if (line.startsWith(S_BYTECODE_SOURCE_FILE)) {