Skip to content

Commit a9cab2a

Browse files
committed
Polishing
1 parent d10d8e9 commit a9cab2a

File tree

6 files changed

+49
-33
lines changed

6 files changed

+49
-33
lines changed

Diff for: spring-core/src/main/java/org/springframework/util/StringUtils.java

+11-7
Original file line numberDiff line numberDiff line change
@@ -800,15 +800,19 @@ public static boolean pathEquals(String path1, String path2) {
800800
}
801801

802802
/**
803-
* Decode the given encoded URI component value by replacing "<i>{@code %xy}</i>" sequences
804-
* by an hexadecimal representation of the character in the specified charset, letting other
805-
* characters unchanged.
806-
* @param source the encoded {@code String}
807-
* @param charset the character encoding to use to decode the "<i>{@code %xy}</i>" sequences
803+
* Decode the given encoded URI component value by replacing each
804+
* "<i>{@code %xy}</i>" sequence with a hexadecimal representation of the
805+
* character in the specified character encoding, leaving other characters
806+
* unmodified.
807+
* @param source the encoded URI component value
808+
* @param charset the character encoding to use to decode the "<i>{@code %xy}</i>"
809+
* sequences
808810
* @return the decoded value
809-
* @throws IllegalArgumentException when the given source contains invalid encoded sequences
811+
* @throws IllegalArgumentException if the given source contains invalid encoded
812+
* sequences
810813
* @since 5.0
811-
* @see java.net.URLDecoder#decode(String, String) java.net.URLDecoder#decode for HTML form decoding
814+
* @see java.net.URLDecoder#decode(String, String) java.net.URLDecoder#decode
815+
* for HTML form decoding
812816
*/
813817
public static String uriDecode(String source, Charset charset) {
814818
int length = source.length();

Diff for: spring-web/src/main/java/org/springframework/web/client/ApiVersionInserter.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,19 @@
3030
public interface ApiVersionInserter {
3131

3232
/**
33-
* Allows inserting the version into the URI.
33+
* Insert the version into the URI.
34+
* <p>The default implementation returns the supplied URI unmodified.
3435
* @param version the version to insert
3536
* @param uri the URI for the request
36-
* @return the updated or the same URI
37+
* @return the updated URI, or the original URI unmodified
3738
*/
3839
default URI insertVersion(Object version, URI uri) {
3940
return uri;
4041
}
4142

4243
/**
43-
* Allows inserting the version into request headers.
44+
* Insert the version into the request headers.
45+
* <p>The default implementation does not modify the supplied headers.
4446
* @param version the version to insert
4547
* @param headers the request headers
4648
*/

Diff for: spring-web/src/main/java/org/springframework/web/service/registry/AnnotationHttpServiceRegistrar.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.springframework.core.type.AnnotationMetadata;
2121

2222
/**
23-
* Built-in implementation {@link AbstractHttpServiceRegistrar} that uses
23+
* Built-in implementation of {@link AbstractHttpServiceRegistrar} that uses
2424
* {@link ImportHttpServices} annotations on the importing configuration class
2525
* to determine the HTTP services and groups to register.
2626
*

Diff for: spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistryFactoryBean.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444

4545
/**
4646
* {@link FactoryBean} for {@link HttpServiceProxyRegistry} responsible for
47-
* initializing {@link HttpServiceGroup}s, and creating the HTTP Service client
47+
* initializing {@link HttpServiceGroup}s and creating the HTTP Service client
4848
* proxies for each group.
4949
*
5050
* <p>This class is imported as a bean definition through an
51-
* {@link AbstractHttpServiceRegistrar}, and given .
51+
* {@link AbstractHttpServiceRegistrar}.
5252
*
5353
* @author Rossen Stoyanchev
5454
* @author Phillip Webb

Diff for: spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServices.java

+8-7
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949
* @see Container
5050
* @see AbstractHttpServiceRegistrar
5151
*/
52-
@Retention(RetentionPolicy.RUNTIME)
5352
@Target(ElementType.TYPE)
53+
@Retention(RetentionPolicy.RUNTIME)
54+
@Documented
5455
@Repeatable(ImportHttpServices.Container.class)
5556
@Import(AnnotationHttpServiceRegistrar.class)
56-
@Documented
5757
public @interface ImportHttpServices {
5858

5959
/**
@@ -77,8 +77,9 @@
7777

7878
/**
7979
* Detect HTTP Services in the packages of the specified classes by looking
80-
* for interfaces with type or method level
81-
* {@link org.springframework.web.service.annotation.HttpExchange @HttpExchange}.
80+
* for interfaces with type-level or method-level
81+
* {@link org.springframework.web.service.annotation.HttpExchange @HttpExchange}
82+
* annotations.
8283
*/
8384
Class<?>[] basePackageClasses() default {};
8485

@@ -91,16 +92,16 @@
9192
/**
9293
* Specify the type of client to use for the group.
9394
* <p>By default, this is {@link HttpServiceGroup.ClientType#UNSPECIFIED}
94-
* in which case {@code RestClient} is used, but this default can be reset
95+
* in which case {@code RestClient} is used, but this default can be changed
9596
* via {@link AbstractHttpServiceRegistrar#setDefaultClientType}.
9697
*/
9798
HttpServiceGroup.ClientType clientType() default HttpServiceGroup.ClientType.UNSPECIFIED;
9899

99100

100101
/**
101102
* Container annotation that is necessary for the repeatable
102-
* {@link ImportHttpServices} annotation, but does not need to be declared
103-
* in application code.
103+
* {@link ImportHttpServices @ImportHttpServices} annotation, but does not
104+
* need to be declared in application code.
104105
*/
105106
@Target(ElementType.TYPE)
106107
@Retention(RetentionPolicy.RUNTIME)

Diff for: spring-web/src/main/java/org/springframework/web/util/UriUtils.java

+22-13
Original file line numberDiff line numberDiff line change
@@ -360,30 +360,39 @@ private static String encode(String scheme, Charset charset, HierarchicalUriComp
360360

361361

362362
/**
363-
* Decode the given encoded URI component.
364-
* <p>See {@link StringUtils#uriDecode(String, Charset)} for the decoding rules.
365-
* @param source the encoded String
366-
* @param encoding the character encoding to use
363+
* Decode the given encoded URI component value by replacing each
364+
* "<i>{@code %xy}</i>" sequence with a hexadecimal representation of the
365+
* character in the specified character encoding, leaving other characters
366+
* unmodified.
367+
* @param source the encoded URI component value
368+
* @param encoding the character encoding to use to decode the "<i>{@code %xy}</i>"
369+
* sequences
367370
* @return the decoded value
368-
* @throws IllegalArgumentException when the given source contains invalid encoded sequences
371+
* @throws IllegalArgumentException if the given source contains invalid encoded
372+
* sequences
369373
* @see StringUtils#uriDecode(String, Charset)
370-
* @see java.net.URLDecoder#decode(String, String)
374+
* @see java.net.URLDecoder#decode(String, String) java.net.URLDecoder#decode
375+
* for HTML form decoding
371376
*/
372377
public static String decode(String source, String encoding) {
373378
return StringUtils.uriDecode(source, Charset.forName(encoding));
374379
}
375380

376381
/**
377-
* Decode the given encoded URI component value by replacing "<i>{@code %xy}</i>" sequences
378-
* by an hexadecimal representation of the character in the specified charset, letting other
379-
* characters unchanged.
380-
* @param source the encoded {@code String}
381-
* @param charset the character encoding to use to decode the "<i>{@code %xy}</i>" sequences
382+
* Decode the given encoded URI component value by replacing each
383+
* "<i>{@code %xy}</i>" sequence with a hexadecimal representation of the
384+
* character in the specified character encoding, leaving other characters
385+
* unmodified.
386+
* @param source the encoded URI component value
387+
* @param charset the character encoding to use to decode the "<i>{@code %xy}</i>"
388+
* sequences
382389
* @return the decoded value
383-
* @throws IllegalArgumentException when the given source contains invalid encoded sequences
390+
* @throws IllegalArgumentException if the given source contains invalid encoded
391+
* sequences
384392
* @since 5.0
385393
* @see StringUtils#uriDecode(String, Charset)
386-
* @see java.net.URLDecoder#decode(String, String) java.net.URLDecoder#decode for HTML form decoding
394+
* @see java.net.URLDecoder#decode(String, String) java.net.URLDecoder#decode
395+
* for HTML form decoding
387396
*/
388397
public static String decode(String source, Charset charset) {
389398
return StringUtils.uriDecode(source, charset);

0 commit comments

Comments
 (0)