Skip to content

Commit

Permalink
Merge pull request #2019 from Hanope
Browse files Browse the repository at this point in the history
* pr/2019:
  Polish contribution
  Fix typos
  • Loading branch information
snicoll committed Nov 19, 2018
2 parents 729ce41 + 7b6f2f8 commit afa38f5
Show file tree
Hide file tree
Showing 74 changed files with 168 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public interface MethodInvocation extends Invocation {

/**
* Get the method being called.
* <p>This method is a frienly implementation of the
* <p>This method is a friendly implementation of the
* {@link Joinpoint#getStaticPart()} method (same result).
* @return the method being called
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedenceInformation, Serializable {

/**
* Key used in ReflectiveMethodInvocation userAtributes map for the current joinpoint.
* Key used in ReflectiveMethodInvocation userAttributes map for the current joinpoint.
*/
protected static final String JOIN_POINT_KEY = JoinPoint.class.getName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ public void setAge(int a) {}

@Around(value="setAge(age)",argNames="age")
// @ArgNames({"age"}) // AMC needs more work here? ignoring pjp arg... ok??
// argNames should be suported in Around as it is in Pointcut
// argNames should be supported in Around as it is in Pointcut
public void changeReturnType(ProceedingJoinPoint pjp, int age) throws Throwable {
pjp.proceed(new Object[] {age*2});
}
Expand Down Expand Up @@ -884,12 +884,12 @@ public int preventExecution(ProceedingJoinPoint pjp) {
@Aspect
abstract class AbstractMakeModifiable {

public interface MutableModifable extends Modifiable {
public interface MutableModifiable extends Modifiable {

void markDirty();
}

public static class ModifiableImpl implements MutableModifable {
public static class ModifiableImpl implements MutableModifiable {

private boolean modified;

Expand All @@ -911,7 +911,7 @@ public void markDirty() {

@Before(value="execution(void set*(*)) && this(modifiable) && args(newValue)", argNames="modifiable,newValue")
public void recordModificationIfSetterArgumentDiffersFromOldValue(
JoinPoint jp, MutableModifable mixin, Object newValue) {
JoinPoint jp, MutableModifiable mixin, Object newValue) {

/*
* We use the mixin to check and, if necessary, change,
Expand Down Expand Up @@ -972,7 +972,7 @@ class MakeITestBeanModifiable extends AbstractMakeModifiable {

@DeclareParents(value = "org.springframework.tests.sample.beans.ITestBean+",
defaultImpl=ModifiableImpl.class)
public static MutableModifable mixin;
public static MutableModifiable mixin;

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 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.
Expand Down Expand Up @@ -157,7 +157,7 @@ public long getTimeStamp() {
TimeStamped ts = (TimeStamped) pf.getProxy();

assertThat(ts, instanceOf(TimeStamped.class));
// Shoulnd't proxy framework interfaces
// Shouldn't proxy framework interfaces
assertTrue(!(ts instanceof MethodInterceptor));
assertTrue(!(ts instanceof IntroductionInterceptor));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ protected void setIntrospectionClass(Class<?> clazz) {
}

/**
* Obtain a lazily initializted CachedIntrospectionResults instance
* Obtain a lazily initialized CachedIntrospectionResults instance
* for the wrapped object.
*/
private CachedIntrospectionResults getCachedIntrospectionResults() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public static Object resolveAutowiringValue(Object autowiringValue, Class<?> req
* on the given method itself.
* <p>For example, given a factory method with the following signature, if
* {@code resolveReturnTypeForFactoryMethod()} is invoked with the reflected
* method for {@code creatProxy()} and an {@code Object[]} array containing
* method for {@code createProxy()} and an {@code Object[]} array containing
* {@code MyService.class}, {@code resolveReturnTypeForFactoryMethod()} will
* infer that the target return type is {@code MyService}.
* <pre class="code">{@code public static <T> T createProxy(Class<T> clazz)}</pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public BeanDefinitionBuilder setAutowireMode(int autowireMode) {
}

/**
* Set the depency check mode for this definition.
* Set the dependency check mode for this definition.
*/
public BeanDefinitionBuilder setDependencyCheck(int dependencyCheck) {
this.beanDefinition.setDependencyCheck(dependencyCheck);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class BeanDefinitionResource extends AbstractResource {

/**
* Create a new BeanDefinitionResource.
* @param beanDefinition the BeanDefinition objectto wrap
* @param beanDefinition the BeanDefinition object to wrap
*/
public BeanDefinitionResource(BeanDefinition beanDefinition) {
Assert.notNull(beanDefinition, "BeanDefinition must not be null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void setValidAndInvalidPropertyValuesShouldContainExceptionDetails() {
catch (PropertyBatchUpdateException ex) {
assertTrue("Must contain 2 exceptions", ex.getExceptionCount() == 2);
// Test validly set property matches
assertTrue("Vaid set property must stick", target.getName().equals(newName));
assertTrue("Valid set property must stick", target.getName().equals(newName));
assertTrue("Invalid set property must retain old value", target.getAge() == 0);
assertTrue("New value of dodgy setter must be available through exception",
ex.getPropertyAccessException("touchy").getPropertyChangeEvent().getNewValue().equals(invalidTouchy));
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -58,7 +58,7 @@ public void allWhitespace() {
}

@Test
public void simpleGoodAddess() {
public void simpleGoodAddress() {
editor.setAsText(SIMPLE);
assertEquals("Simple email address failed", SIMPLE, editor.getAsText());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 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.
Expand Down Expand Up @@ -38,7 +38,7 @@ public interface MessageSourceAware extends Aware {
* <p>Invoked after population of normal bean properties but before an init
* callback like InitializingBean's afterPropertiesSet or a custom init-method.
* Invoked before ApplicationContextAware's setApplicationContext.
* @param messageSource message sourceto be used by this object
* @param messageSource message source to be used by this object
*/
void setMessageSource(MessageSource messageSource);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
* last.
*
* <p>In certain situations, it may not be possible or practical to tightly control
* property source ordering when using {@code @ProperySource} annotations. For example,
* property source ordering when using {@code @PropertySource} annotations. For example,
* if the {@code @Configuration} classes above were registered via component-scanning,
* the ordering is difficult to predict. In such cases - and if overriding is important -
* it is recommended that the user fall back to using the programmatic PropertySource API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ protected boolean isHomeRefreshable() {


/**
* Prepares the thread context if necessar, and delegates to
* Prepares the thread context if necessary, and delegates to
* {@link #invokeInContext}.
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 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.
Expand All @@ -23,7 +23,7 @@
* accessed by application developers during application runtime.
*
* <p>This interface should be used to export application resources to JMX using Spring's
* management interface generation capabilties and, optionally, it's {@link ObjectName}
* management interface generation capabilities and, optionally, it's {@link ObjectName}
* generation capabilities.
*
* @author Rob Harrop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ public void unregisterManagedResource(ObjectName objectName) {
/**
* Register the defined beans with the {@link MBeanServer}.
* <p>Each bean is exposed to the {@code MBeanServer} via a
* {@code ModelMBean}. The actual implemetation of the
* {@code ModelMBean}. The actual implementation of the
* {@code ModelMBean} interface used depends on the implementation of
* the {@code ModelMBeanProvider} interface that is configured. By
* default the {@code RequiredModelMBean} class that is supplied with
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -84,7 +84,7 @@ public void setManagedMethods(String... methodNames) {
* The property key should match the bean key and the property value should match
* the list of method names. When searching for method names for a bean, Spring
* will check these mappings first.
* @param mappings the mappins of bean keys to method names
* @param mappings the mappings of bean keys to method names
*/
public void setMethodMappings(Properties mappings) {
this.methodMappings = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -27,7 +27,7 @@
* implementing the {@link NotificationPublisherAware} interface. After a particular
* managed resource instance is registered with the {@link javax.management.MBeanServer},
* Spring will inject a {@code NotificationPublisher} instance into it if that
* resource implements the {@link NotificationPublisherAware} inteface.
* resource implements the {@link NotificationPublisherAware} interface.
*
* <p>Each managed resource instance will have a distinct instance of a
* {@code NotificationPublisher} implementation. This instance will keep
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -103,7 +103,7 @@ public void afterPropertiesSet() throws IllegalArgumentException, NamingExceptio
* Perform the actual JNDI lookup for this locator's target resource.
* @return the located target object
* @throws NamingException if the JNDI lookup failed or if the
* located JNDI object is not assigable to the expected type
* located JNDI object is not assignable to the expected type
* @see #setJndiName
* @see #setExpectedType
* @see #lookup(String, Class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void testNoMatchingWithoutAnnotationPresent() {
}

@Test
public void testPointcutEvaulatedAgainstArray() {
public void testPointcutEvaluatedAgainstArray() {
ctx.getBean("arrayFactoryBean");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public void testTargetCanGetProxy() {
assertEquals("Only one invocation via AOP as use of this wasn't proxied", 1, di.getCount());
// 1 invocation
assertEquals("Increment happened", 1, proxied.getCount());
proxied.incrementViaProxy(); // 2 invoocations
proxied.incrementViaProxy(); // 2 invocations
assertEquals("Increment happened", 2, target.getCount());
assertEquals("3 more invocations via AOP as the first call was reentrant through the proxy", 4, di.getCount());
}
Expand Down Expand Up @@ -511,7 +511,7 @@ public Object invoke(MethodInvocation invocation) throws Throwable {
}

@Test
public void testUndeclaredUnheckedException() throws Throwable {
public void testUndeclaredUncheckedException() throws Throwable {
final RuntimeException unexpectedException = new RuntimeException();
// Test return value
MethodInterceptor mi = new MethodInterceptor() {
Expand Down Expand Up @@ -786,7 +786,7 @@ public void testCannotAddIntroductionAdviceWithUnimplementedInterface() throws T

/**
* Note that an introduction can't throw an unexpected checked exception,
* as it's constained by the interface.
* as it's constrained by the interface.
*/
@Test
public void testIntroductionThrowsUncheckedException() throws Throwable {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -161,7 +161,7 @@ public void testHitMaxSize() throws Exception {
// desired
}

// lets now release an object and try to accquire a new one
// lets now release an object and try to acquire a new one
targetSource.releaseTarget(pooledInstances[9]);
pooledInstances[9] = targetSource.getTarget();

Expand Down Expand Up @@ -194,7 +194,7 @@ public void testHitMaxSizeLoadedFromContext() throws Exception {
// desired
}

// lets now release an object and try to accquire a new one
// lets now release an object and try to acquire a new one
targetSource.releaseTarget(pooledInstances[9]);
pooledInstances[9] = targetSource.getTarget();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 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.
Expand Down Expand Up @@ -41,7 +41,7 @@ public void setBeanFactory(BeanFactory beanFactory) {
public void afterPropertiesSet() {
super.afterPropertiesSet();
if (this.owningContext == null)
throw new RuntimeException("Factory didn't call setAppliationContext before afterPropertiesSet on lifecycle bean");
throw new RuntimeException("Factory didn't call setApplicationContext before afterPropertiesSet on lifecycle bean");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -33,7 +33,7 @@ public class ComponentScanAnnotationTests {

@Test
public void noop() {
// no-op; the @ComponentScan-annotated MyConfig class below simply excercises
// no-op; the @ComponentScan-annotated MyConfig class below simply exercises
// available attributes of the annotation.
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void registerUnregisterSingleContext() throws MalformedObjectNameExceptio
}

@Test
public void registerUnregisterServeralContexts() throws MalformedObjectNameException {
public void registerUnregisterSeveralContexts() throws MalformedObjectNameException {
this.environment.setProperty(LiveBeansView.MBEAN_DOMAIN_PROPERTY_NAME, this.name.getMethodName());
ConfigurableApplicationContext context = createApplicationContext("app");
ConfigurableApplicationContext childContext = createApplicationContext("child");
Expand All @@ -80,7 +80,7 @@ public void registerUnregisterServeralContexts() throws MalformedObjectNameExcep
}

@Test
public void registerUnregisterServeralContextsDifferentOrder() throws MalformedObjectNameException {
public void registerUnregisterSeveralContextsDifferentOrder() throws MalformedObjectNameException {
this.environment.setProperty(LiveBeansView.MBEAN_DOMAIN_PROPERTY_NAME, this.name.getMethodName());
ConfigurableApplicationContext context = createApplicationContext("app");
ConfigurableApplicationContext childContext = createApplicationContext("child");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 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.
Expand Down Expand Up @@ -127,7 +127,7 @@ private InterfaceBasedMBeanInfoAssembler getWithMapping(String name, String mapp
private void assertNickName(MBeanAttributeInfo attr) {
assertNotNull("Nick Name should not be null", attr);
assertTrue("Nick Name should be writable", attr.isWritable());
assertTrue("Nick Name should be readab;e", attr.isReadable());
assertTrue("Nick Name should be readable", attr.isReadable());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public void getMergedAnnotationAttributesFavorsInheritedComposedAnnotationsOverM
Class<?> element = SubSubClassWithInheritedComposedAnnotation.class;
String name = TX_NAME;
AnnotationAttributes attributes = getMergedAnnotationAttributes(element, name);
assertNotNull("AnnotationAttributtes for @Transactional on SubSubClassWithInheritedComposedAnnotation.", attributes);
assertNotNull("AnnotationAttributes for @Transactional on SubSubClassWithInheritedComposedAnnotation.", attributes);
// Verify contracts between utility methods:
assertTrue(isAnnotated(element, name));
assertFalse("readOnly flag for SubSubClassWithInheritedComposedAnnotation.", attributes.getBoolean("readOnly"));
Expand Down
Loading

0 comments on commit afa38f5

Please sign in to comment.