File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
apm-agent-core/src/main/java/co/elastic/apm/agent/bci/bytebuddy Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 3333import org .slf4j .LoggerFactory ;
3434
3535import javax .annotation .Nullable ;
36+ import java .io .File ;
3637import java .io .IOException ;
3738import java .net .JarURLConnection ;
3839import java .net .URL ;
@@ -156,13 +157,7 @@ public boolean matches(@Nullable ProtectionDomain protectionDomain) {
156157 if (urlConnection instanceof JarURLConnection ) {
157158 jarFile = ((JarURLConnection ) urlConnection ).getJarFile ();
158159 } else {
159- try {
160- jarFile = new JarFile (jarUrl .getFile ());
161- } catch (IOException e ) {
162- // Maybe the URL is encoded- try to decode
163- //noinspection CharsetObjectCanBeUsed - can't use this API as it is from Java 10 only
164- jarFile = new JarFile (URLDecoder .decode (jarUrl .getFile (), "UTF-8" ));
165- }
160+ jarFile = new JarFile (new File (jarUrl .toURI ()));
166161 }
167162 Manifest manifest = jarFile .getManifest ();
168163 if (manifest != null ) {
You can’t perform that action at this time.
0 commit comments