|
28 | 28 | */ |
29 | 29 | public abstract class AbstractScannerImpl implements Scanner { |
30 | 30 | private final ArchiveDescriptorFactory archiveDescriptorFactory; |
31 | | - private final Map<URL, ArchiveDescriptorInfo> archiveDescriptorCache = new HashMap<>(); |
| 31 | + private final Map<String, ArchiveDescriptorInfo> archiveDescriptorCache = new HashMap<>(); |
32 | 32 |
|
33 | 33 | protected AbstractScannerImpl(ArchiveDescriptorFactory archiveDescriptorFactory) { |
34 | 34 | this.archiveDescriptorFactory = archiveDescriptorFactory; |
@@ -62,13 +62,13 @@ private ArchiveDescriptor buildArchiveDescriptor( |
62 | 62 | ScanEnvironment environment, |
63 | 63 | boolean isRootUrl) { |
64 | 64 | final ArchiveDescriptor descriptor; |
65 | | - final ArchiveDescriptorInfo descriptorInfo = archiveDescriptorCache.get( url ); |
| 65 | + final ArchiveDescriptorInfo descriptorInfo = archiveDescriptorCache.get( url.toExternalForm() ); |
66 | 66 | if ( descriptorInfo == null ) { |
67 | 67 | if ( !isRootUrl && archiveDescriptorFactory instanceof JarFileEntryUrlAdjuster jarFileEntryUrlAdjuster ) { |
68 | 68 | url = jarFileEntryUrlAdjuster.adjustJarFileEntryUrl( url, environment.getRootUrl() ); |
69 | 69 | } |
70 | 70 | descriptor = archiveDescriptorFactory.buildArchiveDescriptor( url ); |
71 | | - archiveDescriptorCache.put( url, new ArchiveDescriptorInfo( descriptor, isRootUrl ) ); |
| 71 | + archiveDescriptorCache.put( url.toExternalForm(), new ArchiveDescriptorInfo( descriptor, isRootUrl ) ); |
72 | 72 | } |
73 | 73 | else { |
74 | 74 | validateReuse( descriptorInfo, isRootUrl ); |
@@ -135,9 +135,9 @@ public ArchiveEntryHandler obtainArchiveEntryHandler(ArchiveEntry entry) { |
135 | 135 | return packageEntryHandler; |
136 | 136 | } |
137 | 137 | else if ( nameWithinArchive.endsWith( "module-info.class" ) ) { |
138 | | - //There's two reasons to skip this: the most important one is that Jandex |
139 | | - //is unable to analyze them, so we need to dodge it. |
140 | | - //Secondarily, we have no use for these so let's save the effort. |
| 138 | + // There are two reasons to skip this: the most important one is |
| 139 | + // that Jandex is unable to analyze them, so we need to dodge it. |
| 140 | + // Secondly, we have no use for these, so let's save the effort. |
141 | 141 | return NoopEntryHandler.NOOP_INSTANCE; |
142 | 142 | } |
143 | 143 | else if ( nameWithinArchive.endsWith( ".class" ) ) { |
|
0 commit comments