Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2013 the original author or authors.
|
* Copyright 2002-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -21,7 +21,6 @@ import java.util.Map;
|
|||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
import org.springframework.beans.BeansException;
|
|
||||||
import org.springframework.beans.factory.BeanFactory;
|
import org.springframework.beans.factory.BeanFactory;
|
||||||
import org.springframework.beans.factory.BeanFactoryAware;
|
import org.springframework.beans.factory.BeanFactoryAware;
|
||||||
import org.springframework.beans.factory.annotation.BeanFactoryAnnotationUtils;
|
import org.springframework.beans.factory.annotation.BeanFactoryAnnotationUtils;
|
||||||
@@ -80,7 +79,7 @@ public abstract class AsyncExecutionAspectSupport implements BeanFactoryAware {
|
|||||||
/**
|
/**
|
||||||
* Set the {@link BeanFactory} to be used when looking up executors by qualifier.
|
* Set the {@link BeanFactory} to be used when looking up executors by qualifier.
|
||||||
*/
|
*/
|
||||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
public void setBeanFactory(BeanFactory beanFactory) {
|
||||||
this.beanFactory = beanFactory;
|
this.beanFactory = beanFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2013 the original author or authors.
|
* Copyright 2002-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -62,11 +62,11 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new {@code AsyncExecutionInterceptor}.
|
* Create a new {@code AsyncExecutionInterceptor}.
|
||||||
* @param executor the {@link Executor} (typically a Spring {@link AsyncTaskExecutor}
|
* @param defaultExecutor the {@link Executor} (typically a Spring {@link AsyncTaskExecutor}
|
||||||
* or {@link java.util.concurrent.ExecutorService}) to delegate to.
|
* or {@link java.util.concurrent.ExecutorService}) to delegate to
|
||||||
*/
|
*/
|
||||||
public AsyncExecutionInterceptor(Executor executor) {
|
public AsyncExecutionInterceptor(Executor defaultExecutor) {
|
||||||
super(executor);
|
super(defaultExecutor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -117,8 +117,8 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport
|
|||||||
* Subclasses may override to provide support for extracting qualifier information,
|
* Subclasses may override to provide support for extracting qualifier information,
|
||||||
* e.g. via an annotation on the given method.
|
* e.g. via an annotation on the given method.
|
||||||
* @return always {@code null}
|
* @return always {@code null}
|
||||||
* @see #determineAsyncExecutor(Method)
|
|
||||||
* @since 3.1.2
|
* @since 3.1.2
|
||||||
|
* @see #determineAsyncExecutor(Method)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected String getExecutorQualifier(Method method) {
|
protected String getExecutorQualifier(Method method) {
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ import org.springframework.cglib.transform.MethodFilterTransformer;
|
|||||||
import org.springframework.cglib.transform.TransformingClassGenerator;
|
import org.springframework.cglib.transform.TransformingClassGenerator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Memory-safe variant of {@link UndeclaredThrowableStrategy} ported from the latest
|
* Memory-safe variant of {@link UndeclaredThrowableStrategy} ported from CGLIB 3.1,
|
||||||
* as yet unreleased CGLIB code.
|
* introduced for using it in Spring before it was officially released in CGLIB.
|
||||||
*
|
*
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
* @since 3.2.4
|
* @since 3.2.4
|
||||||
@@ -35,23 +35,23 @@ public class MemorySafeUndeclaredThrowableStrategy extends DefaultGeneratorStrat
|
|||||||
|
|
||||||
private static final MethodFilter TRANSFORM_FILTER = new MethodFilter() {
|
private static final MethodFilter TRANSFORM_FILTER = new MethodFilter() {
|
||||||
public boolean accept(int access, String name, String desc, String signature, String[] exceptions) {
|
public boolean accept(int access, String name, String desc, String signature, String[] exceptions) {
|
||||||
return !TypeUtils.isPrivate(access) && name.indexOf('$') < 0;
|
return (!TypeUtils.isPrivate(access) && name.indexOf('$') < 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
private Class<?> wrapper;
|
private final Class<?> wrapper;
|
||||||
|
|
||||||
|
|
||||||
public MemorySafeUndeclaredThrowableStrategy(Class wrapper) {
|
public MemorySafeUndeclaredThrowableStrategy(Class<?> wrapper) {
|
||||||
this.wrapper = wrapper;
|
this.wrapper = wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected ClassGenerator transform(ClassGenerator cg) throws Exception {
|
protected ClassGenerator transform(ClassGenerator cg) throws Exception {
|
||||||
ClassTransformer tr = new UndeclaredThrowableTransformer(wrapper);
|
ClassTransformer ct = new UndeclaredThrowableTransformer(this.wrapper);
|
||||||
tr = new MethodFilterTransformer(TRANSFORM_FILTER, tr);
|
ct = new MethodFilterTransformer(TRANSFORM_FILTER, ct);
|
||||||
return new TransformingClassGenerator(cg, tr);
|
return new TransformingClassGenerator(cg, ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,13 +74,13 @@ public enum SpelMessage {
|
|||||||
EXCEPTION_DURING_PROPERTY_WRITE(Kind.ERROR, 1034, "A problem occurred whilst attempting to set the property ''{0}'': {1}"),
|
EXCEPTION_DURING_PROPERTY_WRITE(Kind.ERROR, 1034, "A problem occurred whilst attempting to set the property ''{0}'': {1}"),
|
||||||
NOT_AN_INTEGER(Kind.ERROR, 1035, "The value ''{0}'' cannot be parsed as an int"),
|
NOT_AN_INTEGER(Kind.ERROR, 1035, "The value ''{0}'' cannot be parsed as an int"),
|
||||||
NOT_A_LONG(Kind.ERROR, 1036, "The value ''{0}'' cannot be parsed as a long"),
|
NOT_A_LONG(Kind.ERROR, 1036, "The value ''{0}'' cannot be parsed as a long"),
|
||||||
INVALID_FIRST_OPERAND_FOR_MATCHES_OPERATOR(Kind.ERROR, 1037, "First operand to matches operator must be a string. ''{0}'' is not"),
|
INVALID_FIRST_OPERAND_FOR_MATCHES_OPERATOR(Kind.ERROR, 1037, "First operand to matches operator must be a string. ''{0}'' is not"),
|
||||||
INVALID_SECOND_OPERAND_FOR_MATCHES_OPERATOR(Kind.ERROR, 1038, "Second operand to matches operator must be a string. ''{0}'' is not"),
|
INVALID_SECOND_OPERAND_FOR_MATCHES_OPERATOR(Kind.ERROR, 1038, "Second operand to matches operator must be a string. ''{0}'' is not"),
|
||||||
FUNCTION_MUST_BE_STATIC(Kind.ERROR, 1039, "Only static methods can be called via function references. The method ''{0}'' referred to by name ''{1}'' is not static."),
|
FUNCTION_MUST_BE_STATIC(Kind.ERROR, 1039, "Only static methods can be called via function references. The method ''{0}'' referred to by name ''{1}'' is not static."),
|
||||||
NOT_A_REAL(Kind.ERROR, 1040, "The value ''{0}'' cannot be parsed as a double"),
|
NOT_A_REAL(Kind.ERROR, 1040, "The value ''{0}'' cannot be parsed as a double"),
|
||||||
MORE_INPUT(Kind.ERROR,1041, "After parsing a valid expression, there is still more data in the expression: ''{0}''"),
|
MORE_INPUT(Kind.ERROR,1041, "After parsing a valid expression, there is still more data in the expression: ''{0}''"),
|
||||||
RIGHT_OPERAND_PROBLEM(Kind.ERROR,1042, "Problem parsing right operand"),
|
RIGHT_OPERAND_PROBLEM(Kind.ERROR,1042, "Problem parsing right operand"),
|
||||||
NOT_EXPECTED_TOKEN(Kind.ERROR,1043,"Unexpected token. Expected ''{0}'' but was ''{1}''"),
|
NOT_EXPECTED_TOKEN(Kind.ERROR,1043,"Unexpected token. Expected ''{0}'' but was ''{1}''"),
|
||||||
OOD(Kind.ERROR,1044,"Unexpectedly ran out of input"),
|
OOD(Kind.ERROR,1044,"Unexpectedly ran out of input"),
|
||||||
NON_TERMINATING_DOUBLE_QUOTED_STRING(Kind.ERROR,1045,"Cannot find terminating \" for string"),
|
NON_TERMINATING_DOUBLE_QUOTED_STRING(Kind.ERROR,1045,"Cannot find terminating \" for string"),
|
||||||
NON_TERMINATING_QUOTED_STRING(Kind.ERROR,1046,"Cannot find terminating ' for string"),
|
NON_TERMINATING_QUOTED_STRING(Kind.ERROR,1046,"Cannot find terminating ' for string"),
|
||||||
|
|||||||
Reference in New Issue
Block a user