mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Polishing
This commit is contained in:
+1
-4
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
+1
@@ -111,4 +111,5 @@ public class GsonHttpMessageConverter extends AbstractJsonHttpMessageConverter {
|
||||
protected boolean supportsRepeatableWrites(Object o) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user