Skip to content

Commit d1867f1

Browse files
committed
Merge branch '6.0.x'
2 parents 99378fe + e5f04e5 commit d1867f1

File tree

6 files changed

+21
-26
lines changed

6 files changed

+21
-26
lines changed

spring-core/src/main/java/org/springframework/aot/hint/support/FilePatternResourceHintsRegistrar.java

-3
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,10 @@ public static final class Builder {
156156

157157
private final List<String> fileExtensions = new ArrayList<>();
158158

159-
160159
private Builder() {
161160
// no-op
162161
}
163162

164-
165163
/**
166164
* Consider the specified classpath locations.
167165
* <p>A location can either be a special {@value ResourceUtils#CLASSPATH_URL_PREFIX}
@@ -254,7 +252,6 @@ private FilePatternResourceHintsRegistrar build() {
254252
public void registerHints(ResourceHints hints, @Nullable ClassLoader classLoader) {
255253
build().registerHints(hints, classLoader);
256254
}
257-
258255
}
259256

260257
}

spring-core/src/test/java/org/springframework/core/io/ClassPathResourceTests.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ void relativeResourcesAreEqual() throws Exception {
120120
Resource relative = resource.createRelative("subdir");
121121
assertThat(relative).isEqualTo(new ClassPathResource("dir/subdir"));
122122
}
123-
124123
}
125124

125+
126126
@Nested
127127
class GetInputStream {
128128

@@ -151,9 +151,9 @@ private static void assertExceptionContainsAbsolutePath(ClassPathResource resour
151151
.isThrownBy(resource::getInputStream)
152152
.withMessageContaining(ABSOLUTE_PATH_TO_NONEXISTENT_RESOURCE);
153153
}
154-
155154
}
156155

156+
157157
@Nested
158158
class GetDescription {
159159

@@ -190,9 +190,9 @@ void withClassLoaderConstructorAndLeadingSlash() {
190190
private static void assertDescription(ClassPathResource resource) {
191191
assertThat(resource.getDescription()).isEqualTo("class path resource [%s]", ABSOLUTE_PATH_TO_NONEXISTENT_RESOURCE);
192192
}
193-
194193
}
195194

195+
196196
@Nested
197197
class GetPath {
198198

@@ -209,9 +209,9 @@ void convertsToAbsolutePathForClassRelativeAccess() {
209209
assertThat(((ClassPathResource) new ClassPathResource("", getClass()).createRelative("/test.html")).getPath()).isEqualTo("test.html");
210210
assertThat(((ClassPathResource) new ClassPathResource("", getClass()).createRelative("test.html")).getPath()).isEqualTo(PACKAGE_PATH + "/test.html");
211211
}
212-
213212
}
214213

214+
215215
@Test
216216
void directoryNotReadable() throws Exception {
217217
Resource fileDir = new ClassPathResource("example/type");

spring-core/src/test/java/org/springframework/core/io/ResourceTests.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ void hasDescription() {
174174
Resource resource = new ByteArrayResource("testString".getBytes(), "my description");
175175
assertThat(resource.getDescription().contains("my description")).isTrue();
176176
}
177-
178177
}
179178

179+
180180
@Nested
181181
class InputStreamResourceTests {
182182

@@ -216,6 +216,7 @@ void hasDescription() {
216216
}
217217
}
218218

219+
219220
@Nested
220221
class FileSystemResourceTests {
221222

@@ -287,6 +288,7 @@ private void assertUrlAndUriBehavior(Resource resource) throws IOException {
287288
}
288289
}
289290

291+
290292
@Nested
291293
class UrlResourceTests {
292294

@@ -435,6 +437,7 @@ public MockResponse dispatch(RecordedRequest request) throws InterruptedExceptio
435437
}
436438
}
437439

440+
438441
@Nested
439442
class AbstractResourceTests {
440443

@@ -479,7 +482,6 @@ public String getDescription() {
479482
};
480483
assertThat(resource.contentLength()).isEqualTo(3L);
481484
}
482-
483485
}
484486

485487
}

spring-core/src/test/java/org/springframework/core/io/buffer/PooledDataBufferTests.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,6 +39,7 @@ public DataBufferFactory createDataBufferFactory() {
3939
}
4040
}
4141

42+
4243
@Nested
4344
class UnpooledByteBufAllocatorWithPreferDirectFalseTests implements PooledDataBufferTestingTrait {
4445

@@ -48,6 +49,7 @@ public DataBufferFactory createDataBufferFactory() {
4849
}
4950
}
5051

52+
5153
@Nested
5254
class PooledByteBufAllocatorWithPreferDirectTrueTests implements PooledDataBufferTestingTrait {
5355

@@ -57,6 +59,7 @@ public DataBufferFactory createDataBufferFactory() {
5759
}
5860
}
5961

62+
6063
@Nested
6164
class PooledByteBufAllocatorWithPreferDirectFalseTests implements PooledDataBufferTestingTrait {
6265

@@ -66,6 +69,7 @@ public DataBufferFactory createDataBufferFactory() {
6669
}
6770
}
6871

72+
6973
interface PooledDataBufferTestingTrait {
7074

7175
DataBufferFactory createDataBufferFactory();
@@ -92,7 +96,6 @@ default void tooManyReleases() {
9296
buffer.release();
9397
assertThatIllegalStateException().isThrownBy(buffer::release);
9498
}
95-
9699
}
97100

98101
}

spring-core/src/test/java/org/springframework/core/io/support/PropertySourceProcessorTests.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ class PropertySourceProcessorTests {
4848
private static final String PROPS_FILE = ClassUtils.classPackageAsResourcePath(PropertySourceProcessorTests.class) + "/test.properties";
4949

5050
private final StandardEnvironment environment = new StandardEnvironment();
51+
5152
private final ResourceLoader resourceLoader = new DefaultResourceLoader();
53+
5254
private final PropertySourceProcessor processor = new PropertySourceProcessor(environment, resourceLoader);
5355

5456

@@ -59,12 +61,14 @@ void checkInitialPropertySources() {
5961

6062
@Test
6163
void processorRegistersPropertySource() throws Exception {
62-
PropertySourceDescriptor descriptor = new PropertySourceDescriptor(List.of(PROPS_FILE), false, null, DefaultPropertySourceFactory.class, null);
64+
PropertySourceDescriptor descriptor = new PropertySourceDescriptor(
65+
List.of(PROPS_FILE), false, null, DefaultPropertySourceFactory.class, null);
6366
processor.processPropertySource(descriptor);
6467
assertThat(environment.getPropertySources()).hasSize(3);
6568
assertThat(environment.getProperty("enigma")).isEqualTo("42");
6669
}
6770

71+
6872
@Nested
6973
class FailOnErrorTests {
7074

@@ -86,9 +90,9 @@ private void assertProcessorFailsOnError(
8690
assertThatExceptionOfType(exceptionType).isThrownBy(() -> processor.processPropertySource(descriptor));
8791
assertThat(environment.getPropertySources()).hasSize(2);
8892
}
89-
9093
}
9194

95+
9296
@Nested
9397
class IgnoreResourceNotFoundTests {
9498

@@ -127,7 +131,6 @@ private void assertProcessorIgnoresFailure(Class<? extends PropertySourceFactory
127131
assertThatNoException().isThrownBy(() -> processor.processPropertySource(descriptor));
128132
assertThat(environment.getPropertySources()).hasSize(2);
129133
}
130-
131134
}
132135

133136

spring-core/src/test/java/org/springframework/core/io/support/SpringFactoriesLoaderTests.java

+2-12
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ void handleMessageReturnsHandlerThatAcceptsMessage() {
223223
assertThat(messages).hasSize(1);
224224
assertThat(messages.get(0)).startsWith("Unable to instantiate factory class");
225225
}
226-
227226
}
228227

229228

@@ -292,9 +291,9 @@ void andResolverReturnsComposite() {
292291
assertThat(resolver.resolve(Integer.class)).isEqualTo(123);
293292
assertThat(resolver.resolve(Long.class)).isEqualTo(234L);
294293
}
295-
296294
}
297295

296+
298297
@Nested
299298
class FactoryInstantiatorTests {
300299

@@ -350,14 +349,12 @@ void multiplePackagePrivateConstructorsThrowsException() {
350349
}
351350

352351
static class DefaultConstructor {
353-
354352
}
355353

356354
static class SingleConstructor {
357355

358356
SingleConstructor(String arg) {
359357
}
360-
361358
}
362359

363360
static class MultiplePrivateAndSinglePublicConstructor {
@@ -368,7 +365,6 @@ public MultiplePrivateAndSinglePublicConstructor(String arg) {
368365

369366
private MultiplePrivateAndSinglePublicConstructor(String arg, boolean extra) {
370367
}
371-
372368
}
373369

374370
static class MultiplePackagePrivateAndSinglePublicConstructor {
@@ -379,22 +375,18 @@ public MultiplePackagePrivateAndSinglePublicConstructor(String arg) {
379375

380376
MultiplePackagePrivateAndSinglePublicConstructor(String arg, boolean extra) {
381377
}
382-
383378
}
384379

385-
386380
static class SinglePackagePrivateConstructor {
387381

388382
SinglePackagePrivateConstructor(String arg) {
389383
}
390-
391384
}
392385

393386
static class SinglePrivateConstructor {
394387

395388
private SinglePrivateConstructor(String arg) {
396389
}
397-
398390
}
399391

400392
static class MultiplePackagePrivateConstructors {
@@ -405,11 +397,10 @@ static class MultiplePackagePrivateConstructors {
405397

406398
MultiplePackagePrivateConstructors(String arg, boolean extra) {
407399
}
408-
409400
}
410-
411401
}
412402

403+
413404
private static class LimitedClassLoader extends URLClassLoader {
414405

415406
private static final ClassLoader constructorArgumentFactories = new LimitedClassLoader("constructor-argument-factories");
@@ -428,7 +419,6 @@ private static URL toUrl(String location) {
428419
throw new IllegalStateException(ex);
429420
}
430421
}
431-
432422
}
433423

434424
}

0 commit comments

Comments
 (0)