Polishing
This commit is contained in:
@@ -145,7 +145,7 @@ public class ConcurrentMapCache extends AbstractValueAdaptingCache {
|
||||
try {
|
||||
return toStoreValue(valueLoader.call());
|
||||
}
|
||||
catch (Exception ex) {
|
||||
catch (Throwable ex) {
|
||||
throw new ValueRetrievalException(key, valueLoader, ex);
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -335,7 +335,7 @@ public class ClassPathScanningCandidateComponentProvider implements EnvironmentC
|
||||
Set<BeanDefinition> candidates = new LinkedHashSet<>();
|
||||
try {
|
||||
String packageSearchPath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX +
|
||||
resolveBasePackage(basePackage) + "/" + this.resourcePattern;
|
||||
resolveBasePackage(basePackage) + '/' + this.resourcePattern;
|
||||
Resource[] resources = this.resourcePatternResolver.getResources(packageSearchPath);
|
||||
boolean traceEnabled = logger.isTraceEnabled();
|
||||
boolean debugEnabled = logger.isDebugEnabled();
|
||||
|
||||
@@ -142,7 +142,7 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
|
||||
group.add(entry.getKey(), bean);
|
||||
}
|
||||
}
|
||||
if (phases.size() > 0) {
|
||||
if (!phases.isEmpty()) {
|
||||
List<Integer> keys = new ArrayList<>(phases.keySet());
|
||||
Collections.sort(keys);
|
||||
for (Integer key : keys) {
|
||||
@@ -195,7 +195,7 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
|
||||
}
|
||||
group.add(entry.getKey(), bean);
|
||||
}
|
||||
if (phases.size() > 0) {
|
||||
if (!phases.isEmpty()) {
|
||||
List<Integer> keys = new ArrayList<>(phases.keySet());
|
||||
Collections.sort(keys, Collections.reverseOrder());
|
||||
for (Integer key : keys) {
|
||||
|
||||
@@ -43,12 +43,12 @@ public class StaticMessageSource extends AbstractMessageSource {
|
||||
|
||||
@Override
|
||||
protected String resolveCodeWithoutArguments(String code, Locale locale) {
|
||||
return this.messages.get(code + "_" + locale.toString());
|
||||
return this.messages.get(code + '_' + locale.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MessageFormat resolveCode(String code, Locale locale) {
|
||||
String key = code + "_" + locale.toString();
|
||||
String key = code + '_' + locale.toString();
|
||||
String msg = this.messages.get(key);
|
||||
if (msg == null) {
|
||||
return null;
|
||||
@@ -73,7 +73,7 @@ public class StaticMessageSource extends AbstractMessageSource {
|
||||
Assert.notNull(code, "Code must not be null");
|
||||
Assert.notNull(locale, "Locale must not be null");
|
||||
Assert.notNull(msg, "Message must not be null");
|
||||
this.messages.put(code + "_" + locale.toString(), msg);
|
||||
this.messages.put(code + '_' + locale.toString(), msg);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Added message [" + msg + "] for code [" + code + "] and Locale [" + locale + "]");
|
||||
}
|
||||
|
||||
@@ -32,7 +32,9 @@ import org.springframework.core.Ordered;
|
||||
* Enables Spring's asynchronous method execution capability, similar to functionality
|
||||
* found in Spring's {@code <task:*>} XML namespace.
|
||||
*
|
||||
* <p>To be used together with @{@link Configuration Configuration} classes as follows:
|
||||
* <p>To be used together with @{@link Configuration Configuration} classes as follows,
|
||||
* enabling annotation-driven async processing for an entire Spring application context:
|
||||
*
|
||||
* <pre class="code">
|
||||
* @Configuration
|
||||
* @EnableAsync
|
||||
@@ -45,6 +47,7 @@ import org.springframework.core.Ordered;
|
||||
* annotation, or any custom annotation specified via the {@link #annotation} attribute.
|
||||
* The aspect is added transparently for any registered bean, for instance via this
|
||||
* configuration:
|
||||
*
|
||||
* <pre class="code">
|
||||
* @Configuration
|
||||
* public class AnotherAppConfig {
|
||||
|
||||
Reference in New Issue
Block a user