Polishing (typo fixes etc, aligned with 5.0.x)
This commit is contained in:
@@ -24,7 +24,7 @@ import org.springframework.aop.Pointcut;
|
||||
* Convenient superclass when we want to force subclasses to
|
||||
* implement MethodMatcher interface, but subclasses
|
||||
* will want to be pointcuts. The getClassFilter() method can
|
||||
* be overriden to customize ClassFilter behaviour as well.
|
||||
* be overridden to customize ClassFilter behaviour as well.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
*/
|
||||
|
||||
@@ -44,7 +44,7 @@ import static org.junit.Assert.*;
|
||||
* @author Ramnivas Laddad
|
||||
* @since 2.0
|
||||
*/
|
||||
public final class MethodInvocationProceedingJoinPointTests {
|
||||
public class MethodInvocationProceedingJoinPointTests {
|
||||
|
||||
@Test
|
||||
public void testingBindingWithJoinPoint() {
|
||||
@@ -217,7 +217,7 @@ public final class MethodInvocationProceedingJoinPointTests {
|
||||
itb.unreliableFileOperation();
|
||||
}
|
||||
catch (IOException ex) {
|
||||
// we don't realy care...
|
||||
// we don't really care...
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.springframework.beans.factory.config.BeanReference;
|
||||
* all {@link BeanReference BeanReferences} that are required to validate the configuration of the
|
||||
* overall logical entity as well as those required to provide full user visualisation of the configuration.
|
||||
* It is expected that certain {@link BeanReference BeanReferences} will not be important to
|
||||
* validation or to the user view of the configuration and as such these may be ommitted. A tool may wish to
|
||||
* validation or to the user view of the configuration and as such these may be omitted. A tool may wish to
|
||||
* display any additional {@link BeanReference BeanReferences} sourced through the supplied
|
||||
* {@link BeanDefinition BeanDefinitions} but this is not considered to be a typical case.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -27,7 +27,7 @@ import org.springframework.util.Assert;
|
||||
* PagedListHolder is a simple state holder for handling lists of objects,
|
||||
* separating them into pages. Page numbering starts with 0.
|
||||
*
|
||||
* <p>This is mainly targetted at usage in web UIs. Typically, an instance will be
|
||||
* <p>This is mainly targeted at usage in web UIs. Typically, an instance will be
|
||||
* instantiated with a list of beans, put into the session, and exported as model.
|
||||
* The properties can all be set/get programmatically, but the most common way will
|
||||
* be data binding, i.e. populating the bean from request parameters. The getters
|
||||
@@ -50,8 +50,14 @@ import org.springframework.util.Assert;
|
||||
@SuppressWarnings("serial")
|
||||
public class PagedListHolder<E> implements Serializable {
|
||||
|
||||
/**
|
||||
* The default page size.
|
||||
*/
|
||||
public static final int DEFAULT_PAGE_SIZE = 10;
|
||||
|
||||
/**
|
||||
* The default maximum number of page links.
|
||||
*/
|
||||
public static final int DEFAULT_MAX_LINKED_PAGES = 10;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2017 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.
|
||||
@@ -173,7 +173,7 @@ public class ScheduledTimerListener {
|
||||
* Set the period between repeated task executions, in milliseconds.
|
||||
* <p>Default is -1, leading to one-time execution. In case of zero or a
|
||||
* positive value, the task will be executed repeatedly, with the given
|
||||
* interval inbetween executions.
|
||||
* interval in-between executions.
|
||||
* <p>Note that the semantics of the period value vary between fixed-rate
|
||||
* and fixed-delay execution.
|
||||
* <p><b>Note:</b> A period of 0 (for example as fixed delay) <i>is</i>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
-- In your Quartz properties file, you'll need to set
|
||||
-- org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.HSQLDBDelegate
|
||||
--
|
||||
-- Column lenghts are only suggestions. For names, groups, use at least 40 chars.
|
||||
-- Column lengths are only suggestions. For names, groups, use at least 40 chars.
|
||||
-- for blobs (VARBINARY) use a size that is sure to meet the needs of the amount of data
|
||||
-- you place in job data maps, etc..
|
||||
--
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -23,39 +23,38 @@ import org.springframework.cache.interceptor.CacheOperation;
|
||||
|
||||
/**
|
||||
* Strategy interface for parsing known caching annotation types.
|
||||
* {@link AnnotationCacheOperationSource} delegates to such
|
||||
* parsers for supporting specific annotation types such as Spring's own
|
||||
* {@link Cacheable}, {@link CachePut} or {@link CacheEvict}.
|
||||
* {@link AnnotationCacheOperationSource} delegates to such parsers
|
||||
* for supporting specific annotation types such as Spring's own
|
||||
* {@link Cacheable}, {@link CachePut} and{@link CacheEvict}.
|
||||
*
|
||||
* @author Costin Leau
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.1
|
||||
* @see AnnotationCacheOperationSource
|
||||
* @see SpringCacheAnnotationParser
|
||||
*/
|
||||
public interface CacheAnnotationParser {
|
||||
|
||||
/**
|
||||
* Parses the cache definition for the given class,
|
||||
* based on a known annotation type.
|
||||
* <p>This essentially parses a known cache annotation into Spring's
|
||||
* metadata attribute class. Returns {@code null} if the class
|
||||
* is not cacheable.
|
||||
* Parse the cache definition for the given class,
|
||||
* based on an annotation type understood by this parser.
|
||||
* <p>This essentially parses a known cache annotation into Spring's metadata
|
||||
* attribute class. Returns {@code null} if the class is not cacheable.
|
||||
* @param type the annotated class
|
||||
* @return CacheOperation the configured caching operation,
|
||||
* or {@code null} if none was found
|
||||
* @return the configured caching operation, or {@code null} if none found
|
||||
* @see AnnotationCacheOperationSource#findCacheOperations(Class)
|
||||
*/
|
||||
Collection<CacheOperation> parseCacheAnnotations(Class<?> type);
|
||||
|
||||
/**
|
||||
* Parses the cache definition for the given method,
|
||||
* based on a known annotation type.
|
||||
* <p>This essentially parses a known cache annotation into Spring's
|
||||
* metadata attribute class. Returns {@code null} if the method
|
||||
* is not cacheable.
|
||||
* Parse the cache definition for the given method,
|
||||
* based on an annotation type understood by this parser.
|
||||
* <p>This essentially parses a known cache annotation into Spring's metadata
|
||||
* attribute class. Returns {@code null} if the method is not cacheable.
|
||||
* @param method the annotated method
|
||||
* @return CacheOperation the configured caching operation,
|
||||
* or {@code null} if none was found
|
||||
* @return the configured caching operation, or {@code null} if none found
|
||||
* @see AnnotationCacheOperationSource#findCacheOperations(Method)
|
||||
*/
|
||||
Collection<CacheOperation> parseCacheAnnotations(Method method);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -55,7 +55,7 @@ public abstract class AbstractFallbackCacheOperationSource implements CacheOpera
|
||||
* Canonical value held in cache to indicate no caching attribute was
|
||||
* found for this method and we don't need to look again.
|
||||
*/
|
||||
private final static Collection<CacheOperation> NULL_CACHING_ATTRIBUTE = Collections.emptyList();
|
||||
private static final Collection<CacheOperation> NULL_CACHING_ATTRIBUTE = Collections.emptyList();
|
||||
|
||||
|
||||
/**
|
||||
@@ -163,23 +163,21 @@ public abstract class AbstractFallbackCacheOperationSource implements CacheOpera
|
||||
|
||||
|
||||
/**
|
||||
* Subclasses need to implement this to return the caching attribute
|
||||
* for the given method, if any.
|
||||
* @param method the method to retrieve the attribute for
|
||||
* @return all caching attribute associated with this method
|
||||
* (or {@code null} if none)
|
||||
*/
|
||||
protected abstract Collection<CacheOperation> findCacheOperations(Method method);
|
||||
|
||||
/**
|
||||
* Subclasses need to implement this to return the caching attribute
|
||||
* for the given class, if any.
|
||||
* Subclasses need to implement this to return the caching attribute for the
|
||||
* given class, if any.
|
||||
* @param clazz the class to retrieve the attribute for
|
||||
* @return all caching attribute associated with this class
|
||||
* (or {@code null} if none)
|
||||
* @return all caching attribute associated with this class, or {@code null} if none
|
||||
*/
|
||||
protected abstract Collection<CacheOperation> findCacheOperations(Class<?> clazz);
|
||||
|
||||
/**
|
||||
* Subclasses need to implement this to return the caching attribute for the
|
||||
* given method, if any.
|
||||
* @param method the method to retrieve the attribute for
|
||||
* @return all caching attribute associated with this method, or {@code null} if none
|
||||
*/
|
||||
protected abstract Collection<CacheOperation> findCacheOperations(Method method);
|
||||
|
||||
/**
|
||||
* Should only public methods be allowed to have caching semantics?
|
||||
* <p>The default implementation returns {@code false}.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -53,8 +53,8 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life
|
||||
/**
|
||||
* Name of the ConversionService bean in the factory.
|
||||
* If none is supplied, default conversion rules apply.
|
||||
* @see org.springframework.core.convert.ConversionService
|
||||
* @since 3.0
|
||||
* @see org.springframework.core.convert.ConversionService
|
||||
*/
|
||||
String CONVERSION_SERVICE_BEAN_NAME = "conversionService";
|
||||
|
||||
@@ -196,7 +196,7 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life
|
||||
* will already have been instantiated before. Use a BeanFactoryPostProcessor
|
||||
* to intercept the BeanFactory setup process before beans get touched.
|
||||
* <p>Generally, this internal factory will only be accessible while the context
|
||||
* is active, that is, inbetween {@link #refresh()} and {@link #close()}.
|
||||
* is active, that is, in-between {@link #refresh()} and {@link #close()}.
|
||||
* The {@link #isActive()} flag can be used to check whether the context
|
||||
* is in an appropriate state.
|
||||
* @return the underlying bean factory
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -334,7 +334,7 @@ public abstract class AbstractReflectiveMBeanInfoAssembler extends AbstractMBean
|
||||
/**
|
||||
* Iterate through all methods on the MBean class and gives subclasses the chance
|
||||
* to vote on their inclusion. If a particular method corresponds to the accessor
|
||||
* or mutator of an attribute that is inclued in the managment interface, then
|
||||
* or mutator of an attribute that is included in the management interface, then
|
||||
* the corresponding operation is exposed with the "role" descriptor
|
||||
* field set to the appropriate value.
|
||||
* @param managedBean the bean instance (might be an AOP proxy)
|
||||
@@ -358,25 +358,23 @@ public abstract class AbstractReflectiveMBeanInfoAssembler extends AbstractMBean
|
||||
|
||||
ModelMBeanOperationInfo info = null;
|
||||
PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
|
||||
if (pd != null) {
|
||||
if ((method.equals(pd.getReadMethod()) && includeReadAttribute(method, beanKey)) ||
|
||||
(method.equals(pd.getWriteMethod()) && includeWriteAttribute(method, beanKey))) {
|
||||
// Attributes need to have their methods exposed as
|
||||
// operations to the JMX server as well.
|
||||
info = createModelMBeanOperationInfo(method, pd.getName(), beanKey);
|
||||
Descriptor desc = info.getDescriptor();
|
||||
if (method.equals(pd.getReadMethod())) {
|
||||
desc.setField(FIELD_ROLE, ROLE_GETTER);
|
||||
}
|
||||
else {
|
||||
desc.setField(FIELD_ROLE, ROLE_SETTER);
|
||||
}
|
||||
desc.setField(FIELD_VISIBILITY, ATTRIBUTE_OPERATION_VISIBILITY);
|
||||
if (isExposeClassDescriptor()) {
|
||||
desc.setField(FIELD_CLASS, getClassForDescriptor(managedBean).getName());
|
||||
}
|
||||
info.setDescriptor(desc);
|
||||
if (pd != null && ((method.equals(pd.getReadMethod()) && includeReadAttribute(method, beanKey)) ||
|
||||
(method.equals(pd.getWriteMethod()) && includeWriteAttribute(method, beanKey)))) {
|
||||
// Attributes need to have their methods exposed as
|
||||
// operations to the JMX server as well.
|
||||
info = createModelMBeanOperationInfo(method, pd.getName(), beanKey);
|
||||
Descriptor desc = info.getDescriptor();
|
||||
if (method.equals(pd.getReadMethod())) {
|
||||
desc.setField(FIELD_ROLE, ROLE_GETTER);
|
||||
}
|
||||
else {
|
||||
desc.setField(FIELD_ROLE, ROLE_SETTER);
|
||||
}
|
||||
desc.setField(FIELD_VISIBILITY, ATTRIBUTE_OPERATION_VISIBILITY);
|
||||
if (isExposeClassDescriptor()) {
|
||||
desc.setField(FIELD_CLASS, getClassForDescriptor(managedBean).getName());
|
||||
}
|
||||
info.setDescriptor(desc);
|
||||
}
|
||||
|
||||
// allow getters and setters to be marked as operations directly
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2017 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.
|
||||
@@ -127,7 +127,7 @@ public class ScheduledExecutorTask {
|
||||
/**
|
||||
* Set the period between repeated task executions, in milliseconds.
|
||||
* <p>Default is -1, leading to one-time execution. In case of a positive value,
|
||||
* the task will be executed repeatedly, with the given interval inbetween executions.
|
||||
* the task will be executed repeatedly, with the given interval in-between executions.
|
||||
* <p>Note that the semantics of the period value vary between fixed-rate and
|
||||
* fixed-delay execution.
|
||||
* <p><b>Note:</b> A period of 0 (for example as fixed delay) is <i>not</i> supported,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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,7 +69,7 @@ import static org.junit.Assert.*;
|
||||
* @author Juergen Hoeller
|
||||
* @author Chris Beams
|
||||
*/
|
||||
public final class ProxyFactoryBeanTests {
|
||||
public class ProxyFactoryBeanTests {
|
||||
|
||||
private static final Class<?> CLASS = ProxyFactoryBeanTests.class;
|
||||
private static final String CLASSNAME = CLASS.getSimpleName();
|
||||
@@ -259,22 +259,22 @@ public final class ProxyFactoryBeanTests {
|
||||
|
||||
// Check it works without AOP
|
||||
SideEffectBean raw = (SideEffectBean) bf.getBean("prototypeTarget");
|
||||
assertEquals(INITIAL_COUNT, raw.getCount() );
|
||||
assertEquals(INITIAL_COUNT, raw.getCount());
|
||||
raw.doWork();
|
||||
assertEquals(INITIAL_COUNT+1, raw.getCount() );
|
||||
assertEquals(INITIAL_COUNT+1, raw.getCount());
|
||||
raw = (SideEffectBean) bf.getBean("prototypeTarget");
|
||||
assertEquals(INITIAL_COUNT, raw.getCount() );
|
||||
assertEquals(INITIAL_COUNT, raw.getCount());
|
||||
|
||||
// Now try with advised instances
|
||||
SideEffectBean prototype2FirstInstance = (SideEffectBean) bf.getBean(beanName);
|
||||
assertEquals(INITIAL_COUNT, prototype2FirstInstance.getCount() );
|
||||
assertEquals(INITIAL_COUNT, prototype2FirstInstance.getCount());
|
||||
prototype2FirstInstance.doWork();
|
||||
assertEquals(INITIAL_COUNT + 1, prototype2FirstInstance.getCount() );
|
||||
assertEquals(INITIAL_COUNT + 1, prototype2FirstInstance.getCount());
|
||||
|
||||
SideEffectBean prototype2SecondInstance = (SideEffectBean) bf.getBean(beanName);
|
||||
assertFalse("Prototypes are not ==", prototype2FirstInstance == prototype2SecondInstance);
|
||||
assertEquals(INITIAL_COUNT, prototype2SecondInstance.getCount() );
|
||||
assertEquals(INITIAL_COUNT + 1, prototype2FirstInstance.getCount() );
|
||||
assertEquals(INITIAL_COUNT, prototype2SecondInstance.getCount());
|
||||
assertEquals(INITIAL_COUNT + 1, prototype2FirstInstance.getCount());
|
||||
|
||||
return prototype2FirstInstance;
|
||||
}
|
||||
@@ -397,7 +397,7 @@ public final class ProxyFactoryBeanTests {
|
||||
config.removeAdvice(debugInterceptor);
|
||||
it.getSpouse();
|
||||
|
||||
// Still invoked wiht old reference
|
||||
// Still invoked with old reference
|
||||
assertEquals(2, debugInterceptor.getCount());
|
||||
|
||||
// not invoked with new object
|
||||
@@ -714,7 +714,7 @@ public final class ProxyFactoryBeanTests {
|
||||
@SuppressWarnings("serial")
|
||||
public static class PointcutForVoid extends DefaultPointcutAdvisor {
|
||||
|
||||
public static List<String> methodNames = new LinkedList<String>();
|
||||
public static List<String> methodNames = new LinkedList<>();
|
||||
|
||||
public static void reset() {
|
||||
methodNames.clear();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -97,7 +97,6 @@ public class EnableAsyncTests {
|
||||
fail("Should have thrown UnsatisfiedDependencyException");
|
||||
}
|
||||
catch (UnsatisfiedDependencyException ex) {
|
||||
ex.printStackTrace();
|
||||
assertTrue(ex.getCause() instanceof BeanNotOfRequiredTypeException);
|
||||
}
|
||||
}
|
||||
@@ -112,7 +111,6 @@ public class EnableAsyncTests {
|
||||
fail("Should have thrown UnsatisfiedDependencyException");
|
||||
}
|
||||
catch (UnsatisfiedDependencyException ex) {
|
||||
ex.printStackTrace();
|
||||
assertTrue(ex.getCause() instanceof BeanNotOfRequiredTypeException);
|
||||
}
|
||||
}
|
||||
@@ -219,8 +217,8 @@ public class EnableAsyncTests {
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void spr14949FindsOnInterfaceWithInterfaceProxy() throws InterruptedException {
|
||||
@Test // SPR-14949
|
||||
public void findOnInterfaceWithInterfaceProxy() throws InterruptedException {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Spr14949ConfigA.class);
|
||||
|
||||
AsyncInterface asyncBean = ctx.getBean(AsyncInterface.class);
|
||||
@@ -231,8 +229,8 @@ public class EnableAsyncTests {
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
@Test @Ignore // TODO
|
||||
public void spr14949FindsOnInterfaceWithCglibProxy() throws InterruptedException {
|
||||
@Test @Ignore // SPR-14949
|
||||
public void findOnInterfaceWithCglibProxy() throws InterruptedException {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Spr14949ConfigB.class);
|
||||
|
||||
AsyncInterface asyncBean = ctx.getBean(AsyncInterface.class);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -57,7 +57,6 @@ import static org.junit.Assert.*;
|
||||
/**
|
||||
* @author Kazuki Shimizu
|
||||
* @author Juergen Hoeller
|
||||
* @since 4.3
|
||||
*/
|
||||
public class SpringValidatorAdapterTests {
|
||||
|
||||
@@ -162,7 +161,7 @@ public class SpringValidatorAdapterTests {
|
||||
@Test // SPR-16177
|
||||
public void testWithSet() {
|
||||
Parent parent = new Parent();
|
||||
parent.setName("Parent whith set");
|
||||
parent.setName("Parent with set");
|
||||
parent.getChildSet().addAll(createChildren(parent));
|
||||
|
||||
BeanPropertyBindingResult errors = new BeanPropertyBindingResult(parent, "parent");
|
||||
@@ -185,6 +184,7 @@ public class SpringValidatorAdapterTests {
|
||||
return Arrays.asList(child1, child2);
|
||||
}
|
||||
|
||||
|
||||
@Same(field = "password", comparingField = "confirmPassword")
|
||||
@Same(field = "email", comparingField = "confirmEmail")
|
||||
static class TestBean {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<!-- We are only using one definition file for the purposes of this test, since we do not have multiple
|
||||
classloaders available in the environment to allow combining multiple files of the same name, but
|
||||
of course the contents within could be spread out across multiple files of the same name withing
|
||||
of course the contents within could be spread out across multiple files of the same name within
|
||||
different jars -->
|
||||
|
||||
<beans>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -32,7 +32,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class LocalizedResourceHelper {
|
||||
|
||||
/** The default separator to use inbetween file name parts: an underscore */
|
||||
/** The default separator to use in-between file name parts: an underscore */
|
||||
public static final String DEFAULT_SEPARATOR = "_";
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class LocalizedResourceHelper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the separator to use inbetween file name parts.
|
||||
* Set the separator to use in-between file name parts.
|
||||
* Default is an underscore ("_").
|
||||
*/
|
||||
public void setSeparator(String separator) {
|
||||
|
||||
@@ -144,7 +144,8 @@ public class AnnotationUtilsTests {
|
||||
assertNull(getAnnotation(bridgeMethod, Order.class));
|
||||
assertNotNull(findAnnotation(bridgeMethod, Order.class));
|
||||
|
||||
assertNotNull(bridgeMethod.getAnnotation(Transactional.class));
|
||||
// Inconsistent behavior between javac and Eclipse compiler
|
||||
// assertNotNull(bridgeMethod.getAnnotation(Transactional.class));
|
||||
assertNotNull(getAnnotation(bridgeMethod, Transactional.class));
|
||||
assertNotNull(findAnnotation(bridgeMethod, Transactional.class));
|
||||
}
|
||||
@@ -186,7 +187,7 @@ public class AnnotationUtilsTests {
|
||||
assertNotNull(order);
|
||||
}
|
||||
|
||||
/** @since 4.1.2 */
|
||||
// @since 4.1.2
|
||||
@Test
|
||||
public void findClassAnnotationFavorsMoreLocallyDeclaredComposedAnnotationsOverAnnotationsOnInterfaces() {
|
||||
Component component = findAnnotation(ClassWithLocalMetaAnnotationAndMetaAnnotatedInterface.class, Component.class);
|
||||
@@ -194,7 +195,7 @@ public class AnnotationUtilsTests {
|
||||
assertEquals("meta2", component.value());
|
||||
}
|
||||
|
||||
/** @since 4.0.3 */
|
||||
// @since 4.0.3
|
||||
@Test
|
||||
public void findClassAnnotationFavorsMoreLocallyDeclaredComposedAnnotationsOverInheritedAnnotations() {
|
||||
Transactional transactional = findAnnotation(SubSubClassWithInheritedAnnotation.class, Transactional.class);
|
||||
@@ -202,7 +203,7 @@ public class AnnotationUtilsTests {
|
||||
assertTrue("readOnly flag for SubSubClassWithInheritedAnnotation", transactional.readOnly());
|
||||
}
|
||||
|
||||
/** @since 4.0.3 */
|
||||
// @since 4.0.3
|
||||
@Test
|
||||
public void findClassAnnotationFavorsMoreLocallyDeclaredComposedAnnotationsOverInheritedComposedAnnotations() {
|
||||
Component component = findAnnotation(SubSubClassWithInheritedMetaAnnotation.class, Component.class);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -46,7 +46,7 @@ import org.springframework.jdbc.core.BatchPreparedStatementSetter;
|
||||
public class BatchSqlUpdate extends SqlUpdate {
|
||||
|
||||
/**
|
||||
* Default number of inserts to accumulate before commiting a batch (5000).
|
||||
* Default number of inserts to accumulate before committing a batch (5000).
|
||||
*/
|
||||
public static final int DEFAULT_BATCH_SIZE = 5000;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 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.
|
||||
@@ -57,7 +57,7 @@ import org.springframework.transaction.support.TransactionSynchronizationUtils;
|
||||
* {@link org.springframework.transaction.PlatformTransactionManager} into the
|
||||
* {@link #setTransactionManager "transactionManager"} property. This will usually
|
||||
* be a {@link org.springframework.transaction.jta.JtaTransactionManager} in a
|
||||
* Java EE enviroment, in combination with a JTA-aware JMS ConnectionFactory
|
||||
* Java EE environment, in combination with a JTA-aware JMS ConnectionFactory
|
||||
* obtained from JNDI (check your application server's documentation).
|
||||
*
|
||||
* <p>This base class does not assume any specific mechanism for asynchronous
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2017 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.
|
||||
@@ -79,7 +79,7 @@ public class BeanFactoryDestinationResolver implements DestinationResolver, Bean
|
||||
}
|
||||
catch (BeansException ex) {
|
||||
throw new DestinationResolutionException(
|
||||
"Failed to look up Destinaton bean with name '" + destinationName + "'", ex);
|
||||
"Failed to look up Destination bean with name '" + destinationName + "'", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Provides generic support classes for using Spring's O/X Mapping integration
|
||||
* within various scenario's. Includes the MarshallingSource for compatibility
|
||||
* with TrAX, MarshallingView for use withing Spring Web MVC, and the
|
||||
* with TrAX, MarshallingView for use within Spring Web MVC, and the
|
||||
* MarshallingMessageConverter for use within Spring's JMS support.
|
||||
*/
|
||||
package org.springframework.oxm.support;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package org.springframework.dao;
|
||||
|
||||
/**
|
||||
* Exception thrown on failure to aquire a lock during an update,
|
||||
* Exception thrown on failure to acquire a lock during an update,
|
||||
* for example during a "select for update" statement.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
|
||||
@@ -129,13 +129,13 @@ public class AnnotationTransactionAttributeSource extends AbstractFallbackTransa
|
||||
|
||||
|
||||
@Override
|
||||
protected TransactionAttribute findTransactionAttribute(Method method) {
|
||||
return determineTransactionAttribute(method);
|
||||
protected TransactionAttribute findTransactionAttribute(Class<?> clazz) {
|
||||
return determineTransactionAttribute(clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TransactionAttribute findTransactionAttribute(Class<?> clazz) {
|
||||
return determineTransactionAttribute(clazz);
|
||||
protected TransactionAttribute findTransactionAttribute(Method method) {
|
||||
return determineTransactionAttribute(method);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -54,7 +54,13 @@ public abstract class AbstractFallbackTransactionAttributeSource implements Tran
|
||||
* Canonical value held in cache to indicate no transaction attribute was
|
||||
* found for this method, and we don't need to look again.
|
||||
*/
|
||||
private final static TransactionAttribute NULL_TRANSACTION_ATTRIBUTE = new DefaultTransactionAttribute();
|
||||
@SuppressWarnings("serial")
|
||||
private static final TransactionAttribute NULL_TRANSACTION_ATTRIBUTE = new DefaultTransactionAttribute() {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -78,7 +84,7 @@ public abstract class AbstractFallbackTransactionAttributeSource implements Tran
|
||||
* <p>Defaults to the class's transaction attribute if no method attribute is found.
|
||||
* @param method the method for the current invocation (never {@code null})
|
||||
* @param targetClass the target class for this invocation (may be {@code null})
|
||||
* @return TransactionAttribute for this method, or {@code null} if the method
|
||||
* @return a TransactionAttribute for this method, or {@code null} if the method
|
||||
* is not transactional
|
||||
*/
|
||||
@Override
|
||||
@@ -89,7 +95,7 @@ public abstract class AbstractFallbackTransactionAttributeSource implements Tran
|
||||
|
||||
// First, see if we have a cached value.
|
||||
Object cacheKey = getCacheKey(method, targetClass);
|
||||
Object cached = this.attributeCache.get(cacheKey);
|
||||
TransactionAttribute cached = this.attributeCache.get(cacheKey);
|
||||
if (cached != null) {
|
||||
// Value will either be canonical value indicating there is no transaction attribute,
|
||||
// or an actual transaction attribute.
|
||||
@@ -97,7 +103,7 @@ public abstract class AbstractFallbackTransactionAttributeSource implements Tran
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
return (TransactionAttribute) cached;
|
||||
return cached;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -184,23 +190,20 @@ public abstract class AbstractFallbackTransactionAttributeSource implements Tran
|
||||
|
||||
|
||||
/**
|
||||
* Subclasses need to implement this to return the transaction attribute
|
||||
* for the given method, if any.
|
||||
* @param method the method to retrieve the attribute for
|
||||
* @return all transaction attribute associated with this method
|
||||
* (or {@code null} if none)
|
||||
*/
|
||||
protected abstract TransactionAttribute findTransactionAttribute(Method method);
|
||||
|
||||
/**
|
||||
* Subclasses need to implement this to return the transaction attribute
|
||||
* for the given class, if any.
|
||||
* Subclasses need to implement this to return the transaction attribute for the
|
||||
* given class, if any.
|
||||
* @param clazz the class to retrieve the attribute for
|
||||
* @return all transaction attribute associated with this class
|
||||
* (or {@code null} if none)
|
||||
* @return all transaction attribute associated with this class, or {@code null} if none
|
||||
*/
|
||||
protected abstract TransactionAttribute findTransactionAttribute(Class<?> clazz);
|
||||
|
||||
/**
|
||||
* Subclasses need to implement this to return the transaction attribute for the
|
||||
* given method, if any.
|
||||
* @param method the method to retrieve the attribute for
|
||||
* @return all transaction attribute associated with this method, or {@code null} if none
|
||||
*/
|
||||
protected abstract TransactionAttribute findTransactionAttribute(Method method);
|
||||
|
||||
/**
|
||||
* Should only public methods be allowed to have transactional semantics?
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -28,26 +28,26 @@ import java.util.Map;
|
||||
*/
|
||||
public class MapTransactionAttributeSource extends AbstractFallbackTransactionAttributeSource {
|
||||
|
||||
private final Map<Object, TransactionAttribute> attributeMap = new HashMap<Object, TransactionAttribute>();
|
||||
private final Map<Object, TransactionAttribute> attributeMap = new HashMap<>();
|
||||
|
||||
|
||||
public void register(Method method, TransactionAttribute txAttr) {
|
||||
this.attributeMap.put(method, txAttr);
|
||||
}
|
||||
|
||||
public void register(Class<?> clazz, TransactionAttribute txAttr) {
|
||||
this.attributeMap.put(clazz, txAttr);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected TransactionAttribute findTransactionAttribute(Method method) {
|
||||
return this.attributeMap.get(method);
|
||||
public void register(Method method, TransactionAttribute txAttr) {
|
||||
this.attributeMap.put(method, txAttr);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected TransactionAttribute findTransactionAttribute(Class<?> clazz) {
|
||||
return this.attributeMap.get(clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TransactionAttribute findTransactionAttribute(Method method) {
|
||||
return this.attributeMap.get(method);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -22,17 +22,17 @@ import com.google.protobuf.ExtensionRegistry;
|
||||
* Google Protocol Messages can contain message extensions that can be parsed if
|
||||
* the appropriate configuration has been registered in the {@code ExtensionRegistry}.
|
||||
*
|
||||
* This interface provides a facility to populate the {@code ExtensionRegistry}.
|
||||
* <p>This interface provides a facility to populate the {@code ExtensionRegistry}.
|
||||
*
|
||||
* @author Alex Antonov
|
||||
* @since 4.1
|
||||
* @see <a href="https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/ExtensionRegistry">
|
||||
* com.google.protobuf.ExtensionRegistry</a>
|
||||
* com.google.protobuf.ExtensionRegistry</a>
|
||||
*/
|
||||
public interface ExtensionRegistryInitializer {
|
||||
|
||||
/**
|
||||
* Initializes the {@code ExtensionRegistry} with Protocol Message extensions
|
||||
* Initializes the {@code ExtensionRegistry} with Protocol Message extensions.
|
||||
* @param registry the registry to populate
|
||||
*/
|
||||
void initializeExtensionRegistry(ExtensionRegistry registry);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -32,7 +32,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
* @author Sebastien Deleuze
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.2
|
||||
* @see <a href="http://www.w3.org/TR/cors/">CORS W3C recommandation</a>
|
||||
* @see <a href="http://www.w3.org/TR/cors/">CORS W3C recommendation</a>
|
||||
* @see org.springframework.web.servlet.handler.AbstractHandlerMapping#setCorsProcessor
|
||||
*/
|
||||
public interface CorsProcessor {
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.http.HttpMethod;
|
||||
|
||||
/**
|
||||
* Utility class for CORS request handling based on the
|
||||
* <a href="http://www.w3.org/TR/cors/">CORS W3C recommandation</a>.
|
||||
* <a href="http://www.w3.org/TR/cors/">CORS W3C recommendation</a>.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 4.2
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -242,7 +242,7 @@ public class ServletRequestDataBinderTests {
|
||||
assertTrue("Doesn't contain tory", !pvs.contains("tory"));
|
||||
|
||||
PropertyValue[] ps = pvs.getPropertyValues();
|
||||
Map<String, String> m = new HashMap<String, String>();
|
||||
Map<String, String> m = new HashMap<>();
|
||||
m.put("forname", "Tony");
|
||||
m.put("surname", "Blair");
|
||||
m.put("age", "50");
|
||||
|
||||
@@ -301,7 +301,7 @@ public class WebRequestDataBinderTests {
|
||||
request.addParameter("test_age", "" + 50);
|
||||
|
||||
ServletRequestParameterPropertyValues pvs = new ServletRequestParameterPropertyValues(request);
|
||||
assertTrue("Didn't fidn normal when given prefix", !pvs.contains("forname"));
|
||||
assertTrue("Didn't find normal when given prefix", !pvs.contains("forname"));
|
||||
assertTrue("Did treat prefix as normal when not given prefix", pvs.contains("test_forname"));
|
||||
|
||||
pvs = new ServletRequestParameterPropertyValues(request, "test");
|
||||
@@ -319,7 +319,7 @@ public class WebRequestDataBinderTests {
|
||||
assertTrue("Doesn't contain tory", !pvs.contains("tory"));
|
||||
|
||||
PropertyValue[] pvArray = pvs.getPropertyValues();
|
||||
Map<String, String> m = new HashMap<String, String>();
|
||||
Map<String, String> m = new HashMap<>();
|
||||
m.put("forname", "Tony");
|
||||
m.put("surname", "Blair");
|
||||
m.put("age", "50");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -92,7 +92,7 @@ public class HtmlCharacterEntityReferencesTests {
|
||||
|
||||
private Map<Integer, String> getReferenceCharacterMap() {
|
||||
CharacterEntityResourceIterator entityIterator = new CharacterEntityResourceIterator();
|
||||
Map<Integer, String> referencedCharactersMap = new HashMap<Integer, String>();
|
||||
Map<Integer, String> referencedCharactersMap = new HashMap<>();
|
||||
while (entityIterator.hasNext()) {
|
||||
int character = entityIterator.getReferredCharacter();
|
||||
String entityName = entityIterator.nextEntry();
|
||||
@@ -156,7 +156,7 @@ public class HtmlCharacterEntityReferencesTests {
|
||||
return false;
|
||||
}
|
||||
catch (IOException ex) {
|
||||
throw new IllegalStateException("Could not parse defintion resource: " + ex.getMessage());
|
||||
throw new IllegalStateException("Could not parse definition resource: " + ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<!-- We are only using one definition file for the purposes of this test, since we do not have multiple
|
||||
classloaders available in the environment to allow combining multiple files of the same name, but
|
||||
of course the contents within could be spread out across multiple files of the same name withing
|
||||
of course the contents within could be spread out across multiple files of the same name within
|
||||
different jars -->
|
||||
|
||||
<beans>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 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.
|
||||
@@ -25,7 +25,7 @@ import org.springframework.web.socket.sockjs.transport.SockJsServiceConfig;
|
||||
import org.springframework.web.socket.sockjs.transport.TransportHandler;
|
||||
|
||||
/**
|
||||
* Common base class for {@link TransportHandler} inplementations.
|
||||
* Common base class for {@link TransportHandler} implementations.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.0
|
||||
|
||||
@@ -42,14 +42,14 @@ import org.springframework.transaction.interceptor.TransactionInterceptor;
|
||||
|
||||
/**
|
||||
* Integration tests for auto proxy creation by advisor recognition working in
|
||||
* conjunction with transaction managment resources.
|
||||
* conjunction with transaction management resources.
|
||||
*
|
||||
* @see org.springframework.aop.framework.autoproxy.AdvisorAutoProxyCreatorTests
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Chris Beams
|
||||
*/
|
||||
public final class AdvisorAutoProxyCreatorIntegrationTests {
|
||||
public class AdvisorAutoProxyCreatorIntegrationTests {
|
||||
|
||||
private static final Class<?> CLASS = AdvisorAutoProxyCreatorIntegrationTests.class;
|
||||
private static final String CLASSNAME = CLASS.getSimpleName();
|
||||
|
||||
Reference in New Issue
Block a user