Polishing

This commit is contained in:
Juergen Hoeller
2026-04-01 21:25:11 +02:00
parent 9af3961b9b
commit 9ceb9efb2c
3 changed files with 4 additions and 6 deletions
@@ -106,7 +106,6 @@ public class AnnotationBeanNameGenerator implements BeanNameGenerator {
private final Map<String, Set<String>> metaAnnotationTypesCache = new ConcurrentHashMap<>();
@Override
public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
if (definition instanceof AnnotatedBeanDefinition annotatedBeanDefinition) {
@@ -214,8 +213,7 @@ public class AnnotationBeanNameGenerator implements BeanNameGenerator {
return names.get(0);
}
if (names.size() > 1) {
throw new IllegalStateException(
"Stereotype annotations suggest inconsistent component names: " + names);
throw new IllegalStateException("Stereotype annotations suggest inconsistent component names: " + names);
}
return null;
}
@@ -236,7 +234,6 @@ public class AnnotationBeanNameGenerator implements BeanNameGenerator {
annotationType.equals("javax.annotation.ManagedBean") ||
annotationType.equals("jakarta.inject.Named") ||
annotationType.equals("javax.inject.Named");
return (isStereotype && attributes.containsKey(MergedAnnotation.VALUE));
}
@@ -134,7 +134,7 @@ public abstract class AbstractJsonHttpMessageConverter extends AbstractGenericHt
/**
* Template method that reads the JSON-bound object from the given {@link Reader}.
* @param resolvedType the resolved generic type
* @param reader the {@code} Reader to use
* @param reader the {@code Reader} to use
* @return the JSON-bound object
* @throws Exception in case of read/parse failures
*/
@@ -144,7 +144,7 @@ public abstract class AbstractJsonHttpMessageConverter extends AbstractGenericHt
* Template method that writes the JSON-bound object to the given {@link Writer}.
* @param object the object to write to the output message
* @param type the type of object to write (may be {@code null})
* @param writer the {@code} Writer to use
* @param writer the {@code Writer} to use
* @throws Exception in case of write failures
*/
protected abstract void writeInternal(Object object, @Nullable Type type, Writer writer) throws Exception;
@@ -111,4 +111,5 @@ public class GsonHttpMessageConverter extends AbstractJsonHttpMessageConverter {
protected boolean supportsRepeatableWrites(Object o) {
return true;
}
}