1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2021 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.
@@ -292,6 +292,7 @@ public void afterPropertiesSet() {
292
292
if (this .parameterNameDiscoverer != null ) {
293
293
configureParameterNameProvider (this .parameterNameDiscoverer , configuration );
294
294
}
295
+
295
296
List <InputStream > mappingStreams = null ;
296
297
if (this .mappingLocations != null ) {
297
298
mappingStreams = new ArrayList <>(this .mappingLocations .length );
@@ -322,18 +323,6 @@ public void afterPropertiesSet() {
322
323
}
323
324
}
324
325
325
- private void closeMappingStreams (@ Nullable List <InputStream > mappingStreams ){
326
- if (!CollectionUtils .isEmpty (mappingStreams )) {
327
- for (InputStream stream : mappingStreams ) {
328
- try {
329
- stream .close ();
330
- }
331
- catch (IOException ignored ) {
332
- }
333
- }
334
- }
335
- }
336
-
337
326
private void configureParameterNameProvider (ParameterNameDiscoverer discoverer , Configuration <?> configuration ) {
338
327
final ParameterNameProvider defaultProvider = configuration .getDefaultParameterNameProvider ();
339
328
configuration .parameterNameProvider (new ParameterNameProvider () {
@@ -352,6 +341,18 @@ public List<String> getParameterNames(Method method) {
352
341
});
353
342
}
354
343
344
+ private void closeMappingStreams (@ Nullable List <InputStream > mappingStreams ){
345
+ if (!CollectionUtils .isEmpty (mappingStreams )) {
346
+ for (InputStream stream : mappingStreams ) {
347
+ try {
348
+ stream .close ();
349
+ }
350
+ catch (IOException ignored ) {
351
+ }
352
+ }
353
+ }
354
+ }
355
+
355
356
/**
356
357
* Post-process the given Bean Validation configuration,
357
358
* adding to or overriding any of its settings.
@@ -420,15 +421,15 @@ public <T> T unwrap(@Nullable Class<T> type) {
420
421
return super .unwrap (type );
421
422
}
422
423
catch (ValidationException ex ) {
423
- // ignore - we'll try ValidatorFactory unwrapping next
424
+ // Ignore - we'll try ValidatorFactory unwrapping next
424
425
}
425
426
}
426
427
if (this .validatorFactory != null ) {
427
428
try {
428
429
return this .validatorFactory .unwrap (type );
429
430
}
430
431
catch (ValidationException ex ) {
431
- // ignore if just being asked for ValidatorFactory
432
+ // Ignore if just being asked for ValidatorFactory
432
433
if (ValidatorFactory .class == type ) {
433
434
return (T ) this .validatorFactory ;
434
435
}
0 commit comments