Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -60,8 +60,7 @@ public class LocalVariableTableParameterNameDiscoverer implements ParameterNameD
|
||||
private static final Map<Member, String[]> NO_DEBUG_INFO_MAP = Collections.emptyMap();
|
||||
|
||||
// the cache uses a nested index (value is a map) to keep the top level cache relatively small in size
|
||||
private final Map<Class<?>, Map<Member, String[]>> parameterNamesCache =
|
||||
new ConcurrentHashMap<>(32);
|
||||
private final Map<Class<?>, Map<Member, String[]>> parameterNamesCache = new ConcurrentHashMap<>(32);
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,12 +22,11 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ParameterNameDiscoverer implementation that tries several ParameterNameDiscoverers
|
||||
* in succession. Those added first in the {@code addDiscoverer} method have
|
||||
* highest priority. If one returns {@code null}, the next will be tried.
|
||||
* {@link ParameterNameDiscoverer} implementation that tries several discoverer
|
||||
* delegates in succession. Those added first in the {@code addDiscoverer} method
|
||||
* have highest priority. If one returns {@code null}, the next will be tried.
|
||||
*
|
||||
* <p>The default behavior is always to return {@code null}
|
||||
* if no discoverer matches.
|
||||
* <p>The default behavior is to return {@code null} if no discoverer matches.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Juergen Hoeller
|
||||
@@ -35,13 +34,12 @@ import java.util.List;
|
||||
*/
|
||||
public class PrioritizedParameterNameDiscoverer implements ParameterNameDiscoverer {
|
||||
|
||||
private final List<ParameterNameDiscoverer> parameterNameDiscoverers =
|
||||
new LinkedList<>();
|
||||
private final List<ParameterNameDiscoverer> parameterNameDiscoverers = new LinkedList<>();
|
||||
|
||||
|
||||
/**
|
||||
* Add a further ParameterNameDiscoverer to the list of discoverers
|
||||
* that this PrioritizedParameterNameDiscoverer checks.
|
||||
* Add a further {@link ParameterNameDiscoverer} delegate to the list of
|
||||
* discoverers that this {@code PrioritizedParameterNameDiscoverer} checks.
|
||||
*/
|
||||
public void addDiscoverer(ParameterNameDiscoverer pnd) {
|
||||
this.parameterNameDiscoverers.add(pnd);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,6 +26,7 @@ import java.lang.reflect.Parameter;
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 4.0
|
||||
* @see java.lang.reflect.Method#getParameters()
|
||||
* @see java.lang.reflect.Parameter#getName()
|
||||
*/
|
||||
public class StandardReflectionParameterNameDiscoverer implements ParameterNameDiscoverer {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,9 +35,9 @@ import org.springframework.util.comparator.ComparableComparator;
|
||||
*/
|
||||
public class ConvertingComparator<S, T> implements Comparator<S> {
|
||||
|
||||
private Comparator<T> comparator;
|
||||
private final Comparator<T> comparator;
|
||||
|
||||
private Converter<S, T> converter;
|
||||
private final Converter<S, T> converter;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,7 +27,7 @@ package org.springframework.util;
|
||||
@SuppressWarnings("serial")
|
||||
public class InvalidMimeTypeException extends IllegalArgumentException {
|
||||
|
||||
private String mimeType;
|
||||
private final String mimeType;
|
||||
|
||||
|
||||
/**
|
||||
@@ -38,7 +38,6 @@ public class InvalidMimeTypeException extends IllegalArgumentException {
|
||||
public InvalidMimeTypeException(String mimeType, String message) {
|
||||
super("Invalid mime type \"" + mimeType + "\": " + message);
|
||||
this.mimeType = mimeType;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -37,7 +37,7 @@ import org.springframework.util.Assert;
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.2.2
|
||||
*/
|
||||
@SuppressWarnings({ "serial", "rawtypes" })
|
||||
@SuppressWarnings({"serial", "rawtypes"})
|
||||
public class CompoundComparator<T> implements Comparator<T>, Serializable {
|
||||
|
||||
private final List<InvertibleComparator> comparators;
|
||||
@@ -64,7 +64,7 @@ public class CompoundComparator<T> implements Comparator<T>, Serializable {
|
||||
Assert.notNull(comparators, "Comparators must not be null");
|
||||
this.comparators = new ArrayList<>(comparators.length);
|
||||
for (Comparator comparator : comparators) {
|
||||
this.addComparator(comparator);
|
||||
addComparator(comparator);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user