30
30
* based on a file name prefix and an extension with convenience to support
31
31
* multiple classpath locations.
32
32
*
33
- * <p>Only register hints for matching classpath locations, which allows for
33
+ * <p>Only registers hints for matching classpath locations, which allows for
34
34
* several locations to be provided without contributing unnecessary hints.
35
35
*
36
36
* @author Stephane Nicoll
@@ -49,8 +49,8 @@ public class FilePatternResourceHintsRegistrar {
49
49
* extensions.
50
50
* @param names the file names
51
51
* @param locations the classpath locations
52
- * @param extensions the file extensions (starts with a dot)
53
- * @deprecated as of 6.0.12 in favor of {@link #forClassPathLocations(String...) the builder}
52
+ * @param extensions the file extensions (starting with a dot)
53
+ * @deprecated as of 6.0.12 in favor of {@linkplain #forClassPathLocations(String...) the builder}
54
54
*/
55
55
@ Deprecated (since = "6.0.12" , forRemoval = true )
56
56
public FilePatternResourceHintsRegistrar (List <String > names , List <String > locations ,
@@ -74,7 +74,7 @@ public static Builder forClassPathLocations(String... locations) {
74
74
75
75
@ Deprecated (since = "6.0.12" , forRemoval = true )
76
76
public void registerHints (ResourceHints hints , @ Nullable ClassLoader classLoader ) {
77
- ClassLoader classLoaderToUse = (classLoader != null ) ? classLoader : getClass ().getClassLoader ();
77
+ ClassLoader classLoaderToUse = (classLoader != null ? classLoader : getClass ().getClassLoader () );
78
78
List <String > includes = new ArrayList <>();
79
79
for (String location : this .locations ) {
80
80
if (classLoaderToUse .getResource (location ) != null ) {
@@ -118,7 +118,7 @@ public Builder withClasspathLocations(String... classpathLocations) {
118
118
119
119
/**
120
120
* Consider the specified file prefixes. Any file whose name starts with one
121
- * of the specified prefix is considered. A prefix cannot contain the {@code *}
121
+ * of the specified prefixes is considered. A prefix cannot contain the {@code *}
122
122
* character.
123
123
* @param filePrefixes the file prefixes to consider
124
124
* @return this builder
@@ -129,8 +129,8 @@ public Builder withFilePrefixes(String... filePrefixes) {
129
129
}
130
130
131
131
/**
132
- * Consider the specified file extensions. A file extension must starts with a
133
- * {@code .} character..
132
+ * Consider the specified file extensions. A file extension must start with a
133
+ * {@code .} character.
134
134
* @param fileExtensions the file extensions to consider
135
135
* @return this builder
136
136
*/
@@ -147,8 +147,8 @@ FilePatternResourceHintsRegistrar build() {
147
147
148
148
/**
149
149
* Register resource hints for the current state of this builder. For each
150
- * classpath location that resolves against the {@code ClassLoader}, file
151
- * starting with the configured file prefixes and extensions are registered.
150
+ * classpath location that resolves against the {@code ClassLoader}, files
151
+ * with the configured file prefixes and extensions are registered.
152
152
* @param hints the hints contributed so far for the deployment unit
153
153
* @param classLoader the classloader, or {@code null} if even the system ClassLoader isn't accessible
154
154
*/
@@ -173,13 +173,13 @@ private static List<String> validateClasspathLocations(String... locations) {
173
173
return parsedLocations ;
174
174
}
175
175
176
- private static List <String > validateFilePrefixes (String ... fileNames ) {
177
- for (String name : fileNames ) {
178
- if (name .contains ("*" )) {
179
- throw new IllegalArgumentException ("File prefix '" + name + "' cannot contain '*'" );
176
+ private static List <String > validateFilePrefixes (String ... filePrefixes ) {
177
+ for (String filePrefix : filePrefixes ) {
178
+ if (filePrefix .contains ("*" )) {
179
+ throw new IllegalArgumentException ("File prefix '" + filePrefix + "' cannot contain '*'" );
180
180
}
181
181
}
182
- return Arrays .asList (fileNames );
182
+ return Arrays .asList (filePrefixes );
183
183
}
184
184
185
185
private static List <String > validateFileExtensions (String ... fileExtensions ) {
@@ -192,4 +192,5 @@ private static List<String> validateFileExtensions(String... fileExtensions) {
192
192
}
193
193
194
194
}
195
+
195
196
}
0 commit comments