Skip to content

Commit 54e2d63

Browse files
committed
Polishing
1 parent 69326db commit 54e2d63

File tree

8 files changed

+28
-34
lines changed

8 files changed

+28
-34
lines changed

spring-context-indexer/src/main/java/org/springframework/context/index/IndexedStereotypesProvider.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,16 @@ public Set<String> getStereotypes(Element element) {
5757
return stereotypes;
5858
}
5959

60-
private void collectStereotypesOnAnnotations(Set<Element> seen, Set<String> stereotypes,
61-
Element element) {
60+
private void collectStereotypesOnAnnotations(Set<Element> seen, Set<String> stereotypes, Element element) {
6261
for (AnnotationMirror annotation : this.typeHelper.getAllAnnotationMirrors(element)) {
6362
Element next = collectStereotypes(seen, stereotypes, element, annotation);
6463
if (next != null) {
6564
collectStereotypesOnAnnotations(seen, stereotypes, next);
6665
}
6766
}
68-
6967
}
7068

71-
private void collectStereotypesOnTypes(Set<Element> seen, Set<String> stereotypes,
72-
Element type) {
69+
private void collectStereotypesOnTypes(Set<Element> seen, Set<String> stereotypes, Element type) {
7370
if (!seen.contains(type)) {
7471
seen.add(type);
7572
if (isAnnotatedWithIndexed(type)) {
@@ -84,8 +81,8 @@ private void collectStereotypesOnTypes(Set<Element> seen, Set<String> stereotype
8481
}
8582
}
8683

87-
private Element collectStereotypes(Set<Element> seen, Set<String> stereotypes,
88-
Element element, AnnotationMirror annotation) {
84+
private Element collectStereotypes(Set<Element> seen, Set<String> stereotypes, Element element,
85+
AnnotationMirror annotation) {
8986

9087
if (isIndexedAnnotation(annotation)) {
9188
stereotypes.add(this.typeHelper.getType(element));

spring-core/src/main/java/org/springframework/core/LocalVariableTableParameterNameDiscoverer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2017 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.
@@ -60,8 +60,7 @@ public class LocalVariableTableParameterNameDiscoverer implements ParameterNameD
6060
private static final Map<Member, String[]> NO_DEBUG_INFO_MAP = Collections.emptyMap();
6161

6262
// the cache uses a nested index (value is a map) to keep the top level cache relatively small in size
63-
private final Map<Class<?>, Map<Member, String[]>> parameterNamesCache =
64-
new ConcurrentHashMap<>(32);
63+
private final Map<Class<?>, Map<Member, String[]>> parameterNamesCache = new ConcurrentHashMap<>(32);
6564

6665

6766
@Override

spring-core/src/main/java/org/springframework/core/PrioritizedParameterNameDiscoverer.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2017 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.
@@ -22,26 +22,24 @@
2222
import java.util.List;
2323

2424
/**
25-
* ParameterNameDiscoverer implementation that tries several ParameterNameDiscoverers
26-
* in succession. Those added first in the {@code addDiscoverer} method have
27-
* highest priority. If one returns {@code null}, the next will be tried.
25+
* {@link ParameterNameDiscoverer} implementation that tries several discoverer
26+
* delegates in succession. Those added first in the {@code addDiscoverer} method
27+
* have highest priority. If one returns {@code null}, the next will be tried.
2828
*
29-
* <p>The default behavior is always to return {@code null}
30-
* if no discoverer matches.
29+
* <p>The default behavior is to return {@code null} if no discoverer matches.
3130
*
3231
* @author Rod Johnson
3332
* @author Juergen Hoeller
3433
* @since 2.0
3534
*/
3635
public class PrioritizedParameterNameDiscoverer implements ParameterNameDiscoverer {
3736

38-
private final List<ParameterNameDiscoverer> parameterNameDiscoverers =
39-
new LinkedList<>();
37+
private final List<ParameterNameDiscoverer> parameterNameDiscoverers = new LinkedList<>();
4038

4139

4240
/**
43-
* Add a further ParameterNameDiscoverer to the list of discoverers
44-
* that this PrioritizedParameterNameDiscoverer checks.
41+
* Add a further {@link ParameterNameDiscoverer} delegate to the list of
42+
* discoverers that this {@code PrioritizedParameterNameDiscoverer} checks.
4543
*/
4644
public void addDiscoverer(ParameterNameDiscoverer pnd) {
4745
this.parameterNameDiscoverers.add(pnd);

spring-core/src/main/java/org/springframework/core/StandardReflectionParameterNameDiscoverer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2017 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.
@@ -26,6 +26,7 @@
2626
*
2727
* @author Juergen Hoeller
2828
* @since 4.0
29+
* @see java.lang.reflect.Method#getParameters()
2930
* @see java.lang.reflect.Parameter#getName()
3031
*/
3132
public class StandardReflectionParameterNameDiscoverer implements ParameterNameDiscoverer {

spring-core/src/main/java/org/springframework/core/convert/converter/ConvertingComparator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2017 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.
@@ -35,9 +35,9 @@
3535
*/
3636
public class ConvertingComparator<S, T> implements Comparator<S> {
3737

38-
private Comparator<T> comparator;
38+
private final Comparator<T> comparator;
3939

40-
private Converter<S, T> converter;
40+
private final Converter<S, T> converter;
4141

4242

4343
/**

spring-core/src/main/java/org/springframework/util/InvalidMimeTypeException.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2017 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.
@@ -27,7 +27,7 @@
2727
@SuppressWarnings("serial")
2828
public class InvalidMimeTypeException extends IllegalArgumentException {
2929

30-
private String mimeType;
30+
private final String mimeType;
3131

3232

3333
/**
@@ -38,7 +38,6 @@ public class InvalidMimeTypeException extends IllegalArgumentException {
3838
public InvalidMimeTypeException(String mimeType, String message) {
3939
super("Invalid mime type \"" + mimeType + "\": " + message);
4040
this.mimeType = mimeType;
41-
4241
}
4342

4443

spring-core/src/main/java/org/springframework/util/comparator/CompoundComparator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2017 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.
@@ -37,7 +37,7 @@
3737
* @author Juergen Hoeller
3838
* @since 1.2.2
3939
*/
40-
@SuppressWarnings({ "serial", "rawtypes" })
40+
@SuppressWarnings({"serial", "rawtypes"})
4141
public class CompoundComparator<T> implements Comparator<T>, Serializable {
4242

4343
private final List<InvertibleComparator> comparators;
@@ -64,7 +64,7 @@ public CompoundComparator(Comparator... comparators) {
6464
Assert.notNull(comparators, "Comparators must not be null");
6565
this.comparators = new ArrayList<>(comparators.length);
6666
for (Comparator comparator : comparators) {
67-
this.addComparator(comparator);
67+
addComparator(comparator);
6868
}
6969
}
7070

spring-web/src/main/java/org/springframework/http/MediaType.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,27 +254,27 @@ public class MediaType extends MimeType implements Serializable {
254254

255255
/**
256256
* Public constant media type for {@code application/problem+json}.
257-
* @since 5.0.0
257+
* @since 5.0
258258
* @see <a href="https://tools.ietf.org/html/rfc7807#section-6.1">Problem Details for HTTP APIs, 6.1. application/problem+json</a>
259259
*/
260260
public final static MediaType APPLICATION_PROBLEM_JSON;
261261

262262
/**
263263
* A String equivalent of {@link MediaType#APPLICATION_PROBLEM_JSON}.
264-
* @since 5.0.0
264+
* @since 5.0
265265
*/
266266
public final static String APPLICATION_PROBLEM_JSON_VALUE = "application/problem+json";
267267

268268
/**
269269
* Public constant media type for {@code application/problem+xml}.
270-
* @since 5.0.0
270+
* @since 5.0
271271
* @see <a href="https://tools.ietf.org/html/rfc7807#section-6.2">Problem Details for HTTP APIs, 6.2. application/problem+xml</a>
272272
*/
273273
public final static MediaType APPLICATION_PROBLEM_XML;
274274

275275
/**
276276
* A String equivalent of {@link MediaType#APPLICATION_PROBLEM_XML}.
277-
* @since 5.0.0
277+
* @since 5.0
278278
*/
279279
public final static String APPLICATION_PROBLEM_XML_VALUE = "application/problem+xml";
280280

0 commit comments

Comments
 (0)