Skip to content

Commit 717b972

Browse files
committed
Polish contribution
See gh-33452
1 parent 019c0b1 commit 717b972

File tree

8 files changed

+35
-31
lines changed

8 files changed

+35
-31
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,8 +1241,8 @@ private Predicate<ResolvableType> valueOrCollection(ResolvableType valueType,
12411241
/**
12421242
* Return a {@link Predicate} for a parameter type that checks if its target
12431243
* value is a {@link Class} and the value type is a {@link String}. This is
1244-
* a regular use cases where a {@link Class} is defined in the bean
1245-
* definition as fully-qualified class name.
1244+
* a regular use case where a {@link Class} is defined in the bean definition
1245+
* as a fully-qualified class name.
12461246
* @param valueType the type of the value
12471247
* @return a predicate to indicate a fallback match for a String to Class
12481248
* parameter

spring-beans/src/main/resources/org/springframework/beans/factory/xml/spring-beans.dtd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@
137137
<!ATTLIST bean name CDATA #IMPLIED>
138138

139139
<!--
140-
Each bean definition must specify the fully qualified name of the class,
141-
except if it serves only as a parent definition for child bean definitions.
140+
Each bean definition must specify the fully-qualified name of the class,
141+
unless it serves only as a parent definition for child bean definitions.
142142
-->
143143
<!ATTLIST bean class CDATA #IMPLIED>
144144

@@ -452,7 +452,7 @@
452452
<!--
453453
Specification of the type of an overloaded method argument as a String.
454454
For convenience, this may be a substring of the fully-qualified class name.
455-
E.g. all the following would match "java.lang.String":
455+
For example, all the following would match "java.lang.String":
456456
- java.lang.String
457457
- String
458458
- Str

spring-beans/src/main/resources/org/springframework/beans/factory/xml/spring-beans.xsd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@
270270
<xsd:attribute name="class" type="xsd:string">
271271
<xsd:annotation>
272272
<xsd:documentation source="java:java.lang.Class"><![CDATA[
273-
The fully qualified name of the bean's class, except if it serves only
273+
The fully-qualified name of the bean's class, unless it serves only
274274
as a parent definition for child bean definitions.
275275
]]></xsd:documentation>
276276
</xsd:annotation>
@@ -766,7 +766,7 @@
766766
<xsd:documentation><![CDATA[
767767
Specification of the type of an overloaded method argument as a String.
768768
For convenience, this may be a substring of the fully-qualified class name.
769-
E.g. all the following would match "java.lang.String":
769+
For example, all the following would match "java.lang.String":
770770
- java.lang.String
771771
- String
772772
- Str
@@ -1091,7 +1091,7 @@
10911091
<xsd:attribute name="value-type" type="xsd:string">
10921092
<xsd:annotation>
10931093
<xsd:documentation source="java:java.lang.Class"><![CDATA[
1094-
The default Java type for nested values. Must be a fully qualified
1094+
The default Java type for nested values. Must be a fully-qualified
10951095
class name.
10961096
]]></xsd:documentation>
10971097
</xsd:annotation>
@@ -1120,7 +1120,7 @@
11201120
<xsd:attribute name="key-type" type="xsd:string">
11211121
<xsd:annotation>
11221122
<xsd:documentation source="java:java.lang.Class"><![CDATA[
1123-
The default Java type for nested entry keys. Must be a fully qualified
1123+
The default Java type for nested entry keys. Must be a fully-qualified
11241124
class name.
11251125
]]></xsd:documentation>
11261126
</xsd:annotation>

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -25,8 +25,9 @@
2525
*
2626
* <p>Implementations of this interface can be registered dynamically by using
2727
* {@link org.springframework.context.annotation.ImportRuntimeHints @ImportRuntimeHints}
28-
* or statically in {@code META-INF/spring/aot.factories} by using the fully-qualified class name of this
29-
* interface as the key. A standard no-arg constructor is required for implementations.
28+
* or statically in {@code META-INF/spring/aot.factories} by using the fully-qualified
29+
* class name of this interface as the key. A standard no-arg constructor is required
30+
* for implementations.
3031
*
3132
* @author Brian Clozel
3233
* @author Stephane Nicoll
@@ -38,7 +39,8 @@ public interface RuntimeHintsRegistrar {
3839
/**
3940
* Contribute hints to the given {@link RuntimeHints} instance.
4041
* @param hints the hints contributed so far for the deployment unit
41-
* @param classLoader the classloader, or {@code null} if even the system ClassLoader isn't accessible
42+
* @param classLoader the classloader, or {@code null} if even the system
43+
* ClassLoader is not accessible
4244
*/
4345
void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader);
4446

spring-tx/src/main/java/org/springframework/transaction/interceptor/MethodMapTransactionAttributeSource.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -134,7 +134,8 @@ public void addTransactionalMethod(String name, TransactionAttribute attr) {
134134
Assert.notNull(name, "Name must not be null");
135135
int lastDotIndex = name.lastIndexOf('.');
136136
if (lastDotIndex == -1) {
137-
throw new IllegalArgumentException("'" + name + "' is not a valid method name: format is <fully-qualified class name>.<method-name>");
137+
throw new IllegalArgumentException(
138+
"'" + name + "' is not a valid method name: format is <fully-qualified class name>.<method-name>");
138139
}
139140
String className = name.substring(0, lastDotIndex);
140141
String methodName = name.substring(lastDotIndex + 1);

spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourceEditor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 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,7 +39,8 @@
3939
*
4040
* <p>Note: Will register all overloaded methods for a given name.
4141
* Does not support explicit registration of certain overloaded methods.
42-
* Supports "xxx*" mappings, e.g. "notify*" for "notify" and "notifyAll".
42+
* Supports "xxx*" mappings &mdash; for example, "notify*" will match against
43+
* "notify" and "notifyAll".
4344
*
4445
* @author Rod Johnson
4546
* @author Juergen Hoeller

spring-tx/src/test/java/org/springframework/transaction/interceptor/RuleBasedTransactionAttributeTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -107,7 +107,7 @@ private void doTestRuleForSelectiveRollbackOnChecked(RuleBasedTransactionAttribu
107107
@Test
108108
void ruleForCommitOnSubclassOfChecked() {
109109
List<RollbackRuleAttribute> list = new ArrayList<>();
110-
// Note that it's important to ensure that we have this as
110+
// Note that it's important to ensure that we have this as a
111111
// fully-qualified class name: otherwise it will match everything!
112112
list.add(new RollbackRuleAttribute("java.lang.Exception"));
113113
list.add(new NoRollbackRuleAttribute("IOException"));

spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleMappingExceptionResolver.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -69,17 +69,17 @@ public class SimpleMappingExceptionResolver extends AbstractHandlerExceptionReso
6969

7070
/**
7171
* Set the mappings between exception class names and error view names.
72-
* The exception class name can be a substring, with no wildcard support at present.
73-
* A value of "ServletException" would match {@code jakarta.servlet.ServletException}
74-
* and subclasses, for example.
75-
* <p><b>NB:</b> Consider carefully how
76-
* specific the pattern is, and whether to include package information (which isn't mandatory).
77-
* For example, "Exception" will match nearly anything, and will probably hide other rules.
78-
* "java.lang.Exception" would be correct if "Exception" was meant to define a rule for all
79-
* checked exceptions. With more unusual exception names such as "BaseBusinessException"
80-
* there's no need to use fully-qualified class name.
81-
* @param mappings exception patterns (can also be fully qualified class names) as keys,
82-
* and error view names as values
72+
* <p>The exception class name can be a substring, with no wildcard support
73+
* at present. For example, a value of "ServletException" would match
74+
* {@code jakarta.servlet.ServletException} and subclasses.
75+
* <p><b>NB:</b> Consider carefully how specific the pattern is and whether
76+
* to include package information (which isn't mandatory). For example,
77+
* "Exception" will match nearly anything and will probably hide other rules.
78+
* "java.lang.Exception" would be correct if "Exception" was meant to define
79+
* a rule for all checked exceptions. With more unique exception names such
80+
* as "BaseBusinessException" there's no need to use a fully-qualified class name.
81+
* @param mappings exception patterns (can also be fully-qualified class names)
82+
* as keys, and error view names as values
8383
*/
8484
public void setExceptionMappings(Properties mappings) {
8585
this.exceptionMappings = mappings;

0 commit comments

Comments
 (0)