|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2023 the original author or authors. |
| 2 | + * Copyright 2002-2024 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -557,7 +557,7 @@ protected Resource[] findPathMatchingResources(String locationPattern) throws IO
|
557 | 557 | String rootDirPath = determineRootDir(locationPattern);
|
558 | 558 | String subPattern = locationPattern.substring(rootDirPath.length());
|
559 | 559 | Resource[] rootDirResources = getResources(rootDirPath);
|
560 |
| - Set<Resource> result = new LinkedHashSet<>(16); |
| 560 | + Set<Resource> result = new LinkedHashSet<>(64); |
561 | 561 | for (Resource rootDirResource : rootDirResources) {
|
562 | 562 | rootDirResource = resolveRootDirResource(rootDirResource);
|
563 | 563 | URL rootDirUrl = rootDirResource.getURL();
|
@@ -706,7 +706,7 @@ protected Set<Resource> doFindPathMatchingJarResources(Resource rootDirResource,
|
706 | 706 | // The Sun JRE does not return a slash here, but BEA JRockit does.
|
707 | 707 | rootEntryPath = rootEntryPath + "/";
|
708 | 708 | }
|
709 |
| - Set<Resource> result = new LinkedHashSet<>(8); |
| 709 | + Set<Resource> result = new LinkedHashSet<>(64); |
710 | 710 | for (Enumeration<JarEntry> entries = jarFile.entries(); entries.hasMoreElements();) {
|
711 | 711 | JarEntry entry = entries.nextElement();
|
712 | 712 | String entryPath = entry.getName();
|
@@ -756,7 +756,7 @@ protected JarFile getJarFile(String jarFileUrl) throws IOException {
|
756 | 756 | protected Set<Resource> doFindPathMatchingFileResources(Resource rootDirResource, String subPattern)
|
757 | 757 | throws IOException {
|
758 | 758 |
|
759 |
| - Set<Resource> result = new LinkedHashSet<>(); |
| 759 | + Set<Resource> result = new LinkedHashSet<>(64); |
760 | 760 | URI rootDirUri;
|
761 | 761 | try {
|
762 | 762 | rootDirUri = rootDirResource.getURI();
|
@@ -865,7 +865,7 @@ protected Set<Resource> doFindPathMatchingFileResources(Resource rootDirResource
|
865 | 865 | * @see PathMatcher#match(String, String)
|
866 | 866 | */
|
867 | 867 | protected Set<Resource> findAllModulePathResources(String locationPattern) throws IOException {
|
868 |
| - Set<Resource> result = new LinkedHashSet<>(16); |
| 868 | + Set<Resource> result = new LinkedHashSet<>(64); |
869 | 869 |
|
870 | 870 | // Skip scanning the module path when running in a native image.
|
871 | 871 | if (NativeDetector.inNativeImage()) {
|
@@ -966,7 +966,7 @@ private static class PatternVirtualFileVisitor implements InvocationHandler {
|
966 | 966 |
|
967 | 967 | private final String rootPath;
|
968 | 968 |
|
969 |
| - private final Set<Resource> resources = new LinkedHashSet<>(); |
| 969 | + private final Set<Resource> resources = new LinkedHashSet<>(64); |
970 | 970 |
|
971 | 971 | public PatternVirtualFileVisitor(String rootPath, String subPattern, PathMatcher pathMatcher) {
|
972 | 972 | this.subPattern = subPattern;
|
@@ -997,7 +997,6 @@ else if ("visit".equals(methodName)) {
|
997 | 997 | else if ("toString".equals(methodName)) {
|
998 | 998 | return toString();
|
999 | 999 | }
|
1000 |
| - |
1001 | 1000 | throw new IllegalStateException("Unexpected method invocation: " + method);
|
1002 | 1001 | }
|
1003 | 1002 |
|
|
0 commit comments