Skip to content

Commit 244fea5

Browse files
author
1luik
committed
修复#3103
1 parent dc9d8fe commit 244fea5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

memorycompiler/src/main/java/com/taobao/arthas/compiler/PackageInternalsFinder.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,23 @@ private List<JavaFileObject> fuse(URL packageFolderURL, String packageName) {
129129
}else {
130130
//是否可以在硬盘上找到对应的文件
131131
try {
132-
File file = new File(new URI(jarUri));
132+
URI uri1 = new URI(jarUri);
133+
// 获取 authority(host:port) + path + query + fragment
134+
StringBuilder sb = new StringBuilder();
135+
if (uri1.getAuthority() != null) {
136+
sb.append(uri1.getAuthority());
137+
}
138+
if (uri1.getPath() != null) {
139+
sb.append(uri1.getPath());
140+
}
141+
if (uri1.getQuery() != null) {
142+
sb.append('?').append(uri1.getQuery());
143+
}
144+
if (uri1.getFragment() != null) {
145+
sb.append('#').append(uri1.getFragment());
146+
}
147+
148+
File file = new File(sb.toString());
133149
if (file.exists()) {
134150
//可能是文件或目录
135151
if (file.isDirectory()) {

0 commit comments

Comments
 (0)