diff --git a/org.springframework.aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java b/org.springframework.aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java index c3e5005463f621325921a2d4d1dacd20b6cd73e2..fbc82096818c382e40c9b7bb468684c3c1b08d4e 100644 --- a/org.springframework.aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java +++ b/org.springframework.aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2009 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. @@ -69,17 +69,12 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac * Find and return the first AspectJ annotation on the given method * (there should only be one anyway...) */ - protected static AspectJAnnotation findAspectJAnnotationOnMethod(Method aMethod) { - Class[] classesToLookFor = (Class[]) new Class[] { - Before.class, - Around.class, - After.class, - AfterReturning.class, - AfterThrowing.class, - Pointcut.class - }; + @SuppressWarnings("unchecked") + protected static AspectJAnnotation findAspectJAnnotationOnMethod(Method method) { + Class[] classesToLookFor = new Class[] { + Before.class, Around.class, After.class, AfterReturning.class, AfterThrowing.class, Pointcut.class}; for (Class c : classesToLookFor) { - AspectJAnnotation foundAnnotation = findAnnotation(aMethod, c); + AspectJAnnotation foundAnnotation = findAnnotation(method, c); if (foundAnnotation != null) { return foundAnnotation; } @@ -199,7 +194,7 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac // come first in the advice declaration. int typeOffset = paramTypes.length - argNames.length; for (int i = 0; i < ret.length; i++) { - ret[i] = paramTypes[i+typeOffset]; + ret[i] = paramTypes[i + typeOffset]; } return ret; } @@ -212,7 +207,7 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac AtAfterReturning, AtAfterThrowing, AtAround - }; + } /** @@ -265,8 +260,7 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac private String resolveExpression() throws Exception { String expression = null; - for (int i = 0; i < EXPRESSION_PROPERTIES.length; i++) { - String methodName = EXPRESSION_PROPERTIES[i]; + for (String methodName : EXPRESSION_PROPERTIES) { Method method; try { method = this.annotation.getClass().getDeclaredMethod(methodName); diff --git a/org.springframework.context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java b/org.springframework.context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java index c56c0a9ab442c441e6ea969e82dae85bed36cbf3..879cf0bb882abe5239037b30f14d8f63a8d74ae1 100644 --- a/org.springframework.context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java +++ b/org.springframework.context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java @@ -23,9 +23,7 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.ThreadFactory; -import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.FactoryBean; -import org.springframework.beans.factory.InitializingBean; import org.springframework.scheduling.support.DelegatingExceptionProofRunnable; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; @@ -59,12 +57,14 @@ import org.springframework.util.ObjectUtils; * * @author Juergen Hoeller * @since 2.0 + * @see #setPoolSize + * @see #setThreadFactory * @see ScheduledExecutorTask * @see java.util.concurrent.ScheduledExecutorService * @see java.util.concurrent.ScheduledThreadPoolExecutor */ public class ScheduledExecutorFactoryBean extends ExecutorConfigurationSupport - implements FactoryBean, InitializingBean, DisposableBean { + implements FactoryBean { private int poolSize = 1; @@ -144,10 +144,8 @@ public class ScheduledExecutorFactoryBean extends ExecutorConfigurationSupport /** * Create a new {@link ScheduledExecutorService} instance. - * Called by afterPropertiesSet. *

The default implementation creates a {@link ScheduledThreadPoolExecutor}. - * Can be overridden in subclasses to provide custom - * {@link ScheduledExecutorService} instances. + * Can be overridden in subclasses to provide custom {@link ScheduledExecutorService} instances. * @param poolSize the specified pool size * @param threadFactory the ThreadFactory to use * @param rejectedExecutionHandler the RejectedExecutionHandler to use diff --git a/org.springframework.context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java b/org.springframework.context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java index 3e63563f3ff9e57305eefb3b19582e1ed273d9bf..689cc142da383c8a3ac20651bea20ad8c1dfd817 100644 --- a/org.springframework.context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java +++ b/org.springframework.context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java @@ -235,12 +235,6 @@ public class ThreadPoolTaskExecutor extends ExecutorConfigurationSupport impleme } - /** - * Implementation of both the JDK 1.5 Executor interface and the Spring - * TaskExecutor interface, delegating to the ThreadPoolExecutor instance. - * @see java.util.concurrent.Executor#execute(Runnable) - * @see org.springframework.core.task.TaskExecutor#execute(Runnable) - */ public void execute(Runnable task) { Executor executor = getThreadPoolExecutor(); try {