From 240a75f313d2b122834f4e6432bc19d5bf6817d6 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 12 Dec 2023 12:40:04 +0100 Subject: [PATCH] Polishing --- .../context/annotation/ImportRuntimeHints.java | 3 +-- .../support/GenericApplicationContextTests.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ImportRuntimeHints.java b/spring-context/src/main/java/org/springframework/context/annotation/ImportRuntimeHints.java index bc3d4992c54..18487283772 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ImportRuntimeHints.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ImportRuntimeHints.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,6 @@ import org.springframework.aot.hint.RuntimeHintsRegistrar; * public MyService myService() { * return new MyService(); * } - * * } * *

If the configuration class above is processed, {@code MyHints} will be diff --git a/spring-context/src/test/java/org/springframework/context/support/GenericApplicationContextTests.java b/spring-context/src/test/java/org/springframework/context/support/GenericApplicationContextTests.java index 8677e647692..34dd2402faf 100644 --- a/spring-context/src/test/java/org/springframework/context/support/GenericApplicationContextTests.java +++ b/spring-context/src/test/java/org/springframework/context/support/GenericApplicationContextTests.java @@ -132,16 +132,16 @@ class GenericApplicationContextTests { assertThat(context.getBean(String.class)).isSameAs(context.getBean("testBean")); assertThat(context.getAutowireCapableBeanFactory().getBean(String.class)) - .isSameAs(context.getAutowireCapableBeanFactory().getBean("testBean")); + .isSameAs(context.getAutowireCapableBeanFactory().getBean("testBean")); context.close(); assertThatIllegalStateException() - .isThrownBy(() -> context.getBean(String.class)); + .isThrownBy(() -> context.getBean(String.class)); assertThatIllegalStateException() - .isThrownBy(() -> context.getAutowireCapableBeanFactory().getBean(String.class)); + .isThrownBy(() -> context.getAutowireCapableBeanFactory().getBean(String.class)); assertThatIllegalStateException() - .isThrownBy(() -> context.getAutowireCapableBeanFactory().getBean("testBean")); + .isThrownBy(() -> context.getAutowireCapableBeanFactory().getBean("testBean")); } @Test @@ -287,8 +287,8 @@ class GenericApplicationContextTests { // java.nio.file.InvalidPathException: Illegal char <:> at index 4: ping:foo if (resourceLoader instanceof FileSystemResourceLoader && OS.WINDOWS.isCurrentOs()) { assertThatExceptionOfType(InvalidPathException.class) - .isThrownBy(() -> context.getResource(pingLocation)) - .withMessageContaining(pingLocation); + .isThrownBy(() -> context.getResource(pingLocation)) + .withMessageContaining(pingLocation); } else { resource = context.getResource(pingLocation); @@ -303,8 +303,8 @@ class GenericApplicationContextTests { assertThat(resource).isInstanceOf(FileUrlResource.class); resource = context.getResource(pingLocation); assertThat(resource).asInstanceOf(type(ByteArrayResource.class)) - .extracting(bar -> new String(bar.getByteArray(), UTF_8)) - .isEqualTo("pong:foo"); + .extracting(bar -> new String(bar.getByteArray(), UTF_8)) + .isEqualTo("pong:foo"); } @Test