diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java index aff19fb49d1..688ccedc5a2 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2015 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. @@ -200,8 +200,7 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut pointcutParameters[i] = parser.createPointcutParameter( this.pointcutParameterNames[i], this.pointcutParameterTypes[i]); } - return parser.parsePointcutExpression( - replaceBooleanOperators(getExpression()), + return parser.parsePointcutExpression(replaceBooleanOperators(getExpression()), this.pointcutDeclarationScope, pointcutParameters); } diff --git a/spring-context/src/main/java/org/springframework/cache/Cache.java b/spring-context/src/main/java/org/springframework/cache/Cache.java index 8a9109afc92..f0710e74c48 100644 --- a/spring-context/src/main/java/org/springframework/cache/Cache.java +++ b/spring-context/src/main/java/org/springframework/cache/Cache.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2015 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. @@ -17,7 +17,7 @@ package org.springframework.cache; /** - * Interface that defines the common cache operations. + * Interface that defines common cache operations. * * Note: Due to the generic use of caching, it is recommended that * implementations allow storage of null values (for example to diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/EnableCaching.java b/spring-context/src/main/java/org/springframework/cache/annotation/EnableCaching.java index 771487a56ff..ae3cbdf7fcf 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/EnableCaching.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/EnableCaching.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2015 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. @@ -151,13 +151,12 @@ public @interface EnableCaching { * Indicate whether subclass-based (CGLIB) proxies are to be created as opposed * to standard Java interface-based proxies. The default is {@code false}. * Applicable only if {@link #mode()} is set to {@link AdviceMode#PROXY}. - * *
Note that setting this attribute to {@code true} will affect all
- * Spring-managed beans requiring proxying, not just those marked with
- * {@code @Cacheable}. For example, other beans marked with Spring's
- * {@code @Transactional} annotation will be upgraded to subclass proxying at the same
- * time. This approach has no negative impact in practice unless one is explicitly
- * expecting one type of proxy vs another, e.g. in tests.
+ * Spring-managed beans requiring proxying, not just those marked with {@code @Cacheable}.
+ * For example, other beans marked with Spring's {@code @Transactional} annotation will
+ * be upgraded to subclass proxying at the same time. This approach has no negative
+ * impact in practice unless one is explicitly expecting one type of proxy vs another,
+ * e.g. in tests.
*/
boolean proxyTargetClass() default false;
@@ -174,4 +173,5 @@ public @interface EnableCaching {
* The default is {@link Ordered#LOWEST_PRECEDENCE}.
*/
int order() default Ordered.LOWEST_PRECEDENCE;
+
}
diff --git a/spring-context/src/main/java/org/springframework/scripting/groovy/GroovyScriptFactory.java b/spring-context/src/main/java/org/springframework/scripting/groovy/GroovyScriptFactory.java
index 105829fb9f4..22e16f6bc2b 100644
--- a/spring-context/src/main/java/org/springframework/scripting/groovy/GroovyScriptFactory.java
+++ b/spring-context/src/main/java/org/springframework/scripting/groovy/GroovyScriptFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2013 the original author or authors.
+ * Copyright 2002-2015 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.
@@ -24,7 +24,6 @@ import groovy.lang.MetaClass;
import groovy.lang.Script;
import org.codehaus.groovy.control.CompilationFailedException;
-import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
@@ -99,7 +98,7 @@ public class GroovyScriptFactory implements ScriptFactory, BeanFactoryAware, Bea
}
- public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
+ public void setBeanFactory(BeanFactory beanFactory) {
if (beanFactory instanceof ConfigurableListableBeanFactory) {
((ConfigurableListableBeanFactory) beanFactory).ignoreDependencyType(MetaClass.class);
}
diff --git a/spring-context/src/main/java/org/springframework/scripting/support/ScriptFactoryPostProcessor.java b/spring-context/src/main/java/org/springframework/scripting/support/ScriptFactoryPostProcessor.java
index a496ef705db..156e322e025 100644
--- a/spring-context/src/main/java/org/springframework/scripting/support/ScriptFactoryPostProcessor.java
+++ b/spring-context/src/main/java/org/springframework/scripting/support/ScriptFactoryPostProcessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2013 the original author or authors.
+ * Copyright 2002-2015 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.
@@ -94,7 +94,7 @@ import org.springframework.util.StringUtils;
* <property name="message" value="Hello World!"/>
* </bean>
*
- * <bean id="groovyMessenger" class="org.springframework.scripting.bsh.GroovyScriptFactory">
+ * <bean id="groovyMessenger" class="org.springframework.scripting.groovy.GroovyScriptFactory">
* <constructor-arg value="classpath:mypackage/Messenger.groovy"/>
* <property name="message" value="Hello World!"/>
* </bean>
@@ -325,7 +325,7 @@ public class ScriptFactoryPostProcessor extends InstantiationAwareBeanPostProces
if (proxyTargetClass && (language == null || !language.equals("groovy"))) {
throw new BeanDefinitionValidationException(
"Cannot use proxyTargetClass=true with script beans where language is not 'groovy': '" +
- language + "'");
+ language + "'");
}
ts.setRefreshCheckDelay(refreshCheckDelay);
return createRefreshableProxy(ts, interfaces, proxyTargetClass);
@@ -346,17 +346,16 @@ public class ScriptFactoryPostProcessor extends InstantiationAwareBeanPostProces
* @param scriptedObjectBeanName the name of the internal scripted object bean
*/
protected void prepareScriptBeans(BeanDefinition bd, String scriptFactoryBeanName, String scriptedObjectBeanName) {
-
// Avoid recreation of the script bean definition in case of a prototype.
synchronized (this.scriptBeanFactory) {
if (!this.scriptBeanFactory.containsBeanDefinition(scriptedObjectBeanName)) {
- this.scriptBeanFactory.registerBeanDefinition(scriptFactoryBeanName,
- createScriptFactoryBeanDefinition(bd));
- ScriptFactory scriptFactory = this.scriptBeanFactory
- .getBean(scriptFactoryBeanName, ScriptFactory.class);
- ScriptSource scriptSource = getScriptSource(scriptFactoryBeanName,
- scriptFactory.getScriptSourceLocator());
+ this.scriptBeanFactory.registerBeanDefinition(
+ scriptFactoryBeanName, createScriptFactoryBeanDefinition(bd));
+ ScriptFactory scriptFactory =
+ this.scriptBeanFactory.getBean(scriptFactoryBeanName, ScriptFactory.class);
+ ScriptSource scriptSource =
+ getScriptSource(scriptFactoryBeanName, scriptFactory.getScriptSourceLocator());
Class>[] interfaces = scriptFactory.getScriptInterfaces();
Class>[] scriptedInterfaces = interfaces;
@@ -365,8 +364,8 @@ public class ScriptFactoryPostProcessor extends InstantiationAwareBeanPostProces
scriptedInterfaces = ObjectUtils.addObjectToArray(interfaces, configInterface);
}
- BeanDefinition objectBd = createScriptedObjectBeanDefinition(bd, scriptFactoryBeanName, scriptSource,
- scriptedInterfaces);
+ BeanDefinition objectBd = createScriptedObjectBeanDefinition(
+ bd, scriptFactoryBeanName, scriptSource, scriptedInterfaces);
long refreshCheckDelay = resolveRefreshCheckDelay(bd);
if (refreshCheckDelay >= 0) {
objectBd.setScope(BeanDefinition.SCOPE_PROTOTYPE);
@@ -569,7 +568,7 @@ public class ScriptFactoryPostProcessor extends InstantiationAwareBeanPostProces
proxyFactory.setInterfaces(interfaces);
if (proxyTargetClass) {
classLoader = null; // force use of Class.getClassLoader()
- proxyFactory.setProxyTargetClass(proxyTargetClass);
+ proxyFactory.setProxyTargetClass(true);
}
DelegatingIntroductionInterceptor introduction = new DelegatingIntroductionInterceptor(ts);
diff --git a/spring-context/src/test/java/org/springframework/beans/factory/support/InjectAnnotationAutowireContextTests.java b/spring-context/src/test/java/org/springframework/beans/factory/support/InjectAnnotationAutowireContextTests.java
index 3544595d9dc..fcceb3fb3b7 100644
--- a/spring-context/src/test/java/org/springframework/beans/factory/support/InjectAnnotationAutowireContextTests.java
+++ b/spring-context/src/test/java/org/springframework/beans/factory/support/InjectAnnotationAutowireContextTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2013 the original author or authors.
+ * Copyright 2002-2015 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.
@@ -24,7 +24,6 @@ import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Qualifier;
-import static org.junit.Assert.*;
import org.junit.Test;
import org.springframework.aop.scope.ScopedProxyUtils;
@@ -36,6 +35,8 @@ import org.springframework.beans.factory.config.ConstructorArgumentValues;
import org.springframework.context.annotation.AnnotationConfigUtils;
import org.springframework.context.support.GenericApplicationContext;
+import static org.junit.Assert.*;
+
/**
* Integration tests for handling JSR-303 {@link javax.inject.Qualifier} annotations.
*
@@ -666,27 +667,27 @@ public class InjectAnnotationAutowireContextTests {
@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Qualifier
- public static @interface TestQualifier {
+ public @interface TestQualifier {
}
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Qualifier
- public static @interface TestQualifierWithDefaultValue {
+ public @interface TestQualifierWithDefaultValue {
- public abstract String value() default "default";
+ String value() default "default";
}
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Qualifier
- public static @interface TestQualifierWithMultipleAttributes {
+ public @interface TestQualifierWithMultipleAttributes {
- public abstract String value() default "default";
+ String value() default "default";
- public abstract int number();
+ int number();
}
}
diff --git a/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java b/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java
index 22a41a0ee9f..f1757f83905 100644
--- a/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java
+++ b/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java
@@ -91,7 +91,8 @@ public abstract class ReflectionUtils {
while (!Object.class.equals(searchType) && searchType != null) {
Field[] fields = searchType.getDeclaredFields();
for (Field field : fields) {
- if ((name == null || name.equals(field.getName())) && (type == null || type.equals(field.getType()))) {
+ if ((name == null || name.equals(field.getName())) &&
+ (type == null || type.equals(field.getType()))) {
return field;
}
}
@@ -424,7 +425,8 @@ public abstract class ReflectionUtils {
* @see java.lang.reflect.Field#setAccessible
*/
public static void makeAccessible(Field field) {
- if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers()) ||
+ if ((!Modifier.isPublic(field.getModifiers()) ||
+ !Modifier.isPublic(field.getDeclaringClass().getModifiers()) ||
Modifier.isFinal(field.getModifiers())) && !field.isAccessible()) {
field.setAccessible(true);
}
diff --git a/spring-core/src/test/java/org/springframework/core/GenericTypeResolverTests.java b/spring-core/src/test/java/org/springframework/core/GenericTypeResolverTests.java
index ca335500027..5495b993d09 100644
--- a/spring-core/src/test/java/org/springframework/core/GenericTypeResolverTests.java
+++ b/spring-core/src/test/java/org/springframework/core/GenericTypeResolverTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2013 the original author or authors.
+ * Copyright 2002-2015 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.
@@ -165,11 +165,11 @@ public class GenericTypeResolverTests {
public void getGenericsOnArrayFromReturnCannotBeResolved() throws Exception {
// SPR-11044
Class> resolved = GenericTypeResolver.resolveReturnType(
- WithArrayBase.class.getDeclaredMethod("array", Object[].class),
- WithArray.class);
+ WithArrayBase.class.getDeclaredMethod("array", Object[].class), WithArray.class);
assertThat(resolved, equalTo((Class) Object[].class));
}
+
public interface MyInterfaceType