From b0f7184f3f26fe0db19df3d4e040565ff1f7ca57 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 15 May 2014 15:19:17 +0200 Subject: [PATCH] Polishing --- .../interceptor/AsyncExecutionAspectSupport.java | 5 ++--- .../interceptor/AsyncExecutionInterceptor.java | 12 ++++++------ .../MemorySafeUndeclaredThrowableStrategy.java | 16 ++++++++-------- .../expression/spel/SpelMessage.java | 4 ++-- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java index 7cf91ab7e62..eff63690b0d 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java @@ -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"); * 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.Executor; -import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; 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. */ - public void setBeanFactory(BeanFactory beanFactory) throws BeansException { + public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; } diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionInterceptor.java index b5219691046..52ba3bb7eb5 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionInterceptor.java @@ -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"); * 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}. - * @param executor the {@link Executor} (typically a Spring {@link AsyncTaskExecutor} - * or {@link java.util.concurrent.ExecutorService}) to delegate to. + * @param defaultExecutor the {@link Executor} (typically a Spring {@link AsyncTaskExecutor} + * or {@link java.util.concurrent.ExecutorService}) to delegate to */ - public AsyncExecutionInterceptor(Executor executor) { - super(executor); + public AsyncExecutionInterceptor(Executor defaultExecutor) { + super(defaultExecutor); } @@ -117,8 +117,8 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport * Subclasses may override to provide support for extracting qualifier information, * e.g. via an annotation on the given method. * @return always {@code null} - * @see #determineAsyncExecutor(Method) * @since 3.1.2 + * @see #determineAsyncExecutor(Method) */ @Override protected String getExecutorQualifier(Method method) { diff --git a/spring-core/src/main/java/org/springframework/cglib/transform/impl/MemorySafeUndeclaredThrowableStrategy.java b/spring-core/src/main/java/org/springframework/cglib/transform/impl/MemorySafeUndeclaredThrowableStrategy.java index 7a98ece88a6..28f92352d5d 100644 --- a/spring-core/src/main/java/org/springframework/cglib/transform/impl/MemorySafeUndeclaredThrowableStrategy.java +++ b/spring-core/src/main/java/org/springframework/cglib/transform/impl/MemorySafeUndeclaredThrowableStrategy.java @@ -25,8 +25,8 @@ import org.springframework.cglib.transform.MethodFilterTransformer; import org.springframework.cglib.transform.TransformingClassGenerator; /** - * Memory-safe variant of {@link UndeclaredThrowableStrategy} ported from the latest - * as yet unreleased CGLIB code. + * Memory-safe variant of {@link UndeclaredThrowableStrategy} ported from CGLIB 3.1, + * introduced for using it in Spring before it was officially released in CGLIB. * * @author Phillip Webb * @since 3.2.4 @@ -35,23 +35,23 @@ public class MemorySafeUndeclaredThrowableStrategy extends DefaultGeneratorStrat private static final MethodFilter TRANSFORM_FILTER = new MethodFilter() { 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; } protected ClassGenerator transform(ClassGenerator cg) throws Exception { - ClassTransformer tr = new UndeclaredThrowableTransformer(wrapper); - tr = new MethodFilterTransformer(TRANSFORM_FILTER, tr); - return new TransformingClassGenerator(cg, tr); + ClassTransformer ct = new UndeclaredThrowableTransformer(this.wrapper); + ct = new MethodFilterTransformer(TRANSFORM_FILTER, ct); + return new TransformingClassGenerator(cg, ct); } } diff --git a/spring-expression/src/main/java/org/springframework/expression/spel/SpelMessage.java b/spring-expression/src/main/java/org/springframework/expression/spel/SpelMessage.java index e96c56c06fe..9a42cedbe3d 100644 --- a/spring-expression/src/main/java/org/springframework/expression/spel/SpelMessage.java +++ b/spring-expression/src/main/java/org/springframework/expression/spel/SpelMessage.java @@ -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}"), 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"), - 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"), 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"), 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"), - 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"), 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"),