language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/QuickTargetSourceCreator.java | @@ -23,7 +23,7 @@
/**
* Convenient TargetSourceCreator using bean name prefixes to create one of three
- * well-known TargetSource types:
+ * well-known TargetSource types:
* <li>: CommonsPoolTargetSource
* <li>% ThreadLocalTargetSource
* <li>! PrototypeTargetSource
@@ -59,5 +59,5 @@ else if (beanName.startsWith(PREFIX_PROTOTYPE)) {
return null;
}
}
-
+
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/framework/package-info.java | @@ -3,13 +3,13 @@
*
* Package containing Spring's basic AOP infrastructure, compliant with the
* <a href="http://aopalliance.sourceforge.net">AOP Alliance</a> interfaces.
- *
+ *
* <p>Spring AOP supports proxying interfaces or classes, introductions, and offers
* static and dynamic pointcuts.
- *
+ *
* <p>Any Spring AOP proxy can be cast to the ProxyConfig AOP configuration interface
* in this package to add or remove interceptors.
- *
+ *
* <p>The ProxyFactoryBean is a convenient way to create AOP proxies in a BeanFactory
* or ApplicationContext. However, proxies can be created programmatically using the
* ProxyFactory class. | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractMonitoringInterceptor.java | @@ -28,7 +28,7 @@
* <p>Subclasses should call the <code>createInvocationTraceName(MethodInvocation)</code>
* method to create a name for the given trace that includes information about the
* method invocation under trace along with the prefix and suffix added as appropriate.
- *
+ *
* @author Rob Harrop
* @author Juergen Hoeller
* @since 1.2.7 | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/interceptor/ConcurrencyThrottleInterceptor.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeBeanNameAdvisors.java | @@ -125,7 +125,7 @@ public Object invoke(MethodInvocation mi) throws Throwable {
*/
private static class ExposeBeanNameIntroduction extends DelegatingIntroductionInterceptor implements NamedBean {
- private final String beanName;
+ private final String beanName;
public ExposeBeanNameIntroduction(String beanName) {
this.beanName = beanName; | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/interceptor/JamonPerformanceMonitorInterceptor.java | @@ -27,7 +27,7 @@
* and output the stats.
*
* <p>This code is inspired by Thierry Templier's blog.
- *
+ *
* @author Dmitriy Kopylenko
* @author Juergen Hoeller
* @author Rob Harrop | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/package-info.java | @@ -2,9 +2,9 @@
/**
*
* Core Spring AOP interfaces, built on AOP Alliance AOP interoperability interfaces.
- *
+ *
* <br>Any AOP Alliance MethodInterceptor is usable in Spring.
- *
+ *
* <br>Spring AOP also offers:
* <ul>
* <li>Introduction support
@@ -15,7 +15,7 @@
* <li>Extensibility allowing arbitrary custom advice types to
* be plugged in without modifying the core framework.
* </ul>
- *
+ *
* <br>
* Spring AOP can be used programmatically or (preferably)
* integrated with the Spring IoC container. | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/scope/DefaultScopedObject.java | @@ -23,7 +23,7 @@
/**
* Default implementation of the {@link ScopedObject} interface.
- *
+ *
* <p>Simply delegates the calls to the underlying
* {@link ConfigurableBeanFactory bean factory}
* ({@link ConfigurableBeanFactory#getBean(String)}/ | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/scope/ScopedObject.java | @@ -49,5 +49,5 @@ public interface ScopedObject extends RawTargetAccess {
* the exact same target object in the target scope).
*/
void removeFromScope();
-
+
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyFactoryBean.java | @@ -32,14 +32,14 @@
/**
* Convenient proxy factory bean for scoped objects.
- *
+ *
* <p>Proxies created using this factory bean are thread-safe singletons
* and may be injected into shared objects, with transparent scoping behavior.
*
* <p>Proxies returned by this class implement the {@link ScopedObject} interface.
* This presently allows for removing the corresponding object from the scope,
* seamlessly creating a new instance in the scope on next access.
- *
+ *
* <p>Please note that the proxies created by this factory are
* <i>class-based</i> proxies by default. This can be customized
* through switching the "proxyTargetClass" property to "false". | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java | @@ -47,7 +47,7 @@ public abstract class ScopedProxyUtils {
*/
public static BeanDefinitionHolder createScopedProxy(BeanDefinitionHolder definition,
BeanDefinitionRegistry registry, boolean proxyTargetClass) {
-
+
String originalBeanName = definition.getBeanName();
BeanDefinition targetDefinition = definition.getBeanDefinition();
@@ -87,7 +87,7 @@ public static BeanDefinitionHolder createScopedProxy(BeanDefinitionHolder defini
// (potentially an inner bean).
return new BeanDefinitionHolder(proxyDefinition, originalBeanName, definition.getAliases());
}
-
+
/**
* Generates the bean name that is used within the scoped proxy to reference the target bean.
* @param originalBeanName the original name of bean | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java | @@ -42,7 +42,7 @@
public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFilter, Ordered, Serializable {
private final Advice advice;
-
+
private final Set<Class> interfaces = new HashSet<Class>();
private int order = Integer.MAX_VALUE; | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/support/DefaultPointcutAdvisor.java | @@ -46,7 +46,7 @@ public class DefaultPointcutAdvisor extends AbstractGenericPointcutAdvisor imple
*/
public DefaultPointcutAdvisor() {
}
-
+
/**
* Create a DefaultPointcutAdvisor that matches all methods.
* <p><code>Pointcut.TRUE</code> will be used as Pointcut.
@@ -55,7 +55,7 @@ public DefaultPointcutAdvisor() {
public DefaultPointcutAdvisor(Advice advice) {
this(Pointcut.TRUE, advice);
}
-
+
/**
* Create a DefaultPointcutAdvisor, specifying Pointcut and Advice.
* @param pointcut the Pointcut targeting the Advice | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/support/DelegatePerTargetObjectIntroductionInterceptor.java | @@ -53,7 +53,7 @@
public class DelegatePerTargetObjectIntroductionInterceptor extends IntroductionInfoSupport
implements IntroductionInterceptor {
- /**
+ /**
* Hold weak references to keys as we don't want to interfere with garbage collection..
*/
private final Map<Object, Object> delegateMap = new WeakHashMap<Object, Object>();
@@ -85,12 +85,12 @@ public DelegatePerTargetObjectIntroductionInterceptor(Class defaultImplType, Cla
public Object invoke(MethodInvocation mi) throws Throwable {
if (isMethodOnIntroducedInterface(mi)) {
Object delegate = getIntroductionDelegateFor(mi.getThis());
-
+
// Using the following method rather than direct reflection,
// we get correct handling of InvocationTargetException
// if the introduced method throws an exception.
Object retVal = AopUtils.invokeJoinpointUsingReflection(delegate, mi.getMethod(), mi.getArguments());
-
+
// Massage return value if possible: if the delegate returned itself,
// we really want to return the proxy.
if (retVal == delegate && mi instanceof ProxyMethodInvocation) {
@@ -126,7 +126,7 @@ private Object getIntroductionDelegateFor(Object targetObject) {
}
}
}
-
+
private Object createNewDelegate() {
try {
return this.defaultImplType.newInstance(); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/support/DelegatingIntroductionInterceptor.java | @@ -39,7 +39,7 @@
* <p>The <code>suppressInterface</code> method can be used to suppress interfaces
* implemented by the delegate but which should not be introduced to the owning
* AOP proxy.
- *
+ *
* <p>An instance of this class is serializable if the delegate is.
*
* @author Rod Johnson
@@ -50,7 +50,7 @@
*/
public class DelegatingIntroductionInterceptor extends IntroductionInfoSupport
implements IntroductionInterceptor {
-
+
/**
* Object that actually implements the interfaces.
* May be "this" if a subclass implements the introduced interfaces.
@@ -66,7 +66,7 @@ public class DelegatingIntroductionInterceptor extends IntroductionInfoSupport
public DelegatingIntroductionInterceptor(Object delegate) {
init(delegate);
}
-
+
/**
* Construct a new DelegatingIntroductionInterceptor.
* The delegate will be the subclass, which must implement
@@ -91,8 +91,8 @@ private void init(Object delegate) {
suppressInterface(IntroductionInterceptor.class);
suppressInterface(DynamicIntroductionAdvice.class);
}
-
-
+
+
/**
* Subclasses may need to override this if they want to perform custom
* behaviour in around advice. However, subclasses should invoke this
@@ -104,7 +104,7 @@ public Object invoke(MethodInvocation mi) throws Throwable {
// get correct handling of InvocationTargetException
// if the introduced method throws an exception.
Object retVal = AopUtils.invokeJoinpointUsingReflection(this.delegate, mi.getMethod(), mi.getArguments());
-
+
// Massage return value if possible: if the delegate returned itself,
// we really want to return the proxy.
if (retVal == this.delegate && mi instanceof ProxyMethodInvocation) { | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcher.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcherPointcut.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/support/JdkRegexpMethodPointcut.java | @@ -38,13 +38,13 @@
* @since 1.1
*/
public class JdkRegexpMethodPointcut extends AbstractRegexpMethodPointcut {
-
- /**
+
+ /**
* Compiled form of the patterns.
*/
private Pattern[] compiledPatterns = new Pattern[0];
- /**
+ /**
* Compiled form of the exclusion patterns.
*/
private Pattern[] compiledExclusionPatterns = new Pattern[0]; | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/support/RootClassFilter.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,11 +25,11 @@
* @author Rod Johnson
*/
public class RootClassFilter implements ClassFilter, Serializable {
-
+
private Class clazz;
-
+
// TODO inheritance
-
+
public RootClassFilter(Class clazz) {
this.clazz = clazz;
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcher.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,7 +22,7 @@
/**
* Convenient abstract superclass for static method matchers, which don't care
- * about arguments at runtime.
+ * about arguments at runtime.
*/
public abstract class StaticMethodMatcher implements MethodMatcher {
| true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java | @@ -90,15 +90,15 @@ public final void setBeanFactory(BeanFactory beanFactory) throws BeansException
* @throws Exception to avoid placing constraints on pooling APIs
*/
protected abstract void createPool() throws Exception;
-
+
/**
* Acquire an object from the pool.
* @return an object from the pool
* @throws Exception we may need to deal with checked exceptions from pool
* APIs, so we're forgiving with our exception signature
*/
public abstract Object getTarget() throws Exception;
-
+
/**
* Return the given object to the pool.
* @param target object that must have been acquired from the pool | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/target/CommonsPoolTargetSource.java | @@ -41,7 +41,7 @@
* properties are explictly not mirrored because the implementation of
* <code>PoolableObjectFactory</code> used by this class does not implement
* meaningful validation. All exposed Commons Pool properties use the corresponding
- * Commons Pool defaults: for example,
+ * Commons Pool defaults: for example,
*
* @author Rod Johnson
* @author Rob Harrop | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/target/PoolingConfig.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/target/SingletonTargetSource.java | @@ -58,11 +58,11 @@ public SingletonTargetSource(Object target) {
public Class<?> getTargetClass() {
return this.target.getClass();
}
-
+
public Object getTarget() {
return this.target;
}
-
+
public void releaseTarget(Object target) {
// nothing to do
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/target/ThreadLocalTargetSource.java | @@ -49,7 +49,7 @@
*/
public class ThreadLocalTargetSource extends AbstractPrototypeBasedTargetSource
implements ThreadLocalTargetSourceStats, DisposableBean {
-
+
/**
* ThreadLocal holding the target associated with the current
* thread. Unlike most ThreadLocals, which are static, this variable
@@ -62,9 +62,9 @@ public class ThreadLocalTargetSource extends AbstractPrototypeBasedTargetSource
* Set of managed targets, enabling us to keep track of the targets we've created.
*/
private final Set<Object> targetSet = new HashSet<Object>();
-
+
private int invocationCount;
-
+
private int hitCount;
@@ -93,7 +93,7 @@ public Object getTarget() throws BeansException {
}
return target;
}
-
+
/**
* Dispose of targets if necessary; clear ThreadLocal.
* @see #destroyPrototypeInstance | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/target/ThreadLocalTargetSourceStats.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,7 +23,7 @@
* @author Juergen Hoeller
*/
public interface ThreadLocalTargetSourceStats {
-
+
/**
* Return the number of client invocations.
*/ | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/main/java/org/springframework/aop/target/dynamic/Refreshable.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2006 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverAnnotationTests.java | @@ -36,7 +36,7 @@
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation {}
-
+
public void pjpAndAnAnnotation(ProceedingJoinPoint pjp, MyAnnotation ann) {}
@Test | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscovererTests.java | @@ -247,7 +247,7 @@ public void testReferenceBinding() {
public void testReferenceBindingWithAlternateTokenizations() {
assertParameterNames(getMethod("onePrimitive"),"call(bar *) && somepc(foo)",new String[] {"foo"});
assertParameterNames(getMethod("onePrimitive"),"somepc ( foo )",new String[] {"foo"});
- assertParameterNames(getMethod("onePrimitive"),"somepc( foo)",new String[] {"foo"});
+ assertParameterNames(getMethod("onePrimitive"),"somepc( foo)",new String[] {"foo"});
}
| true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -44,7 +44,7 @@
* @author Chris Beams
*/
public final class AspectJExpressionPointcutTests {
-
+
public static final String MATCH_ALL_METHODS = "execution(* *(..))";
private Method getAge;
@@ -54,16 +54,16 @@ public final class AspectJExpressionPointcutTests {
private Method setSomeNumber;
private Method isPostProcessed;
-
-
+
+
@Before
public void setUp() throws NoSuchMethodException {
getAge = TestBean.class.getMethod("getAge", (Class<?>[])null);
setAge = TestBean.class.getMethod("setAge", new Class[]{int.class});
setSomeNumber = TestBean.class.getMethod("setSomeNumber", new Class[]{Number.class});
isPostProcessed = TestBean.class.getMethod("isPostProcessed", (Class[]) null);
}
-
+
@Test
public void testMatchExplicit() {
String expression = "execution(int test.beans.TestBean.getAge())";
@@ -100,60 +100,60 @@ public void testMatchWithTypePattern() throws Exception {
assertTrue("Expression should match setAge(int) method", methodMatcher.matches(setAge, TestBean.class));
}
-
+
@Test
public void testThis() throws SecurityException, NoSuchMethodException{
testThisOrTarget("this");
}
-
+
@Test
public void testTarget() throws SecurityException, NoSuchMethodException {
testThisOrTarget("target");
}
-
+
public static class OtherIOther implements IOther {
public void absquatulate() {
// Empty
}
-
+
}
-
+
/**
* This and target are equivalent. Really instanceof pointcuts.
* @throws Exception
* @param which this or target
- * @throws NoSuchMethodException
- * @throws SecurityException
+ * @throws NoSuchMethodException
+ * @throws SecurityException
*/
private void testThisOrTarget(String which) throws SecurityException, NoSuchMethodException {
String matchesTestBean = which + "(test.beans.TestBean)";
String matchesIOther = which + "(test.beans.IOther)";
AspectJExpressionPointcut testBeanPc = new AspectJExpressionPointcut();
testBeanPc.setExpression(matchesTestBean);
-
+
AspectJExpressionPointcut iOtherPc = new AspectJExpressionPointcut();
iOtherPc.setExpression(matchesIOther);
-
+
assertTrue(testBeanPc.matches(TestBean.class));
assertTrue(testBeanPc.matches(getAge, TestBean.class));
assertTrue(iOtherPc.matches(OtherIOther.class.getMethod("absquatulate", (Class<?>[])null),
OtherIOther.class));
-
+
assertFalse(testBeanPc.matches(OtherIOther.class.getMethod("absquatulate", (Class<?>[])null),
OtherIOther.class));
}
-
+
@Test
public void testWithinRootPackage() throws SecurityException, NoSuchMethodException {
testWithinPackage(false);
}
-
+
@Test
public void testWithinRootAndSubpackages() throws SecurityException, NoSuchMethodException {
testWithinPackage(true);
}
-
+
private void testWithinPackage(boolean matchSubpackages) throws SecurityException, NoSuchMethodException {
String withinBeansPackage = "within(test.beans.";
// Subpackages are matched by **
@@ -163,7 +163,7 @@ private void testWithinPackage(boolean matchSubpackages) throws SecurityExceptio
withinBeansPackage = withinBeansPackage + "*)";
AspectJExpressionPointcut withinBeansPc = new AspectJExpressionPointcut();
withinBeansPc.setExpression(withinBeansPackage);
-
+
assertTrue(withinBeansPc.matches(TestBean.class));
assertTrue(withinBeansPc.matches(getAge, TestBean.class));
assertEquals(matchSubpackages, withinBeansPc.matches(DeepBean.class));
@@ -173,7 +173,7 @@ private void testWithinPackage(boolean matchSubpackages) throws SecurityExceptio
assertFalse(withinBeansPc.matches(OtherIOther.class.getMethod("absquatulate", (Class<?>[])null),
OtherIOther.class));
}
-
+
@Test
public void testFriendlyErrorOnNoLocationClassMatching() {
AspectJExpressionPointcut pc = new AspectJExpressionPointcut();
@@ -185,7 +185,7 @@ public void testFriendlyErrorOnNoLocationClassMatching() {
assertTrue(ex.getMessage().indexOf("expression") != -1);
}
}
-
+
@Test
public void testFriendlyErrorOnNoLocation2ArgMatching() {
AspectJExpressionPointcut pc = new AspectJExpressionPointcut();
@@ -197,7 +197,7 @@ public void testFriendlyErrorOnNoLocation2ArgMatching() {
assertTrue(ex.getMessage().indexOf("expression") != -1);
}
}
-
+
@Test
public void testFriendlyErrorOnNoLocation3ArgMatching() {
AspectJExpressionPointcut pc = new AspectJExpressionPointcut();
@@ -210,7 +210,7 @@ public void testFriendlyErrorOnNoLocation3ArgMatching() {
}
}
-
+
@Test
public void testMatchWithArgs() throws Exception {
String expression = "execution(void test.beans.TestBean.setSomeNumber(Number)) && args(Double)";
@@ -329,19 +329,19 @@ public void testWithUnsupportedPointcutPrimitive() throws Exception {
@Test
public void testAndSubstitution() {
Pointcut pc = getPointcut("execution(* *(..)) and args(String)");
- PointcutExpression expr =
+ PointcutExpression expr =
((AspectJExpressionPointcut) pc).getPointcutExpression();
assertEquals("execution(* *(..)) && args(String)",expr.getPointcutExpression());
}
-
+
@Test
public void testMultipleAndSubstitutions() {
Pointcut pc = getPointcut("execution(* *(..)) and args(String) and this(Object)");
- PointcutExpression expr =
+ PointcutExpression expr =
((AspectJExpressionPointcut) pc).getPointcutExpression();
- assertEquals("execution(* *(..)) && args(String) && this(Object)",expr.getPointcutExpression());
+ assertEquals("execution(* *(..)) && args(String) && this(Object)",expr.getPointcutExpression());
}
-
+
private Pointcut getPointcut(String expression) {
AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();
pointcut.setExpression(expression); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/BeanNamePointcutMatchingTests.java | @@ -34,8 +34,8 @@ public final class BeanNamePointcutMatchingTests {
public void testMatchingPointcuts() {
assertMatch("someName", "bean(someName)");
- // Spring bean names are less restrictive compared to AspectJ names (methods, types etc.)
- // MVC Controller-kind
+ // Spring bean names are less restrictive compared to AspectJ names (methods, types etc.)
+ // MVC Controller-kind
assertMatch("someName/someOtherName", "bean(someName/someOtherName)");
assertMatch("someName/foo/someOtherName", "bean(someName/*/someOtherName)");
assertMatch("someName/foo/bar/someOtherName", "bean(someName/*/someOtherName)");
@@ -58,9 +58,9 @@ public void testMatchingPointcuts() {
// Or, and, not expressions
assertMatch("someName", "bean(someName) || bean(someOtherName)");
assertMatch("someOtherName", "bean(someName) || bean(someOtherName)");
-
+
assertMatch("someName", "!bean(someOtherName)");
-
+
assertMatch("someName", "bean(someName) || !bean(someOtherName)");
assertMatch("someName", "bean(someName) && !bean(someOtherName)");
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPointTests.java | @@ -72,31 +72,31 @@ public void testCanGetMethodSignatureFromJoinPoint() {
final Object raw = new TestBean();
// Will be set by advice during a method call
final int newAge = 23;
-
+
ProxyFactory pf = new ProxyFactory(raw);
pf.setExposeProxy(true);
pf.addAdvisor(ExposeInvocationInterceptor.ADVISOR);
pf.addAdvice(new MethodBeforeAdvice() {
private int depth;
-
+
public void before(Method method, Object[] args, Object target) throws Throwable {
JoinPoint jp = AbstractAspectJAdvice.currentJoinPoint();
assertTrue("Method named in toString", jp.toString().contains(method.getName()));
// Ensure that these don't cause problems
jp.toShortString();
jp.toLongString();
-
+
assertSame(target, AbstractAspectJAdvice.currentJoinPoint().getTarget());
assertFalse(AopUtils.isAopProxy(AbstractAspectJAdvice.currentJoinPoint().getTarget()));
-
+
ITestBean thisProxy = (ITestBean) AbstractAspectJAdvice.currentJoinPoint().getThis();
assertTrue(AopUtils.isAopProxy(AbstractAspectJAdvice.currentJoinPoint().getThis()));
-
+
assertNotSame(target, thisProxy);
-
+
// Check getting again doesn't cause a problem
assertSame(thisProxy, AbstractAspectJAdvice.currentJoinPoint().getThis());
-
+
// Try reentrant call--will go through this advice.
// Be sure to increment depth to avoid infinite recursion
if (depth++ == 0) {
@@ -109,10 +109,10 @@ public void before(Method method, Object[] args, Object target) throws Throwable
assertSame(AopContext.currentProxy(), thisProxy);
assertSame(target, raw);
-
+
assertSame(method.getName(), AbstractAspectJAdvice.currentJoinPoint().getSignature().getName());
assertEquals(method.getModifiers(), AbstractAspectJAdvice.currentJoinPoint().getSignature().getModifiers());
-
+
MethodSignature msig = (MethodSignature) AbstractAspectJAdvice.currentJoinPoint().getSignature();
assertSame("Return same MethodSignature repeatedly", msig, AbstractAspectJAdvice.currentJoinPoint().getSignature());
assertSame("Return same JoinPoint repeatedly", AbstractAspectJAdvice.currentJoinPoint(), AbstractAspectJAdvice.currentJoinPoint());
@@ -146,7 +146,7 @@ public void before(Method method, Object[] args, Object target) throws Throwable
catch (UnsupportedOperationException ex) {
// Expected
}
-
+
try {
sloc.getFileName();
fail("Can't get file name");
@@ -191,7 +191,7 @@ public void before(Method method, Object[] args, Object target) throws Throwable
// it serves our purpose here
JoinPoint.StaticPart aspectJVersionJp = Factory.makeEncSJP(method);
JoinPoint jp = AbstractAspectJAdvice.currentJoinPoint();
-
+
assertEquals(aspectJVersionJp.getSignature().toLongString(), jp.getSignature().toLongString());
assertEquals(aspectJVersionJp.getSignature().toShortString(), jp.getSignature().toShortString());
assertEquals(aspectJVersionJp.getSignature().toString(), jp.getSignature().toString()); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/TigerAspectJAdviceParameterNameDiscovererTests.java | @@ -38,37 +38,37 @@ public void testAtThis() {
public void testAtTarget() {
assertParameterNames(getMethod("oneAnnotation"),"@target(a)",new String[]{"a"});
}
-
+
@Test
public void testAtArgs() {
assertParameterNames(getMethod("oneAnnotation"),"@args(a)",new String[]{"a"});
}
-
+
@Test
public void testAtWithin() {
assertParameterNames(getMethod("oneAnnotation"),"@within(a)",new String[]{"a"});
}
-
+
@Test
public void testAtWithincode() {
assertParameterNames(getMethod("oneAnnotation"),"@withincode(a)",new String[]{"a"});
}
-
+
@Test
public void testAtAnnotation() {
assertParameterNames(getMethod("oneAnnotation"),"@annotation(a)",new String[]{"a"});
}
-
+
@Test
public void testAmbiguousAnnotationTwoVars() {
assertException(getMethod("twoAnnotations"),"@annotation(a) && @this(x)",AmbiguousBindingException.class,
"Found 2 potential annotation variable(s), and 2 potential argument slots");
}
-
+
@Test
public void testAmbiguousAnnotationOneVar() {
assertException(getMethod("oneAnnotation"),"@annotation(a) && @this(x)",IllegalArgumentException.class,
- "Found 2 candidate annotation binding variables but only one potential argument binding slot");
+ "Found 2 candidate annotation binding variables but only one potential argument binding slot");
}
@Test | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/TigerAspectJExpressionPointcutTests.java | @@ -32,7 +32,7 @@
import test.beans.TestBean;
-/**
+/**
* Java5-specific {@link AspectJExpressionPointcutTests}.
*
* @author Rod Johnson
@@ -54,10 +54,10 @@ public void setUp() throws NoSuchMethodException {
methodsOnHasGeneric.put(m.getName(), m);
}
}
-
+
public static class HasGeneric {
-
+
public void setFriends(List<TestBean> friends) {
}
public void setEnemies(List<TestBean> enemies) {
@@ -73,114 +73,114 @@ public void testMatchGenericArgument() {
String expression = "execution(* set*(java.util.List<test.beans.TestBean>) )";
AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut();
ajexp.setExpression(expression);
-
+
// TODO this will currently map, would be nice for optimization
//assertTrue(ajexp.matches(HasGeneric.class));
//assertFalse(ajexp.matches(TestBean.class));
-
+
Method takesGenericList = methodsOnHasGeneric.get("setFriends");
assertTrue(ajexp.matches(takesGenericList, HasGeneric.class));
assertTrue(ajexp.matches(methodsOnHasGeneric.get("setEnemies"), HasGeneric.class));
assertFalse(ajexp.matches(methodsOnHasGeneric.get("setPartners"), HasGeneric.class));
assertFalse(ajexp.matches(methodsOnHasGeneric.get("setPhoneNumbers"), HasGeneric.class));
-
+
assertFalse(ajexp.matches(getAge, TestBean.class));
}
-
+
@Test
public void testMatchVarargs() throws SecurityException, NoSuchMethodException {
class MyTemplate {
public int queryForInt(String sql, Object... params) {
return 0;
}
}
-
+
String expression = "execution(int *.*(String, Object...))";
AspectJExpressionPointcut jdbcVarArgs = new AspectJExpressionPointcut();
jdbcVarArgs.setExpression(expression);
-
+
// TODO: the expression above no longer matches Object[]
// assertFalse(jdbcVarArgs.matches(
// JdbcTemplate.class.getMethod("queryForInt", String.class, Object[].class),
// JdbcTemplate.class));
-
+
assertTrue(jdbcVarArgs.matches(
MyTemplate.class.getMethod("queryForInt", String.class, Object[].class),
MyTemplate.class));
-
+
Method takesGenericList = methodsOnHasGeneric.get("setFriends");
assertFalse(jdbcVarArgs.matches(takesGenericList, HasGeneric.class));
assertFalse(jdbcVarArgs.matches(methodsOnHasGeneric.get("setEnemies"), HasGeneric.class));
assertFalse(jdbcVarArgs.matches(methodsOnHasGeneric.get("setPartners"), HasGeneric.class));
assertFalse(jdbcVarArgs.matches(methodsOnHasGeneric.get("setPhoneNumbers"), HasGeneric.class));
assertFalse(jdbcVarArgs.matches(getAge, TestBean.class));
}
-
+
@Test
public void testMatchAnnotationOnClassWithAtWithin() throws SecurityException, NoSuchMethodException {
String expression = "@within(test.annotation.transaction.Tx)";
testMatchAnnotationOnClass(expression);
}
-
+
@Test
public void testMatchAnnotationOnClassWithoutBinding() throws SecurityException, NoSuchMethodException {
String expression = "within(@test.annotation.transaction.Tx *)";
testMatchAnnotationOnClass(expression);
}
-
+
@Test
public void testMatchAnnotationOnClassWithSubpackageWildcard() throws SecurityException, NoSuchMethodException {
String expression = "within(@(test.annotation..*) *)";
AspectJExpressionPointcut springAnnotatedPc = testMatchAnnotationOnClass(expression);
- assertFalse(springAnnotatedPc.matches(TestBean.class.getMethod("setName", String.class),
+ assertFalse(springAnnotatedPc.matches(TestBean.class.getMethod("setName", String.class),
TestBean.class));
- assertTrue(springAnnotatedPc.matches(SpringAnnotated.class.getMethod("foo", (Class[]) null),
+ assertTrue(springAnnotatedPc.matches(SpringAnnotated.class.getMethod("foo", (Class[]) null),
SpringAnnotated.class));
-
+
expression = "within(@(test.annotation.transaction..*) *)";
AspectJExpressionPointcut springTxAnnotatedPc = testMatchAnnotationOnClass(expression);
- assertFalse(springTxAnnotatedPc.matches(SpringAnnotated.class.getMethod("foo", (Class[]) null),
+ assertFalse(springTxAnnotatedPc.matches(SpringAnnotated.class.getMethod("foo", (Class[]) null),
SpringAnnotated.class));
}
-
+
@Test
public void testMatchAnnotationOnClassWithExactPackageWildcard() throws SecurityException, NoSuchMethodException {
String expression = "within(@(test.annotation.transaction.*) *)";
testMatchAnnotationOnClass(expression);
}
-
+
private AspectJExpressionPointcut testMatchAnnotationOnClass(String expression) throws SecurityException, NoSuchMethodException {
AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut();
ajexp.setExpression(expression);
-
+
assertFalse(ajexp.matches(getAge, TestBean.class));
assertTrue(ajexp.matches(HasTransactionalAnnotation.class.getMethod("foo", (Class[]) null), HasTransactionalAnnotation.class));
assertTrue(ajexp.matches(HasTransactionalAnnotation.class.getMethod("bar", String.class), HasTransactionalAnnotation.class));
assertTrue(ajexp.matches(BeanB.class.getMethod("setName", String.class), BeanB.class));
assertFalse(ajexp.matches(BeanA.class.getMethod("setName", String.class), BeanA.class));
return ajexp;
}
-
+
@Test
public void testAnnotationOnMethodWithFQN() throws SecurityException, NoSuchMethodException {
String expression = "@annotation(test.annotation.transaction.Tx)";
AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut();
ajexp.setExpression(expression);
-
+
assertFalse(ajexp.matches(getAge, TestBean.class));
assertFalse(ajexp.matches(HasTransactionalAnnotation.class.getMethod("foo", (Class[]) null), HasTransactionalAnnotation.class));
assertFalse(ajexp.matches(HasTransactionalAnnotation.class.getMethod("bar", String.class), HasTransactionalAnnotation.class));
assertFalse(ajexp.matches(BeanA.class.getMethod("setName", String.class), BeanA.class));
assertTrue(ajexp.matches(BeanA.class.getMethod("getAge", (Class[]) null), BeanA.class));
assertFalse(ajexp.matches(BeanA.class.getMethod("setName", String.class), BeanA.class));
}
-
+
@Test
public void testAnnotationOnMethodWithWildcard() throws SecurityException, NoSuchMethodException {
String expression = "execution(@(test.annotation..*) * *(..))";
AspectJExpressionPointcut anySpringMethodAnnotation = new AspectJExpressionPointcut();
anySpringMethodAnnotation.setExpression(expression);
-
+
assertFalse(anySpringMethodAnnotation.matches(getAge, TestBean.class));
assertFalse(anySpringMethodAnnotation.matches(HasTransactionalAnnotation.class.getMethod("foo", (Class[]) null), HasTransactionalAnnotation.class));
assertFalse(anySpringMethodAnnotation.matches(HasTransactionalAnnotation.class.getMethod("bar", String.class), HasTransactionalAnnotation.class));
@@ -194,43 +194,43 @@ public void testAnnotationOnMethodArgumentsWithFQN() throws SecurityException, N
String expression = "@args(*, test.annotation.EmptySpringAnnotation))";
AspectJExpressionPointcut takesSpringAnnotatedArgument2 = new AspectJExpressionPointcut();
takesSpringAnnotatedArgument2.setExpression(expression);
-
+
assertFalse(takesSpringAnnotatedArgument2.matches(getAge, TestBean.class));
assertFalse(takesSpringAnnotatedArgument2.matches(HasTransactionalAnnotation.class.getMethod("foo", (Class[]) null), HasTransactionalAnnotation.class));
assertFalse(takesSpringAnnotatedArgument2.matches(HasTransactionalAnnotation.class.getMethod("bar", String.class), HasTransactionalAnnotation.class));
assertFalse(takesSpringAnnotatedArgument2.matches(BeanA.class.getMethod("setName", String.class), BeanA.class));
assertFalse(takesSpringAnnotatedArgument2.matches(BeanA.class.getMethod("getAge", (Class[]) null), BeanA.class));
assertFalse(takesSpringAnnotatedArgument2.matches(BeanA.class.getMethod("setName", String.class), BeanA.class));
-
+
assertTrue(takesSpringAnnotatedArgument2.matches(
ProcessesSpringAnnotatedParameters.class.getMethod("takesAnnotatedParameters", TestBean.class, SpringAnnotated.class),
ProcessesSpringAnnotatedParameters.class));
-
+
// True because it maybeMatches with potential argument subtypes
assertTrue(takesSpringAnnotatedArgument2.matches(
ProcessesSpringAnnotatedParameters.class.getMethod("takesNoAnnotatedParameters", TestBean.class, BeanA.class),
ProcessesSpringAnnotatedParameters.class));
-
+
assertFalse(takesSpringAnnotatedArgument2.matches(
ProcessesSpringAnnotatedParameters.class.getMethod("takesNoAnnotatedParameters", TestBean.class, BeanA.class),
ProcessesSpringAnnotatedParameters.class,
new Object[] { new TestBean(), new BeanA()})
);
}
-
+
@Test
public void testAnnotationOnMethodArgumentsWithWildcards() throws SecurityException, NoSuchMethodException {
String expression = "execution(* *(*, @(test..*) *))";
AspectJExpressionPointcut takesSpringAnnotatedArgument2 = new AspectJExpressionPointcut();
takesSpringAnnotatedArgument2.setExpression(expression);
-
+
assertFalse(takesSpringAnnotatedArgument2.matches(getAge, TestBean.class));
assertFalse(takesSpringAnnotatedArgument2.matches(HasTransactionalAnnotation.class.getMethod("foo", (Class[]) null), HasTransactionalAnnotation.class));
assertFalse(takesSpringAnnotatedArgument2.matches(HasTransactionalAnnotation.class.getMethod("bar", String.class), HasTransactionalAnnotation.class));
assertFalse(takesSpringAnnotatedArgument2.matches(BeanA.class.getMethod("setName", String.class), BeanA.class));
assertFalse(takesSpringAnnotatedArgument2.matches(BeanA.class.getMethod("getAge", (Class[]) null), BeanA.class));
assertFalse(takesSpringAnnotatedArgument2.matches(BeanA.class.getMethod("setName", String.class), BeanA.class));
-
+
assertTrue(takesSpringAnnotatedArgument2.matches(
ProcessesSpringAnnotatedParameters.class.getMethod("takesAnnotatedParameters", TestBean.class, SpringAnnotated.class),
ProcessesSpringAnnotatedParameters.class));
@@ -267,7 +267,7 @@ public void foo() {
}
}
-
+
static class BeanA {
private String name;
@@ -283,7 +283,7 @@ public int getAge() {
}
}
-
+
@Tx
static class BeanB {
private String name; | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/TrickyAspectJPointcutExpressionTests.java | @@ -67,7 +67,7 @@ public void testManualProxyJavaWithStaticPointcutAndTwoClassLoaders() throws Exc
// Test with default class loader first...
testAdvice(new DefaultPointcutAdvisor(pointcut, logAdvice), logAdvice, new TestServiceImpl(), "TestServiceImpl");
-
+
// Then try again with a different class loader on the target...
SimpleThrowawayClassLoader loader = new SimpleThrowawayClassLoader(new TestServiceImpl().getClass().getClassLoader());
// Make sure the interface is loaded from the parent class loader
@@ -102,7 +102,7 @@ private void testAdvice(Advisor advisor, LogUserAdvice logAdvice, TestService ta
}
assertEquals(1, logAdvice.getCountThrows());
}
-
+
public static class SimpleThrowawayClassLoader extends OverridingClassLoader {
/**
@@ -114,7 +114,7 @@ public SimpleThrowawayClassLoader(ClassLoader parent) {
}
}
-
+
public static class TestException extends RuntimeException {
public TestException(String string) {
@@ -129,11 +129,11 @@ public TestException(String string) {
@Inherited
public static @interface Log {
}
-
+
public static interface TestService {
public String sayHello();
}
-
+
@Log
public static class TestServiceImpl implements TestService{
public String sayHello() {
@@ -142,11 +142,11 @@ public String sayHello() {
}
public class LogUserAdvice implements MethodBeforeAdvice, ThrowsAdvice {
-
+
private int countBefore = 0;
-
+
private int countThrows = 0;
-
+
public void before(Method method, Object[] objects, Object o) throws Throwable {
countBefore++;
}
@@ -163,12 +163,12 @@ public int getCountBefore() {
public int getCountThrows() {
return countThrows;
}
-
+
public void reset() {
countThrows = 0;
countBefore = 0;
}
}
-
+
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/TypePatternClassFilterTests.java | @@ -63,7 +63,7 @@ public void testSubclassMatching() {
assertFalse("Must be excluded: not subclass", tpcf.matches(IOther.class));
assertFalse("Must be excluded: not subclass", tpcf.matches(DefaultListableBeanFactory.class));
}
-
+
@Test
public void testAndOrNotReplacement() {
TypePatternClassFilter tpcf = new TypePatternClassFilter("java.lang.Object or java.lang.String");
@@ -75,7 +75,7 @@ public void testAndOrNotReplacement() {
assertFalse("matches Double",tpcf.matches(Double.class));
tpcf = new TypePatternClassFilter("java.lang.Number+ and not java.lang.Float");
assertFalse("matches Float",tpcf.matches(Float.class));
- assertTrue("matches Double",tpcf.matches(Double.class));
+ assertTrue("matches Double",tpcf.matches(Double.class));
}
@Test(expected=IllegalArgumentException.class) | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java | @@ -76,7 +76,7 @@ public abstract class AbstractAspectJAdvisorFactoryTests {
* @return the fixture
*/
protected abstract AspectJAdvisorFactory getFixture();
-
+
@Test
public void testRejectsPerCflowAspect() {
@@ -88,7 +88,7 @@ public void testRejectsPerCflowAspect() {
assertTrue(ex.getMessage().indexOf("PERCFLOW") != -1);
}
}
-
+
@Test
public void testRejectsPerCflowBelowAspect() {
try {
@@ -105,11 +105,11 @@ public void testPerTargetAspect() throws SecurityException, NoSuchMethodExceptio
TestBean target = new TestBean();
int realAge = 65;
target.setAge(realAge);
- TestBean itb = (TestBean) createProxy(target,
+ TestBean itb = (TestBean) createProxy(target,
getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new PerTargetAspect(), "someBean")),
TestBean.class);
assertEquals("Around advice must NOT apply", realAge, itb.getAge());
-
+
Advised advised = (Advised) itb;
SyntheticInstantiationAdvisor sia = (SyntheticInstantiationAdvisor) advised.getAdvisors()[1];
assertTrue(sia.getPointcut().getMethodMatcher().matches(TestBean.class.getMethod("getSpouse"), null));
@@ -121,10 +121,10 @@ public void testPerTargetAspect() throws SecurityException, NoSuchMethodExceptio
// Check that the perclause pointcut is valid
assertTrue(maaif.getAspectMetadata().getPerClausePointcut().getMethodMatcher().matches(TestBean.class.getMethod("getSpouse"), null));
assertNotSame(imapa.getDeclaredPointcut(), imapa.getPointcut());
-
+
// Hit the method in the per clause to instantiate the aspect
itb.getSpouse();
-
+
assertTrue(maaif.isMaterialized());
assertEquals("Around advice must apply", 0, itb.getAge());
@@ -190,11 +190,11 @@ public void testPerThisAspect() throws SecurityException, NoSuchMethodException
TestBean target = new TestBean();
int realAge = 65;
target.setAge(realAge);
- TestBean itb = (TestBean) createProxy(target,
+ TestBean itb = (TestBean) createProxy(target,
getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new PerThisAspect(), "someBean")),
TestBean.class);
assertEquals("Around advice must NOT apply", realAge, itb.getAge());
-
+
Advised advised = (Advised) itb;
// Will be ExposeInvocationInterceptor, synthetic instantiation advisor, 2 method advisors
assertEquals(4, advised.getAdvisors().length);
@@ -208,30 +208,30 @@ public void testPerThisAspect() throws SecurityException, NoSuchMethodException
// Check that the perclause pointcut is valid
assertTrue(maaif.getAspectMetadata().getPerClausePointcut().getMethodMatcher().matches(TestBean.class.getMethod("getSpouse"), null));
assertNotSame(imapa.getDeclaredPointcut(), imapa.getPointcut());
-
+
// Hit the method in the per clause to instantiate the aspect
itb.getSpouse();
-
+
assertTrue(maaif.isMaterialized());
assertTrue(imapa.getDeclaredPointcut().getMethodMatcher().matches(TestBean.class.getMethod("getAge"), null));
-
+
assertEquals("Around advice must apply", 0, itb.getAge());
assertEquals("Around advice must apply", 1, itb.getAge());
}
-
+
@Test
public void testPerTypeWithinAspect() throws SecurityException, NoSuchMethodException {
TestBean target = new TestBean();
int realAge = 65;
target.setAge(realAge);
PerTypeWithinAspectInstanceFactory aif = new PerTypeWithinAspectInstanceFactory();
- TestBean itb = (TestBean) createProxy(target,
- getFixture().getAdvisors(aif),
+ TestBean itb = (TestBean) createProxy(target,
+ getFixture().getAdvisors(aif),
TestBean.class);
assertEquals("No method calls", 0, aif.getInstantiationCount());
assertEquals("Around advice must now apply", 0, itb.getAge());
-
+
Advised advised = (Advised) itb;
// Will be ExposeInvocationInterceptor, synthetic instantiation advisor, 2 method advisors
assertEquals(4, advised.getAdvisors().length);
@@ -245,19 +245,19 @@ public void testPerTypeWithinAspect() throws SecurityException, NoSuchMethodExce
// Check that the perclause pointcut is valid
assertTrue(maaif.getAspectMetadata().getPerClausePointcut().getMethodMatcher().matches(TestBean.class.getMethod("getSpouse"), null));
assertNotSame(imapa.getDeclaredPointcut(), imapa.getPointcut());
-
+
// Hit the method in the per clause to instantiate the aspect
itb.getSpouse();
-
+
assertTrue(maaif.isMaterialized());
assertTrue(imapa.getDeclaredPointcut().getMethodMatcher().matches(TestBean.class.getMethod("getAge"), null));
-
+
assertEquals("Around advice must still apply", 1, itb.getAge());
assertEquals("Around advice must still apply", 2, itb.getAge());
-
- TestBean itb2 = (TestBean) createProxy(target,
- getFixture().getAdvisors(aif),
+
+ TestBean itb2 = (TestBean) createProxy(target,
+ getFixture().getAdvisors(aif),
TestBean.class);
assertEquals(1, aif.getInstantiationCount());
assertEquals("Around advice be independent for second instance", 0, itb2.getAge());
@@ -282,20 +282,20 @@ public void testNamedPointcutFromAspectLibrary() {
@Test
public void testNamedPointcutFromAspectLibraryWithBinding() {
TestBean target = new TestBean();
- ITestBean itb = (ITestBean) createProxy(target,
- getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new NamedPointcutAspectFromLibraryWithBinding(),"someBean")),
+ ITestBean itb = (ITestBean) createProxy(target,
+ getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new NamedPointcutAspectFromLibraryWithBinding(),"someBean")),
ITestBean.class);
itb.setAge(10);
assertEquals("Around advice must apply", 20, itb.getAge());
assertEquals(20,target.getAge());
}
-
+
private void testNamedPointcuts(Object aspectInstance) {
TestBean target = new TestBean();
int realAge = 65;
target.setAge(realAge);
- ITestBean itb = (ITestBean) createProxy(target,
- getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(aspectInstance,"someBean")),
+ ITestBean itb = (ITestBean) createProxy(target,
+ getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(aspectInstance,"someBean")),
ITestBean.class);
assertEquals("Around advice must apply", -1, itb.getAge());
assertEquals(realAge, target.getAge());
@@ -304,8 +304,8 @@ private void testNamedPointcuts(Object aspectInstance) {
@Test
public void testBindingWithSingleArg() {
TestBean target = new TestBean();
- ITestBean itb = (ITestBean) createProxy(target,
- getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new BindingAspectWithSingleArg(),"someBean")),
+ ITestBean itb = (ITestBean) createProxy(target,
+ getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new BindingAspectWithSingleArg(),"someBean")),
ITestBean.class);
itb.setAge(10);
assertEquals("Around advice must apply", 20, itb.getAge());
@@ -315,10 +315,10 @@ public void testBindingWithSingleArg() {
@Test
public void testBindingWithMultipleArgsDifferentlyOrdered() {
ManyValuedArgs target = new ManyValuedArgs();
- ManyValuedArgs mva = (ManyValuedArgs) createProxy(target,
- getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new ManyValuedArgs(),"someBean")),
+ ManyValuedArgs mva = (ManyValuedArgs) createProxy(target,
+ getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new ManyValuedArgs(),"someBean")),
ManyValuedArgs.class);
-
+
String a = "a";
int b = 12;
int c = 25;
@@ -327,7 +327,7 @@ public void testBindingWithMultipleArgsDifferentlyOrdered() {
String expectedResult = a + b+ c + d + e;
assertEquals(expectedResult, mva.mungeArgs(a, b, c, d, e));
}
-
+
/**
* In this case the introduction will be made.
*/
@@ -344,7 +344,7 @@ public void testIntroductionOnTargetNotImplementingInterface() {
assertFalse(lockable.locked());
lockable.lock();
assertTrue(lockable.locked());
-
+
NotLockable notLockable2Target = new NotLockable();
NotLockable notLockable2 = (NotLockable) createProxy(notLockable2Target,
getFixture().getAdvisors(
@@ -363,17 +363,17 @@ public void testIntroductionOnTargetNotImplementingInterface() {
}
assertTrue(lockable2.locked());
}
-
+
@Test
public void testIntroductionAdvisorExcludedFromTargetImplementingInterface() {
assertTrue(AopUtils.findAdvisorsThatCanApply(
getFixture().getAdvisors(
new SingletonMetadataAwareAspectInstanceFactory(
- new MakeLockable(),"someBean")),
+ new MakeLockable(),"someBean")),
CannotBeUnlocked.class).isEmpty());
assertEquals(2, AopUtils.findAdvisorsThatCanApply(getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new MakeLockable(),"someBean")), NotLockable.class).size());
}
-
+
@Test
public void testIntroductionOnTargetImplementingInterface() {
CannotBeUnlocked target = new CannotBeUnlocked();
@@ -398,7 +398,7 @@ public void testIntroductionOnTargetImplementingInterface() {
// Ok
}
}
-
+
@SuppressWarnings("unchecked")
@Test
public void testIntroductionOnTargetExcludedByTypePattern() {
@@ -415,7 +415,7 @@ public void testIntroductionOnTargetExcludedByTypePattern() {
@Test
public void testIntroductionBasedOnAnnotationMatch_Spr5307() {
AnnotatedTarget target = new AnnotatedTargetImpl();
-
+
List<Advisor> advisors = getFixture().getAdvisors(
new SingletonMetadataAwareAspectInstanceFactory(new MakeAnnotatedTypeModifiable(),"someBean"));
Object proxy = createProxy(target,
@@ -430,19 +430,19 @@ public void testIntroductionBasedOnAnnotationMatch_Spr5307() {
// TODO: Why does this test fail? It hasn't been run before, so it maybe never actually passed...
public void XtestIntroductionWithArgumentBinding() {
TestBean target = new TestBean();
-
+
List<Advisor> advisors = getFixture().getAdvisors(
new SingletonMetadataAwareAspectInstanceFactory(new MakeITestBeanModifiable(),"someBean"));
advisors.addAll(getFixture().getAdvisors(
new SingletonMetadataAwareAspectInstanceFactory(new MakeLockable(),"someBean")));
-
+
Modifiable modifiable = (Modifiable) createProxy(target,
advisors,
ITestBean.class);
assertTrue(modifiable instanceof Modifiable);
Lockable lockable = (Lockable) modifiable;
assertFalse(lockable.locked());
-
+
ITestBean itb = (ITestBean) modifiable;
assertFalse(modifiable.isModified());
int oldAge = itb.getAge();
@@ -454,7 +454,7 @@ public void XtestIntroductionWithArgumentBinding() {
assertFalse("Setting same value does not modify", modifiable.isModified());
itb.setName("And now for something completely different");
assertTrue(modifiable.isModified());
-
+
lockable.lock();
assertTrue(lockable.locked());
try {
@@ -474,8 +474,8 @@ public void testAspectMethodThrowsExceptionLegalOnSignature() {
UnsupportedOperationException expectedException = new UnsupportedOperationException();
List<Advisor> advisors = getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new ExceptionAspect(expectedException),"someBean"));
assertEquals("One advice method was found", 1, advisors.size());
- ITestBean itb = (ITestBean) createProxy(target,
- advisors,
+ ITestBean itb = (ITestBean) createProxy(target,
+ advisors,
ITestBean.class);
try {
itb.getAge();
@@ -485,7 +485,7 @@ public void testAspectMethodThrowsExceptionLegalOnSignature() {
assertSame(expectedException, ex);
}
}
-
+
// TODO document this behaviour.
// Is it different AspectJ behaviour, at least for checked exceptions?
@Test
@@ -494,8 +494,8 @@ public void testAspectMethodThrowsExceptionIllegalOnSignature() {
RemoteException expectedException = new RemoteException();
List<Advisor> advisors = getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new ExceptionAspect(expectedException),"someBean"));
assertEquals("One advice method was found", 1, advisors.size());
- ITestBean itb = (ITestBean) createProxy(target,
- advisors,
+ ITestBean itb = (ITestBean) createProxy(target,
+ advisors,
ITestBean.class);
try {
itb.getAge();
@@ -505,7 +505,7 @@ public void testAspectMethodThrowsExceptionIllegalOnSignature() {
assertSame(expectedException, ex.getCause());
}
}
-
+
protected Object createProxy(Object target, List<Advisor> advisors, Class<?>... interfaces) {
ProxyFactory pf = new ProxyFactory(target);
if (interfaces.length > 1 || interfaces[0].isInterface()) {
@@ -533,8 +533,8 @@ public void testTwoAdvicesOnOneAspect() {
TwoAdviceAspect twoAdviceAspect = new TwoAdviceAspect();
List<Advisor> advisors = getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(twoAdviceAspect,"someBean"));
assertEquals("Two advice methods found", 2, advisors.size());
- ITestBean itb = (ITestBean) createProxy(target,
- advisors,
+ ITestBean itb = (ITestBean) createProxy(target,
+ advisors,
ITestBean.class);
itb.setName("");
assertEquals(0, itb.getAge());
@@ -549,8 +549,8 @@ public void testAfterAdviceTypes() throws Exception {
ExceptionHandling afterReturningAspect = new ExceptionHandling();
List<Advisor> advisors = getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(afterReturningAspect,"someBean"));
- Echo echo = (Echo) createProxy(target,
- advisors,
+ Echo echo = (Echo) createProxy(target,
+ advisors,
Echo.class);
assertEquals(0, afterReturningAspect.successCount);
assertEquals("", echo.echo(""));
@@ -886,45 +886,45 @@ public int preventExecution(ProceedingJoinPoint pjp) {
*/
@Aspect
abstract class AbstractMakeModifiable {
-
+
public interface MutableModifable extends Modifiable {
void markDirty();
}
-
+
public static class ModifiableImpl implements MutableModifable {
private boolean modified;
-
+
public void acceptChanges() {
modified = false;
}
-
+
public boolean isModified() {
return modified;
}
-
+
public void markDirty() {
this.modified = true;
}
}
-
- @Before(value="execution(void set*(*)) && this(modifiable) && args(newValue)",
+
+ @Before(value="execution(void set*(*)) && this(modifiable) && args(newValue)",
argNames="modifiable,newValue")
- public void recordModificationIfSetterArgumentDiffersFromOldValue(JoinPoint jp,
+ public void recordModificationIfSetterArgumentDiffersFromOldValue(JoinPoint jp,
MutableModifable mixin, Object newValue) {
-
+
/*
* We use the mixin to check and, if necessary, change,
- * modification status. We need the JoinPoint to get the
- * setter method. We use newValue for comparison.
+ * modification status. We need the JoinPoint to get the
+ * setter method. We use newValue for comparison.
* We try to invoke the getter if possible.
*/
-
+
if (mixin.isModified()) {
// Already changed, don't need to change again
//System.out.println("changed");
return;
}
-
+
// Find the current raw value, by invoking the corresponding setter
Method correspondingGetter = getGetterFromSetter(((MethodSignature) jp.getSignature()).getMethod());
boolean modified = true;
@@ -946,12 +946,12 @@ public void recordModificationIfSetterArgumentDiffersFromOldValue(JoinPoint jp,
mixin.markDirty();
}
}
-
+
private Method getGetterFromSetter(Method setter) {
String getterName = setter.getName().replaceFirst("set", "get");
try {
return setter.getDeclaringClass().getMethod(getterName, (Class[]) null);
- }
+ }
catch (NoSuchMethodException ex) {
// must be write only
return null;
@@ -968,7 +968,7 @@ private Method getGetterFromSetter(Method setter) {
*/
@Aspect
class MakeITestBeanModifiable extends AbstractMakeModifiable {
-
+
@DeclareParents(value = "test.beans.ITestBean+",
defaultImpl=ModifiableImpl.class)
public static MutableModifable mixin;
@@ -982,7 +982,7 @@ class MakeITestBeanModifiable extends AbstractMakeModifiable {
*/
@Aspect
class MakeAnnotatedTypeModifiable extends AbstractMakeModifiable {
-
+
@DeclareParents(value = "(@org.springframework.aop.aspectj.annotation.Measured *)",
// @DeclareParents(value = "(@Measured *)", // this would be a nice alternative...
defaultImpl=DefaultLockable.class)
@@ -996,11 +996,11 @@ class MakeAnnotatedTypeModifiable extends AbstractMakeModifiable {
*/
@Aspect
class MakeLockable {
-
+
@DeclareParents(value = "org.springframework..*",
defaultImpl=DefaultLockable.class)
public static Lockable mixin;
-
+
@Before(value="execution(void set*(*)) && this(mixin)", argNames="mixin")
public void checkNotLocked(
Lockable mixin) // Bind to arg
@@ -1043,9 +1043,9 @@ public int compareTo(Object arg0) {
interface Modifiable {
boolean isModified();
-
+
void acceptChanges();
-
+
}
/**
@@ -1057,14 +1057,14 @@ interface AnnotatedTarget {
@Measured
class AnnotatedTargetImpl implements AnnotatedTarget {
-
+
}
@Retention(RetentionPolicy.RUNTIME)
@interface Measured {}
class NotLockable {
-
+
private int intValue;
public int getIntValue() {
@@ -1097,5 +1097,5 @@ public int returnCountAsAge() {
public void countSetter() {
++count;
}
-
+
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/ArgumentBindingTests.java | @@ -44,7 +44,7 @@ public void testBindingInPointcutUsedByAdvice() {
TestBean tb = new TestBean();
AspectJProxyFactory proxyFactory = new AspectJProxyFactory(tb);
proxyFactory.addAspect(NamedPointcutWithArgs.class);
-
+
ITestBean proxiedTestBean = (ITestBean) proxyFactory.getProxy();
proxiedTestBean.setName("Supercalifragalisticexpialidocious"); // should throw
}
@@ -54,7 +54,7 @@ public void testAnnotationArgumentNameBinding() {
TransactionalBean tb = new TransactionalBean();
AspectJProxyFactory proxyFactory = new AspectJProxyFactory(tb);
proxyFactory.addAspect(PointcutWithAnnotationArgument.class);
-
+
ITransactionalBean proxiedTestBean = (ITransactionalBean) proxyFactory.getProxy();
proxiedTestBean.doInTransaction(); // should throw
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectJPointcutAdvisorTests.java | @@ -29,56 +29,56 @@
/**
- * @author Rod Johnson
+ * @author Rod Johnson
* @author Chris Beams
*/
public final class AspectJPointcutAdvisorTests {
-
+
private AspectJAdvisorFactory af = new ReflectiveAspectJAdvisorFactory();
@Test
public void testSingleton() throws SecurityException, NoSuchMethodException {
AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut();
ajexp.setExpression(AspectJExpressionPointcutTests.MATCH_ALL_METHODS);
-
- InstantiationModelAwarePointcutAdvisorImpl ajpa = new InstantiationModelAwarePointcutAdvisorImpl(af, ajexp,
- new SingletonMetadataAwareAspectInstanceFactory(new AbstractAspectJAdvisorFactoryTests.ExceptionAspect(null),"someBean"),
+
+ InstantiationModelAwarePointcutAdvisorImpl ajpa = new InstantiationModelAwarePointcutAdvisorImpl(af, ajexp,
+ new SingletonMetadataAwareAspectInstanceFactory(new AbstractAspectJAdvisorFactoryTests.ExceptionAspect(null),"someBean"),
TestBean.class.getMethod("getAge", (Class[]) null),1,"someBean");
assertSame(Pointcut.TRUE, ajpa.getAspectMetadata().getPerClausePointcut());
assertFalse(ajpa.isPerInstance());
}
-
+
@Test
public void testPerTarget() throws SecurityException, NoSuchMethodException {
AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut();
ajexp.setExpression(AspectJExpressionPointcutTests.MATCH_ALL_METHODS);
-
- InstantiationModelAwarePointcutAdvisorImpl ajpa = new InstantiationModelAwarePointcutAdvisorImpl(af, ajexp,
+
+ InstantiationModelAwarePointcutAdvisorImpl ajpa = new InstantiationModelAwarePointcutAdvisorImpl(af, ajexp,
new SingletonMetadataAwareAspectInstanceFactory(new PerTargetAspect(),"someBean"), null, 1, "someBean");
assertNotSame(Pointcut.TRUE, ajpa.getAspectMetadata().getPerClausePointcut());
assertTrue(ajpa.getAspectMetadata().getPerClausePointcut() instanceof AspectJExpressionPointcut);
assertTrue(ajpa.isPerInstance());
-
+
assertTrue(ajpa.getAspectMetadata().getPerClausePointcut().getClassFilter().matches(TestBean.class));
assertFalse(ajpa.getAspectMetadata().getPerClausePointcut().getMethodMatcher().matches(
TestBean.class.getMethod("getAge", (Class[]) null),
TestBean.class));
-
+
assertTrue(ajpa.getAspectMetadata().getPerClausePointcut().getMethodMatcher().matches(
TestBean.class.getMethod("getSpouse", (Class[]) null),
TestBean.class));
}
-
+
@Test(expected=AopConfigException.class)
public void testPerCflowTarget() {
testIllegalInstantiationModel(AbstractAspectJAdvisorFactoryTests.PerCflowAspect.class);
}
-
+
@Test(expected=AopConfigException.class)
public void testPerCflowBelowTarget() {
testIllegalInstantiationModel(AbstractAspectJAdvisorFactoryTests.PerCflowBelowAspect.class);
}
-
+
private void testIllegalInstantiationModel(Class<?> c) throws AopConfigException {
new AspectMetadata(c,"someBean");
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectMetadataTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,23 +37,23 @@ public final class AspectMetadataTests {
public void testNotAnAspect() {
new AspectMetadata(String.class,"someBean");
}
-
+
@Test
public void testSingletonAspect() {
AspectMetadata am = new AspectMetadata(ExceptionAspect.class,"someBean");
assertFalse(am.isPerThisOrPerTarget());
assertSame(Pointcut.TRUE, am.getPerClausePointcut());
assertEquals(PerClauseKind.SINGLETON, am.getAjType().getPerClause().getKind());
}
-
+
@Test
public void testPerTargetAspect() {
AspectMetadata am = new AspectMetadata(PerTargetAspect.class,"someBean");
assertTrue(am.isPerThisOrPerTarget());
assertNotSame(Pointcut.TRUE, am.getPerClausePointcut());
assertEquals(PerClauseKind.PERTARGET, am.getAjType().getPerClause().getKind());
}
-
+
@Test
public void testPerThisAspect() {
AspectMetadata am = new AspectMetadata(PerThisAspect.class,"someBean"); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactoryTests.java | @@ -17,7 +17,7 @@
package org.springframework.aop.aspectj.annotation;
/**
- * Tests for ReflectiveAtAspectJAdvisorFactory.
+ * Tests for ReflectiveAtAspectJAdvisorFactory.
* Tests are inherited: we only set the test fixture here.
*
* @author Rod Johnson | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparatorTests.java | @@ -42,9 +42,9 @@
public final class AspectJPrecedenceComparatorTests {
/*
- * Specification for the comparator (as defined in the
+ * Specification for the comparator (as defined in the
* AspectJPrecedenceComparator class)
- *
+ *
* <p>
* Orders AspectJ advice/advisors by invocation order.
* </p> | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerEventTests.java | @@ -43,18 +43,18 @@
public final class AopNamespaceHandlerEventTests {
private static final Class<?> CLASS = AopNamespaceHandlerEventTests.class;
-
+
private static final Resource CONTEXT = qualifiedResource(CLASS, "context.xml");
private static final Resource POINTCUT_EVENTS_CONTEXT = qualifiedResource(CLASS, "pointcutEvents.xml");
private static final Resource POINTCUT_REF_CONTEXT = qualifiedResource(CLASS, "pointcutRefEvents.xml");
private static final Resource DIRECT_POINTCUT_EVENTS_CONTEXT = qualifiedResource(CLASS, "directPointcutEvents.xml");
-
+
private CollectingReaderEventListener eventListener = new CollectingReaderEventListener();
private XmlBeanDefinitionReader reader;
private DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
-
+
@Before | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/config/AopNamespaceHandlerPointcutErrorTests.java | @@ -29,7 +29,7 @@
* @author Chris Beams
*/
public final class AopNamespaceHandlerPointcutErrorTests {
-
+
@Test
public void testDuplicatePointcutConfig() {
try { | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/config/TopLevelAopTagTests.java | @@ -26,12 +26,12 @@
/**
* Tests that the <aop:config/> element can be used as a top level element.
- *
+ *
* @author Rob Harrop
* @author Chris Beams
*/
public final class TopLevelAopTagTests {
-
+
private static final Resource CONTEXT = qualifiedResource(TopLevelAopTagTests.class, "context.xml");
@Test | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/framework/AopProxyUtilsTests.java | @@ -35,7 +35,7 @@
* @author Chris Beams
*/
public final class AopProxyUtilsTests {
-
+
@Test
public void testCompleteProxiedInterfacesWorksWithNull() {
AdvisedSupport as = new AdvisedSupport();
@@ -45,30 +45,30 @@ public void testCompleteProxiedInterfacesWorksWithNull() {
assertTrue(ifaces.contains(Advised.class));
assertTrue(ifaces.contains(SpringProxy.class));
}
-
+
@Test
public void testCompleteProxiedInterfacesWorksWithNullOpaque() {
AdvisedSupport as = new AdvisedSupport();
as.setOpaque(true);
Class<?>[] completedInterfaces = AopProxyUtils.completeProxiedInterfaces(as);
assertEquals(1, completedInterfaces.length);
}
-
+
@Test
public void testCompleteProxiedInterfacesAdvisedNotIncluded() {
AdvisedSupport as = new AdvisedSupport();
as.addInterface(ITestBean.class);
as.addInterface(Comparable.class);
Class<?>[] completedInterfaces = AopProxyUtils.completeProxiedInterfaces(as);
assertEquals(4, completedInterfaces.length);
-
+
// Can't assume ordering for others, so use a list
List<?> l = Arrays.asList(completedInterfaces);
assertTrue(l.contains(Advised.class));
assertTrue(l.contains(ITestBean.class));
assertTrue(l.contains(Comparable.class));
}
-
+
@Test
public void testCompleteProxiedInterfacesAdvisedIncluded() {
AdvisedSupport as = new AdvisedSupport();
@@ -77,14 +77,14 @@ public void testCompleteProxiedInterfacesAdvisedIncluded() {
as.addInterface(Advised.class);
Class<?>[] completedInterfaces = AopProxyUtils.completeProxiedInterfaces(as);
assertEquals(4, completedInterfaces.length);
-
+
// Can't assume ordering for others, so use a list
List<?> l = Arrays.asList(completedInterfaces);
assertTrue(l.contains(Advised.class));
assertTrue(l.contains(ITestBean.class));
assertTrue(l.contains(Comparable.class));
}
-
+
@Test
public void testCompleteProxiedInterfacesAdvisedNotIncludedOpaque() {
AdvisedSupport as = new AdvisedSupport();
@@ -93,7 +93,7 @@ public void testCompleteProxiedInterfacesAdvisedNotIncludedOpaque() {
as.addInterface(Comparable.class);
Class<?>[] completedInterfaces = AopProxyUtils.completeProxiedInterfaces(as);
assertEquals(3, completedInterfaces.length);
-
+
// Can't assume ordering for others, so use a list
List<?> l = Arrays.asList(completedInterfaces);
assertFalse(l.contains(Advised.class)); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/framework/IntroductionBenchmarkTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,9 +25,9 @@
/**
* Benchmarks for introductions.
- *
+ *
* NOTE: No assertions!
- *
+ *
* @author Rod Johnson
* @author Chris Beams
* @since 2.0 | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/framework/MethodInvocationTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,7 +34,7 @@
* @since 14.03.2003
*/
public final class MethodInvocationTests {
-
+
@Test
public void testValidInvocation() throws Throwable {
Method m = Object.class.getMethod("hashCode", (Class[]) null);
@@ -52,7 +52,7 @@ public Object invoke(MethodInvocation invocation) throws Throwable {
Object rv = invocation.proceed();
assertTrue("correct response", rv == returnValue);
}
-
+
/**
* toString on target can cause failure.
*/ | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/framework/PrototypeTargetTests.java | @@ -31,7 +31,7 @@
* @since 03.09.2004
*/
public final class PrototypeTargetTests {
-
+
private static final Resource CONTEXT = qualifiedResource(PrototypeTargetTests.class, "context.xml");
@Test | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/framework/ProxyFactoryTests.java | @@ -64,7 +64,7 @@ public void testIndexOfMethods() {
assertEquals(1, pf.indexOf(advisor));
assertEquals(-1, advised.indexOf(new DefaultPointcutAdvisor(null)));
}
-
+
@Test
public void testRemoveAdvisorByReference() {
TestBean target = new TestBean();
@@ -84,7 +84,7 @@ public void testRemoveAdvisorByReference() {
assertEquals(2, nop.getCount());
assertFalse(pf.removeAdvisor(new DefaultPointcutAdvisor(null)));
}
-
+
@Test
public void testRemoveAdvisorByIndex() {
TestBean target = new TestBean();
@@ -113,22 +113,22 @@ public void testRemoveAdvisorByIndex() {
assertEquals(1, cba.getCalls());
assertEquals(2, nop.getCount());
assertEquals(3, nop2.getCount());
-
+
// Check out of bounds
try {
pf.removeAdvisor(-1);
}
catch (AopConfigException ex) {
// Ok
}
-
+
try {
pf.removeAdvisor(2);
}
catch (AopConfigException ex) {
// Ok
}
-
+
assertEquals(5, proxied.getAge());
assertEquals(4, nop2.getCount());
}
@@ -191,17 +191,17 @@ public int compareTo(Object arg0) {
assertEquals("Found correct number of interfaces", 3, factory.getProxiedInterfaces().length);
ITestBean tb = (ITestBean) factory.getProxy();
assertThat("Picked up secondary interface", tb, instanceOf(IOther.class));
-
+
raw.setAge(25);
assertTrue(tb.getAge() == raw.getAge());
long t = 555555L;
TimestampIntroductionInterceptor ti = new TimestampIntroductionInterceptor(t);
-
+
Class<?>[] oldProxiedInterfaces = factory.getProxiedInterfaces();
-
+
factory.addAdvisor(0, new DefaultIntroductionAdvisor(ti, TimeStamped.class));
-
+
Class<?>[] newProxiedInterfaces = factory.getProxiedInterfaces();
assertEquals("Advisor proxies one more interface after introduction", oldProxiedInterfaces.length + 1, newProxiedInterfaces.length);
@@ -210,15 +210,15 @@ public int compareTo(Object arg0) {
// Shouldn't fail;
((IOther) ts).absquatulate();
}
-
+
@Test
public void testInterceptorInclusionMethods() {
class MyInterceptor implements MethodInterceptor {
public Object invoke(MethodInvocation invocation) throws Throwable {
throw new UnsupportedOperationException();
}
}
-
+
NopInterceptor di = new NopInterceptor();
NopInterceptor diUnused = new NopInterceptor();
ProxyFactory factory = new ProxyFactory(new TestBean());
@@ -228,7 +228,7 @@ public Object invoke(MethodInvocation invocation) throws Throwable {
assertTrue(!factory.adviceIncluded(diUnused));
assertTrue(factory.countAdvicesOfType(NopInterceptor.class) == 1);
assertTrue(factory.countAdvicesOfType(MyInterceptor.class) == 0);
-
+
factory.addAdvice(0, diUnused);
assertTrue(factory.adviceIncluded(diUnused));
assertTrue(factory.countAdvicesOfType(NopInterceptor.class) == 2); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java | @@ -34,7 +34,7 @@ public final class DebugInterceptorTests {
@Test
public void testSunnyDayPathLogsCorrectly() throws Throwable {
Log log = createMock(Log.class);
-
+
MethodInvocation methodInvocation = createMock(MethodInvocation.class);
expect(log.isTraceEnabled()).andReturn(true);
@@ -56,7 +56,7 @@ public void testSunnyDayPathLogsCorrectly() throws Throwable {
@Test
public void testExceptionPathStillLogsCorrectly() throws Throwable {
Log log = createMock(Log.class);
-
+
MethodInvocation methodInvocation = createMock(MethodInvocation.class);
expect(log.isTraceEnabled()).andReturn(true); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/interceptor/ExposeBeanNameAdvisorsTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,20 +30,20 @@
* @author Chris Beams
*/
public final class ExposeBeanNameAdvisorsTests {
-
+
private class RequiresBeanNameBoundTestBean extends TestBean {
private final String beanName;
-
+
public RequiresBeanNameBoundTestBean(String beanName) {
this.beanName = beanName;
}
-
+
public int getAge() {
assertEquals(beanName, ExposeBeanNameAdvisors.getBeanName());
return super.getAge();
}
}
-
+
@Test
public void testNoIntroduction() {
String beanName = "foo";
@@ -52,12 +52,12 @@ public void testNoIntroduction() {
pf.addAdvisor(ExposeInvocationInterceptor.ADVISOR);
pf.addAdvisor(ExposeBeanNameAdvisors.createAdvisorWithoutIntroduction(beanName));
ITestBean proxy = (ITestBean) pf.getProxy();
-
+
assertFalse("No introduction", proxy instanceof NamedBean);
// Requires binding
proxy.getAge();
}
-
+
@Test
public void testWithIntroduction() {
String beanName = "foo";
@@ -66,11 +66,11 @@ public void testWithIntroduction() {
pf.addAdvisor(ExposeInvocationInterceptor.ADVISOR);
pf.addAdvisor(ExposeBeanNameAdvisors.createAdvisorIntroducingNamedBean(beanName));
ITestBean proxy = (ITestBean) pf.getProxy();
-
+
assertTrue("Introduction was made", proxy instanceof NamedBean);
// Requires binding
proxy.getAge();
-
+
NamedBean nb = (NamedBean) proxy;
assertEquals("Name returned correctly", beanName, nb.getBeanName());
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/interceptor/ExposeInvocationInterceptorTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -29,12 +29,12 @@
/**
* Non-XML tests are in AbstractAopProxyTests
- *
+ *
* @author Rod Johnson
* @author Chris Beams
*/
public final class ExposeInvocationInterceptorTests {
-
+
private static final Resource CONTEXT =
qualifiedResource(ExposeInvocationInterceptorTests.class, "context.xml");
@@ -64,15 +64,15 @@ public void absquatulate() {
assertions(invocation);
super.absquatulate();
}
-
+
protected abstract void assertions(MethodInvocation invocation);
}
class InvocationCheckExposedInvocationTestBean extends ExposedInvocationTestBean {
protected void assertions(MethodInvocation invocation) {
assertTrue(invocation.getThis() == this);
- assertTrue("Invocation should be on ITestBean: " + invocation.getMethod(),
+ assertTrue("Invocation should be on ITestBean: " + invocation.getMethod(),
ITestBean.class.isAssignableFrom(invocation.getMethod().getDeclaringClass()));
}
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/scope/ScopedProxyAutowireTests.java | @@ -28,9 +28,9 @@
* @author Chris Beams
*/
public final class ScopedProxyAutowireTests {
-
+
private static final Class<?> CLASS = ScopedProxyAutowireTests.class;
-
+
private static final Resource SCOPED_AUTOWIRE_TRUE_CONTEXT = qualifiedResource(CLASS, "scopedAutowireTrue.xml");
private static final Resource SCOPED_AUTOWIRE_FALSE_CONTEXT = qualifiedResource(CLASS, "scopedAutowireFalse.xml");
| true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/support/AopUtilsTests.java | @@ -44,7 +44,7 @@ public boolean matches(Method method, Class<?> clazzy) {
return false;
}
}
-
+
Pointcut no = new TestPointcut();
assertFalse(AopUtils.canApply(no, Object.class));
}
@@ -64,7 +64,7 @@ public boolean matches(Method method, Class<?> clazz) {
}
Pointcut pc = new TestPointcut();
-
+
// will return true if we're not proxying interfaces
assertTrue(AopUtils.canApply(pc, Object.class));
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/support/ClassFiltersTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,11 +30,11 @@
* @author Chris Beams
*/
public final class ClassFiltersTests {
-
+
private ClassFilter exceptionFilter = new RootClassFilter(Exception.class);
-
+
private ClassFilter itbFilter = new RootClassFilter(ITestBean.class);
-
+
private ClassFilter hasRootCauseFilter = new RootClassFilter(NestedRuntimeException.class);
@Test
@@ -47,7 +47,7 @@ public void testUnion() {
assertTrue(union.matches(RuntimeException.class));
assertTrue(union.matches(TestBean.class));
}
-
+
@Test
public void testIntersection() {
assertTrue(exceptionFilter.matches(RuntimeException.class)); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/support/ComposablePointcutTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,31 +33,31 @@
* @author Chris Beams
*/
public final class ComposablePointcutTests {
-
+
public static MethodMatcher GETTER_METHOD_MATCHER = new StaticMethodMatcher() {
public boolean matches(Method m, Class<?> targetClass) {
return m.getName().startsWith("get");
}
};
-
+
public static MethodMatcher GET_AGE_METHOD_MATCHER = new StaticMethodMatcher() {
public boolean matches(Method m, Class<?> targetClass) {
return m.getName().equals("getAge");
}
};
-
+
public static MethodMatcher ABSQUATULATE_METHOD_MATCHER = new StaticMethodMatcher() {
public boolean matches(Method m, Class<?> targetClass) {
return m.getName().equals("absquatulate");
}
};
-
+
public static MethodMatcher SETTER_METHOD_MATCHER = new StaticMethodMatcher() {
public boolean matches(Method m, Class<?> targetClass) {
return m.getName().startsWith("set");
}
};
-
+
@Test
public void testMatchAll() throws NoSuchMethodException {
Pointcut pc = new ComposablePointcut();
@@ -68,9 +68,9 @@ public void testMatchAll() throws NoSuchMethodException {
@Test
public void testFilterByClass() throws NoSuchMethodException {
ComposablePointcut pc = new ComposablePointcut();
-
+
assertTrue(pc.getClassFilter().matches(Object.class));
-
+
ClassFilter cf = new RootClassFilter(Exception.class);
pc.intersection(cf);
assertFalse(pc.getClassFilter().matches(Object.class));
@@ -92,15 +92,15 @@ public void testUnionMethodMatcher() {
assertFalse(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_ABSQUATULATE, TestBean.class, null));
assertTrue(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_GET_AGE, TestBean.class, null));
assertFalse(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_GET_NAME, TestBean.class, null));
-
+
pc.union(GETTER_METHOD_MATCHER);
// Should now match all getter methods
assertFalse(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_ABSQUATULATE, TestBean.class, null));
assertTrue(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_GET_AGE, TestBean.class, null));
assertTrue(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_GET_NAME, TestBean.class, null));
-
+
pc.union(ABSQUATULATE_METHOD_MATCHER);
- // Should now match absquatulate() as well
+ // Should now match absquatulate() as well
assertTrue(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_ABSQUATULATE, TestBean.class, null));
assertTrue(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_GET_AGE, TestBean.class, null));
assertTrue(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_GET_NAME, TestBean.class, null)); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/support/ControlFlowPointcutTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@
* @author Chris Beams
*/
public final class ControlFlowPointcutTests {
-
+
@Test
public void testMatches() {
TestBean target = new TestBean();
@@ -41,21 +41,21 @@ public void testMatches() {
ProxyFactory pf = new ProxyFactory(target);
ITestBean proxied = (ITestBean) pf.getProxy();
pf.addAdvisor(new DefaultPointcutAdvisor(cflow, nop));
-
+
// Not advised, not under One
assertEquals(target.getAge(), proxied.getAge());
assertEquals(0, nop.getCount());
-
+
// Will be advised
assertEquals(target.getAge(), new One().getAge(proxied));
assertEquals(1, nop.getCount());
-
+
// Won't be advised
assertEquals(target.getAge(), new One().nomatch(proxied));
assertEquals(1, nop.getCount());
assertEquals(3, cflow.getEvaluations());
}
-
+
/**
* Check that we can use a cflow pointcut only in conjunction with
* a static pointcut: e.g. all setter methods that are invoked under
@@ -73,19 +73,19 @@ public void testSelectiveApplication() {
ProxyFactory pf = new ProxyFactory(target);
ITestBean proxied = (ITestBean) pf.getProxy();
pf.addAdvisor(new DefaultPointcutAdvisor(settersUnderOne, nop));
-
+
// Not advised, not under One
target.setAge(16);
assertEquals(0, nop.getCount());
-
+
// Not advised; under One but not a setter
assertEquals(16, new One().getAge(proxied));
assertEquals(0, nop.getCount());
-
+
// Won't be advised
new One().set(proxied);
assertEquals(1, nop.getCount());
-
+
// We saved most evaluations
assertEquals(1, cflow.getEvaluations());
}
@@ -99,7 +99,7 @@ public void testEqualsAndHashCode() throws Exception {
assertEquals(new ControlFlowPointcut(One.class, "getAge").hashCode(), new ControlFlowPointcut(One.class, "getAge").hashCode());
assertFalse(new ControlFlowPointcut(One.class, "getAge").hashCode() == new ControlFlowPointcut(One.class).hashCode());
}
-
+
public class One {
int getAge(ITestBean proxied) {
return proxied.getAge(); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -79,7 +79,7 @@ public void testIntroductionInterceptorWithInterfaceHierarchy() throws Exception
long timestamp = 111L;
expect(ts.getTimeStamp()).andReturn(timestamp);
replay(ts);
-
+
factory.addAdvisor(0, new DefaultIntroductionAdvisor(new DelegatingIntroductionInterceptor(ts), SubTimeStamped.class));
SubTimeStamped tsp = (SubTimeStamped) factory.getProxy(); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/support/MethodMatchersTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,9 +37,9 @@ public final class MethodMatchersTests {
private final Method EXCEPTION_GETMESSAGE;
private final Method ITESTBEAN_SETAGE;
-
+
private final Method ITESTBEAN_GETAGE;
-
+
private final Method IOTHER_ABSQUATULATE;
public MethodMatchersTests() throws Exception {
@@ -55,7 +55,7 @@ public void testDefaultMatchesAll() throws Exception {
assertTrue(defaultMm.matches(EXCEPTION_GETMESSAGE, Exception.class));
assertTrue(defaultMm.matches(ITESTBEAN_SETAGE, TestBean.class));
}
-
+
@Test
public void testMethodMatcherTrueSerializable() throws Exception {
assertSame(SerializationTestUtils.serializeAndDeserialize(MethodMatcher.TRUE), MethodMatcher.TRUE);
@@ -72,7 +72,7 @@ public void testSingle() throws Exception {
assertFalse(defaultMm.matches(ITESTBEAN_SETAGE, TestBean.class));
}
-
+
@Test
public void testDynamicAndStaticMethodMatcherIntersection() throws Exception {
MethodMatcher mm1 = MethodMatcher.TRUE;
@@ -87,13 +87,13 @@ public void testDynamicAndStaticMethodMatcherIntersection() throws Exception {
assertTrue("2Matched setAge method", intersection.matches(ITESTBEAN_SETAGE, TestBean.class));
assertFalse("3 - not Matched setAge method", intersection.matches(ITESTBEAN_SETAGE, TestBean.class, new Object[] { new Integer(5) }));
}
-
+
@Test
public void testStaticMethodMatcherUnion() throws Exception {
MethodMatcher getterMatcher = new StartsWithMatcher("get");
MethodMatcher setterMatcher = new StartsWithMatcher("set");
MethodMatcher union = MethodMatchers.union(getterMatcher, setterMatcher);
-
+
assertFalse("Union is a static matcher", union.isRuntime());
assertTrue("Matched setAge method", union.matches(ITESTBEAN_SETAGE, TestBean.class));
assertTrue("Matched getAge method", union.matches(ITESTBEAN_GETAGE, TestBean.class)); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/support/NameMatchMethodPointcutTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,11 +34,11 @@
* @author Chris Beams
*/
public final class NameMatchMethodPointcutTests {
-
+
protected NameMatchMethodPointcut pc;
-
+
protected Person proxied;
-
+
protected SerializableNopInterceptor nop;
/**
@@ -52,7 +52,7 @@ public void setUp() {
pf.addAdvisor(new DefaultPointcutAdvisor(pc, nop));
proxied = (Person) pf.getProxy();
}
-
+
@Test
public void testMatchingOnly() {
// Can't do exact matching through isMatch
@@ -63,7 +63,7 @@ public void testMatchingOnly() {
assertFalse(pc.isMatch("setName", "set"));
assertTrue(pc.isMatch("testing", "*ing"));
}
-
+
@Test
public void testEmpty() throws Throwable {
assertEquals(0, nop.getCount());
@@ -72,8 +72,8 @@ public void testEmpty() throws Throwable {
proxied.echo(null);
assertEquals(0, nop.getCount());
}
-
-
+
+
@Test
public void testMatchOneMethod() throws Throwable {
pc.addMethodName("echo");
@@ -84,7 +84,7 @@ public void testMatchOneMethod() throws Throwable {
assertEquals(0, nop.getCount());
proxied.echo(null);
assertEquals(1, nop.getCount());
-
+
proxied.setName("");
assertEquals(2, nop.getCount());
proxied.setAge(25);
@@ -102,7 +102,7 @@ public void testSets() throws Throwable {
proxied.echo(null);
assertEquals(2, nop.getCount());
}
-
+
@Test
public void testSerializable() throws Throwable {
testSets(); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/support/PointcutsTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,12 +31,12 @@
* @author Chris Beams
*/
public final class PointcutsTests {
-
+
public static Method TEST_BEAN_SET_AGE;
public static Method TEST_BEAN_GET_AGE;
public static Method TEST_BEAN_GET_NAME;
public static Method TEST_BEAN_ABSQUATULATE;
-
+
static {
try {
TEST_BEAN_SET_AGE = TestBean.class.getMethod("setAge", new Class[] { int.class });
@@ -48,7 +48,7 @@ public final class PointcutsTests {
throw new RuntimeException("Shouldn't happen: error in test suite");
}
}
-
+
/**
* Matches only TestBean class, not subclasses
*/
@@ -65,13 +65,13 @@ public boolean matches(Method m, Class<?> targetClass) {
return true;
}
};
-
+
public static Pointcut allClassSetterPointcut = Pointcuts.SETTERS;
-
+
// Subclass used for matching
public static class MyTestBean extends TestBean {
}
-
+
public static Pointcut myTestBeanSetterPointcut = new StaticMethodMatcherPointcut() {
public ClassFilter getClassFilter() {
return new RootClassFilter(MyTestBean.class);
@@ -81,7 +81,7 @@ public boolean matches(Method m, Class<?> targetClass) {
return m.getName().startsWith("set");
}
};
-
+
// Will match MyTestBeanSubclass
public static Pointcut myTestBeanGetterPointcut = new StaticMethodMatcherPointcut() {
public ClassFilter getClassFilter() {
@@ -92,11 +92,11 @@ public boolean matches(Method m, Class<?> targetClass) {
return m.getName().startsWith("get");
}
};
-
+
// Still more specific class
public static class MyTestBeanSubclass extends MyTestBean {
}
-
+
public static Pointcut myTestBeanSubclassGetterPointcut = new StaticMethodMatcherPointcut() {
public ClassFilter getClassFilter() {
return new RootClassFilter(MyTestBeanSubclass.class);
@@ -106,14 +106,14 @@ public boolean matches(Method m, Class<?> targetClass) {
return m.getName().startsWith("get");
}
};
-
+
public static Pointcut allClassGetterPointcut = Pointcuts.GETTERS;
-
+
public static Pointcut allClassGetAgePointcut = new NameMatchMethodPointcut().addMethodName("getAge");
-
+
public static Pointcut allClassGetNamePointcut = new NameMatchMethodPointcut().addMethodName("getName");
-
-
+
+
@Test
public void testTrue() {
assertTrue(Pointcuts.matches(Pointcut.TRUE, TEST_BEAN_SET_AGE, TestBean.class, new Object[] { new Integer(6)}));
@@ -133,7 +133,7 @@ public void testMatches() {
assertTrue(Pointcuts.matches(allClassGetterPointcut, TEST_BEAN_GET_AGE, TestBean.class, null));
assertFalse(Pointcuts.matches(allClassGetterPointcut, TEST_BEAN_ABSQUATULATE, TestBean.class, null));
}
-
+
/**
* Should match all setters and getters on any class
*/
@@ -144,7 +144,7 @@ public void testUnionOfSettersAndGetters() {
assertTrue(Pointcuts.matches(union, TEST_BEAN_GET_AGE, TestBean.class, null));
assertFalse(Pointcuts.matches(union, TEST_BEAN_ABSQUATULATE, TestBean.class, null));
}
-
+
@Test
public void testUnionOfSpecificGetters() {
Pointcut union = Pointcuts.union(allClassGetAgePointcut, allClassGetNamePointcut);
@@ -153,18 +153,18 @@ public void testUnionOfSpecificGetters() {
assertFalse(Pointcuts.matches(allClassGetAgePointcut, TEST_BEAN_GET_NAME, TestBean.class, null));
assertTrue(Pointcuts.matches(union, TEST_BEAN_GET_NAME, TestBean.class, null));
assertFalse(Pointcuts.matches(union, TEST_BEAN_ABSQUATULATE, TestBean.class, null));
-
+
// Union with all setters
union = Pointcuts.union(union, allClassSetterPointcut);
assertTrue(Pointcuts.matches(union, TEST_BEAN_SET_AGE, TestBean.class, new Object[] { new Integer(6)}));
assertTrue(Pointcuts.matches(union, TEST_BEAN_GET_AGE, TestBean.class, null));
assertFalse(Pointcuts.matches(allClassGetAgePointcut, TEST_BEAN_GET_NAME, TestBean.class, null));
assertTrue(Pointcuts.matches(union, TEST_BEAN_GET_NAME, TestBean.class, null));
assertFalse(Pointcuts.matches(union, TEST_BEAN_ABSQUATULATE, TestBean.class, null));
-
+
assertTrue(Pointcuts.matches(union, TEST_BEAN_SET_AGE, TestBean.class, new Object[] { new Integer(6)}));
}
-
+
/**
* Tests vertical composition. First pointcut matches all setters.
* Second one matches all getters in the MyTestBean class. TestBean getters shouldn't pass.
@@ -174,15 +174,15 @@ public void testUnionOfAllSettersAndSubclassSetters() {
assertFalse(Pointcuts.matches(myTestBeanSetterPointcut, TEST_BEAN_SET_AGE, TestBean.class, new Object[] { new Integer(6)}));
assertTrue(Pointcuts.matches(myTestBeanSetterPointcut, TEST_BEAN_SET_AGE, MyTestBean.class, new Object[] { new Integer(6)}));
assertFalse(Pointcuts.matches(myTestBeanSetterPointcut, TEST_BEAN_GET_AGE, TestBean.class, null));
-
+
Pointcut union = Pointcuts.union(myTestBeanSetterPointcut, allClassGetterPointcut);
assertTrue(Pointcuts.matches(union, TEST_BEAN_GET_AGE, TestBean.class, null));
assertTrue(Pointcuts.matches(union, TEST_BEAN_GET_AGE, MyTestBean.class, null));
// Still doesn't match superclass setter
assertTrue(Pointcuts.matches(union, TEST_BEAN_SET_AGE, MyTestBean.class, new Object[] { new Integer(6)}));
assertFalse(Pointcuts.matches(union, TEST_BEAN_SET_AGE, TestBean.class, new Object[] { new Integer(6)}));
}
-
+
/**
* Intersection should be MyTestBean getAge() only:
* it's the union of allClassGetAge and subclass getters
@@ -195,7 +195,7 @@ public void testIntersectionOfSpecificGettersAndSubclassGetters() {
assertFalse(Pointcuts.matches(myTestBeanGetterPointcut, TEST_BEAN_GET_AGE, TestBean.class, null));
assertTrue(Pointcuts.matches(myTestBeanGetterPointcut, TEST_BEAN_GET_NAME, MyTestBean.class, null));
assertTrue(Pointcuts.matches(myTestBeanGetterPointcut, TEST_BEAN_GET_AGE, MyTestBean.class, null));
-
+
Pointcut intersection = Pointcuts.intersection(allClassGetAgePointcut, myTestBeanGetterPointcut);
assertFalse(Pointcuts.matches(intersection, TEST_BEAN_GET_NAME, TestBean.class, null));
assertFalse(Pointcuts.matches(intersection, TEST_BEAN_GET_AGE, TestBean.class, null));
@@ -204,7 +204,7 @@ public void testIntersectionOfSpecificGettersAndSubclassGetters() {
// Matches subclass of MyTestBean
assertFalse(Pointcuts.matches(intersection, TEST_BEAN_GET_NAME, MyTestBeanSubclass.class, null));
assertTrue(Pointcuts.matches(intersection, TEST_BEAN_GET_AGE, MyTestBeanSubclass.class, null));
-
+
// Now intersection with MyTestBeanSubclass getters should eliminate MyTestBean target
intersection = Pointcuts.intersection(intersection, myTestBeanSubclassGetterPointcut);
assertFalse(Pointcuts.matches(intersection, TEST_BEAN_GET_NAME, TestBean.class, null));
@@ -214,7 +214,7 @@ public void testIntersectionOfSpecificGettersAndSubclassGetters() {
// Still matches subclass of MyTestBean
assertFalse(Pointcuts.matches(intersection, TEST_BEAN_GET_NAME, MyTestBeanSubclass.class, null));
assertTrue(Pointcuts.matches(intersection, TEST_BEAN_GET_AGE, MyTestBeanSubclass.class, null));
-
+
// Now union with all TestBean methods
Pointcut union = Pointcuts.union(intersection, allTestBeanMethodsPointcut);
assertTrue(Pointcuts.matches(union, TEST_BEAN_GET_NAME, TestBean.class, null));
@@ -224,12 +224,12 @@ public void testIntersectionOfSpecificGettersAndSubclassGetters() {
// Still matches subclass of MyTestBean
assertFalse(Pointcuts.matches(union, TEST_BEAN_GET_NAME, MyTestBeanSubclass.class, null));
assertTrue(Pointcuts.matches(union, TEST_BEAN_GET_AGE, MyTestBeanSubclass.class, null));
-
+
assertTrue(Pointcuts.matches(union, TEST_BEAN_ABSQUATULATE, TestBean.class, null));
assertFalse(Pointcuts.matches(union, TEST_BEAN_ABSQUATULATE, MyTestBean.class, null));
}
-
-
+
+
/**
* The intersection of these two pointcuts leaves nothing.
*/ | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/support/RegexpMethodPointcutAdvisorIntegrationTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,18 +37,18 @@
* @author Chris Beams
*/
public final class RegexpMethodPointcutAdvisorIntegrationTests {
-
+
private static final Resource CONTEXT =
qualifiedResource(RegexpMethodPointcutAdvisorIntegrationTests.class, "context.xml");
@Test
public void testSinglePattern() throws Throwable {
- BeanFactory bf = new XmlBeanFactory(CONTEXT);
+ BeanFactory bf = new XmlBeanFactory(CONTEXT);
ITestBean advised = (ITestBean) bf.getBean("settersAdvised");
// Interceptor behind regexp advisor
NopInterceptor nop = (NopInterceptor) bf.getBean("nopInterceptor");
assertEquals(0, nop.getCount());
-
+
int newAge = 12;
// Not advised
advised.exceptional(null);
@@ -58,21 +58,21 @@ public void testSinglePattern() throws Throwable {
// Only setter fired
assertEquals(1, nop.getCount());
}
-
+
@Test
public void testMultiplePatterns() throws Throwable {
- BeanFactory bf = new XmlBeanFactory(CONTEXT);
+ BeanFactory bf = new XmlBeanFactory(CONTEXT);
// This is a CGLIB proxy, so we can proxy it to the target class
TestBean advised = (TestBean) bf.getBean("settersAndAbsquatulateAdvised");
// Interceptor behind regexp advisor
NopInterceptor nop = (NopInterceptor) bf.getBean("nopInterceptor");
assertEquals(0, nop.getCount());
-
+
int newAge = 12;
// Not advised
advised.exceptional(null);
assertEquals(0, nop.getCount());
-
+
// This is proxied
advised.absquatulate();
assertEquals(1, nop.getCount());
@@ -81,29 +81,29 @@ public void testMultiplePatterns() throws Throwable {
// Only setter fired
assertEquals(2, nop.getCount());
}
-
+
@Test
public void testSerialization() throws Throwable {
- BeanFactory bf = new XmlBeanFactory(CONTEXT);
+ BeanFactory bf = new XmlBeanFactory(CONTEXT);
// This is a CGLIB proxy, so we can proxy it to the target class
Person p = (Person) bf.getBean("serializableSettersAdvised");
// Interceptor behind regexp advisor
NopInterceptor nop = (NopInterceptor) bf.getBean("nopInterceptor");
assertEquals(0, nop.getCount());
-
+
int newAge = 12;
// Not advised
assertEquals(0, p.getAge());
assertEquals(0, nop.getCount());
-
+
// This is proxied
p.setAge(newAge);
assertEquals(1, nop.getCount());
p.setAge(newAge);
assertEquals(newAge, p.getAge());
// Only setter fired
assertEquals(2, nop.getCount());
-
+
// Serialize and continue...
p = (Person) SerializationTestUtils.serializeAndDeserialize(p);
assertEquals(newAge, p.getAge()); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/target/CommonsPoolTargetSourceProxyTests.java | @@ -33,7 +33,7 @@
* @since 2.0
*/
public final class CommonsPoolTargetSourceProxyTests {
-
+
private static final Resource CONTEXT =
qualifiedResource(CommonsPoolTargetSourceProxyTests.class, "context.xml");
| true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -40,19 +40,19 @@
* @author Chris Beams
*/
public final class HotSwappableTargetSourceTests {
-
+
private static final Resource CONTEXT = qualifiedResource(HotSwappableTargetSourceTests.class, "context.xml");
/** Initial count value set in bean factory XML */
private static final int INITIAL_COUNT = 10;
private XmlBeanFactory beanFactory;
-
+
@Before
public void setUp() throws Exception {
this.beanFactory = new XmlBeanFactory(CONTEXT);
}
-
+
/**
* We must simulate container shutdown, which should clear threads.
*/
@@ -72,42 +72,42 @@ public void testBasicFunctionality() {
assertEquals(INITIAL_COUNT, proxied.getCount() );
proxied.doWork();
assertEquals(INITIAL_COUNT + 1, proxied.getCount() );
-
+
proxied = (SideEffectBean) beanFactory.getBean("swappable");
proxied.doWork();
assertEquals(INITIAL_COUNT + 2, proxied.getCount() );
}
-
+
@Test
public void testValidSwaps() {
SideEffectBean target1 = (SideEffectBean) beanFactory.getBean("target1");
SideEffectBean target2 = (SideEffectBean) beanFactory.getBean("target2");
-
+
SideEffectBean proxied = (SideEffectBean) beanFactory.getBean("swappable");
assertEquals(target1.getCount(), proxied.getCount() );
proxied.doWork();
assertEquals(INITIAL_COUNT + 1, proxied.getCount() );
-
+
HotSwappableTargetSource swapper = (HotSwappableTargetSource) beanFactory.getBean("swapper");
Object old = swapper.swap(target2);
assertEquals("Correct old target was returned", target1, old);
-
+
// TODO should be able to make this assertion: need to fix target handling
// in AdvisedSupport
//assertEquals(target2, ((Advised) proxied).getTarget());
-
+
assertEquals(20, proxied.getCount());
proxied.doWork();
assertEquals(21, target2.getCount());
-
+
// Swap it back
swapper.swap(target1);
assertEquals(target1.getCount(), proxied.getCount());
}
-
-
+
+
/**
- *
+ *
* @param invalid
* @return the message
*/
@@ -122,46 +122,46 @@ private IllegalArgumentException testRejectsSwapToInvalidValue(Object invalid) {
// Ok
aopex = ex;
}
-
+
// It shouldn't be corrupted, it should still work
testBasicFunctionality();
return aopex;
}
-
+
@Test
public void testRejectsSwapToNull() {
IllegalArgumentException ex = testRejectsSwapToInvalidValue(null);
assertTrue(ex.getMessage().indexOf("null") != -1);
}
-
+
// TODO test reject swap to wrong interface or class?
// how to decide what's valid?
-
-
+
+
@Test
public void testSerialization() throws Exception {
SerializablePerson sp1 = new SerializablePerson();
sp1.setName("Tony");
SerializablePerson sp2 = new SerializablePerson();
sp1.setName("Gordon");
-
+
HotSwappableTargetSource hts = new HotSwappableTargetSource(sp1);
ProxyFactory pf = new ProxyFactory();
pf.addInterface(Person.class);
pf.setTargetSource(hts);
pf.addAdvisor(new DefaultPointcutAdvisor(new SerializableNopInterceptor()));
Person p = (Person) pf.getProxy();
-
+
assertEquals(sp1.getName(), p.getName());
hts.swap(sp2);
assertEquals(sp2.getName(), p.getName());
-
+
p = (Person) SerializationTestUtils.serializeAndDeserialize(p);
// We need to get a reference to the client-side targetsource
hts = (HotSwappableTargetSource) ((Advised) p).getTargetSource();
assertEquals(sp2.getName(), p.getName());
hts.swap(sp1);
assertEquals(sp1.getName(), p.getName());
-
+
}
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/target/LazyInitTargetSourceTests.java | @@ -34,9 +34,9 @@
* @since 07.01.2005
*/
public final class LazyInitTargetSourceTests {
-
+
private static final Class<?> CLASS = LazyInitTargetSourceTests.class;
-
+
private static final Resource SINGLETON_CONTEXT = qualifiedResource(CLASS, "singleton.xml");
private static final Resource CUSTOM_TARGET_CONTEXT = qualifiedResource(CLASS, "customTarget.xml");
private static final Resource FACTORY_BEAN_CONTEXT = qualifiedResource(CLASS, "factoryBean.xml"); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/target/PrototypeBasedTargetSourceTests.java | @@ -59,9 +59,9 @@ public void testSerializability() throws Exception {
assertNotNull(sts.getTarget());
}
-
+
private static class TestTargetSource extends AbstractPrototypeBasedTargetSource {
-
+
/**
* Nonserializable test field to check that subclass
* state can't prevent serialization from working | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,14 +33,14 @@
* @author Chris Beams
*/
public final class PrototypeTargetSourceTests {
-
+
private static final Resource CONTEXT = qualifiedResource(PrototypeTargetSourceTests.class, "context.xml");
-
+
/** Initial count value set in bean factory XML */
private static final int INITIAL_COUNT = 10;
-
+
private BeanFactory beanFactory;
-
+
@Before
public void setUp() throws Exception {
this.beanFactory = new XmlBeanFactory(CONTEXT);
@@ -57,7 +57,7 @@ public void testPrototypeAndSingletonBehaveDifferently() {
assertEquals(INITIAL_COUNT, singleton.getCount() );
singleton.doWork();
assertEquals(INITIAL_COUNT + 1, singleton.getCount() );
-
+
SideEffectBean prototype = (SideEffectBean) beanFactory.getBean("prototype");
assertEquals(INITIAL_COUNT, prototype.getCount() );
prototype.doWork(); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,26 +33,26 @@
* @author Chris Beams
*/
public class ThreadLocalTargetSourceTests {
-
+
private static final Resource CONTEXT = qualifiedResource(ThreadLocalTargetSourceTests.class, "context.xml");
/** Initial count value set in bean factory XML */
private static final int INITIAL_COUNT = 10;
private XmlBeanFactory beanFactory;
-
+
@Before
public void setUp() throws Exception {
this.beanFactory = new XmlBeanFactory(CONTEXT);
}
-
+
/**
* We must simulate container shutdown, which should clear threads.
*/
protected void tearDown() {
this.beanFactory.destroySingletons();
}
-
+
/**
* Check we can use two different ThreadLocalTargetSources
* managing objects of different types without them interfering
@@ -64,7 +64,7 @@ public void testUseDifferentManagedInstancesInSameThread() {
assertEquals(INITIAL_COUNT, apartment.getCount() );
apartment.doWork();
assertEquals(INITIAL_COUNT + 1, apartment.getCount() );
-
+
ITestBean test = (ITestBean) beanFactory.getBean("threadLocal2");
assertEquals("Rod", test.getName());
assertEquals("Kerry", test.getSpouse().getName());
@@ -76,11 +76,11 @@ public void testReuseInSameThread() {
assertEquals(INITIAL_COUNT, apartment.getCount() );
apartment.doWork();
assertEquals(INITIAL_COUNT + 1, apartment.getCount() );
-
+
apartment = (SideEffectBean) beanFactory.getBean("apartment");
assertEquals(INITIAL_COUNT + 1, apartment.getCount() );
}
-
+
/**
* Relies on introduction.
*/
@@ -101,7 +101,7 @@ public void testCanGetStatsViaMixin() {
// Only one thread so only one object can have been bound
assertEquals(1, stats.getObjectCount());
}
-
+
@Test
public void testNewThreadHasOwnInstance() throws InterruptedException {
SideEffectBean apartment = (SideEffectBean) beanFactory.getBean("apartment");
@@ -110,7 +110,7 @@ public void testNewThreadHasOwnInstance() throws InterruptedException {
apartment.doWork();
apartment.doWork();
assertEquals(INITIAL_COUNT + 3, apartment.getCount() );
-
+
class Runner implements Runnable {
public SideEffectBean mine;
public void run() {
@@ -124,16 +124,16 @@ public void run() {
Thread t = new Thread(r);
t.start();
t.join();
-
+
assertNotNull(r);
-
+
// Check it didn't affect the other thread's copy
assertEquals(INITIAL_COUNT + 3, apartment.getCount() );
-
- // When we use other thread's copy in this thread
+
+ // When we use other thread's copy in this thread
// it should behave like ours
assertEquals(INITIAL_COUNT + 3, r.mine.getCount() );
-
+
// Bound to two threads
assertEquals(2, ((ThreadLocalTargetSourceStats) apartment).getObjectCount());
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/aop/DefaultLockable.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,7 +18,7 @@
/**
* Simple implementation of Lockable interface for use in mixins.
- *
+ *
* @author Rod Johnson
*/
public class DefaultLockable implements Lockable { | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/aop/Lockable.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,15 +19,15 @@
/**
* Simple interface to use for mixins
- *
+ *
* @author Rod Johnson
*
*/
public interface Lockable {
-
+
void lock();
-
+
void unlock();
-
+
boolean locked();
}
\ No newline at end of file | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/aop/MethodCounter.java | @@ -22,7 +22,7 @@
/**
* Abstract superclass for counting advices etc.
- *
+ *
* @author Rod Johnson
* @author Chris Beams
*/ | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/aop/NopInterceptor.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,7 +25,7 @@
* @author Rod Johnson
*/
public class NopInterceptor implements MethodInterceptor {
-
+
private int count;
/**
@@ -35,11 +35,11 @@ public Object invoke(MethodInvocation invocation) throws Throwable {
increment();
return invocation.proceed();
}
-
+
public int getCount() {
return this.count;
}
-
+
protected void increment() {
++count;
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/aop/PerTargetAspect.java | @@ -1,5 +1,5 @@
/**
- *
+ *
*/
package test.aop;
| true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/aop/SerializableNopInterceptor.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,26 +23,26 @@
/**
* Subclass of NopInterceptor that is serializable and
* can be used to test proxy serialization.
- *
+ *
* @author Rod Johnson
* @author Chris Beams
*/
@SuppressWarnings("serial")
public class SerializableNopInterceptor extends NopInterceptor implements Serializable {
-
+
/**
* We must override this field and the related methods as
* otherwise count won't be serialized from the non-serializable
* NopInterceptor superclass.
*/
private int count;
-
+
public int getCount() {
return this.count;
}
-
+
protected void increment() {
++count;
}
-
+
}
\ No newline at end of file | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/beans/INestedTestBean.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/beans/IOther.java | @@ -1,13 +1,13 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/beans/NestedTestBean.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/beans/Person.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,19 +17,19 @@
package test.beans;
/**
- *
+ *
* @author Rod Johnson
*/
public interface Person {
-
+
String getName();
void setName(String name);
int getAge();
void setAge(int i);
-
- /**
+
+ /**
* Test for non-property method matching.
- * If the parameter is a Throwable, it will be thrown rather than
+ * If the parameter is a Throwable, it will be thrown rather than
* returned.
*/
Object echo(Object o) throws Throwable; | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/beans/SerializablePerson.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,26 +34,26 @@ public class SerializablePerson implements Person, Serializable {
public int getAge() {
return age;
}
-
+
public void setAge(int age) {
this.age = age;
}
-
+
public String getName() {
return name;
}
-
+
public void setName(String name) {
this.name = name;
}
-
+
public Object echo(Object o) throws Throwable {
if (o instanceof Throwable) {
throw (Throwable) o;
}
return o;
}
-
+
public boolean equals(Object other) {
if (!(other instanceof SerializablePerson)) {
return false; | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/beans/SideEffectBean.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,17 +22,17 @@
* @author Rod Johnson
*/
public class SideEffectBean {
-
+
private int count;
-
+
public void setCount(int count) {
this.count = count;
}
-
+
public int getCount() {
return this.count;
}
-
+
public void doWork() {
++count;
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/beans/subpkg/DeepBean.java | @@ -20,9 +20,9 @@
/**
* Used for testing pointcut matching.
- *
+ *
* @see AspectJExpressionPointcutTests#testWithinRootAndSubpackages()
- *
+ *
* @author Chris Beams
*/
public class DeepBean { | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/util/SerializationTestUtils.java | @@ -1,12 +1,12 @@
/*
* 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.
* You may obtain a copy of the License at
- *
+ *
* 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,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -63,7 +63,7 @@ public static Object serializeAndDeserialize(Object o) throws IOException, Class
oos.flush();
baos.flush();
byte[] bytes = baos.toByteArray();
-
+
ByteArrayInputStream is = new ByteArrayInputStream(bytes);
ObjectInputStream ois = new ObjectInputStream(is);
Object o2 = ois.readObject(); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/util/TestResourceUtils.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,12 +30,12 @@ public class TestResourceUtils {
/**
* Loads a {@link ClassPathResource} qualified by the simple name of clazz,
* and relative to the package for clazz.
- *
+ *
* <p>Example: given a clazz 'com.foo.BarTests' and a resourceSuffix of 'context.xml',
* this method will return a ClassPathResource representing com/foo/BarTests-context.xml
- *
+ *
* <p>Intended for use loading context configuration XML files within JUnit tests.
- *
+ *
* @param clazz
* @param resourceSuffix
*/ | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aop/src/test/java/test/util/TimeStamped.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2008 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,7 +23,7 @@
* @author Rod Johnson
*/
public interface TimeStamped {
-
+
/**
* Return the timestamp for this object.
* @return long the timestamp for this object, | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractBeanConfigurerAspect.aj | @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
package org.springframework.beans.factory.aspectj;
import org.aspectj.lang.annotation.SuppressAjWarnings;
@@ -23,12 +23,12 @@ import org.springframework.beans.factory.wiring.BeanConfigurerSupport;
* Abstract superaspect for AspectJ aspects that can perform Dependency
* Injection on objects, however they may be created. Define the beanCreation()
* pointcut in subaspects.
- *
+ *
* <p>Subaspects may also need a metadata resolution strategy, in the
* <code>BeanWiringInfoResolver</code> interface. The default implementation
* looks for a bean with the same name as the FQN. This is the default name
* of a bean in a Spring container if the id value is not supplied explicitly.
- *
+ *
* @author Rob Harrop
* @author Rod Johnson
* @author Adrian Colyer
@@ -62,7 +62,7 @@ public abstract aspect AbstractBeanConfigurerAspect extends BeanConfigurerSuppor
/**
* The initialization of a new object.
- *
+ *
* <p>WARNING: Although this pointcut is non-abstract for backwards
* compatibility reasons, it is meant to be overridden to select
* initialization of any configurable bean. | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractDependencyInjectionAspect.aj | @@ -21,34 +21,34 @@ import org.aspectj.lang.annotation.SuppressAjWarnings;
/**
* Abstract base aspect that can perform Dependency
* Injection on objects, however they may be created.
- *
+ *
* @author Ramnivas Laddad
* @since 2.5.2
*/
public abstract aspect AbstractDependencyInjectionAspect {
/**
* Select construction join points for objects to inject dependencies
*/
- public abstract pointcut beanConstruction(Object bean);
+ public abstract pointcut beanConstruction(Object bean);
/**
* Select deserialization join points for objects to inject dependencies
*/
public abstract pointcut beanDeserialization(Object bean);
-
+
/**
* Select join points in a configurable bean
*/
public abstract pointcut inConfigurableBean();
-
+
/**
* Select join points in beans to be configured prior to construction?
* By default, use post-construction injection matching the default in the Configurable annotation.
*/
public pointcut preConstructionConfiguration() : if(false);
-
+
/**
- * Select the most-specific initialization join point
+ * Select the most-specific initialization join point
* (most concrete class) for the initialization of an instance.
*/
public pointcut mostSpecificSubTypeConstruction() :
@@ -58,44 +58,44 @@ public abstract aspect AbstractDependencyInjectionAspect {
* Select least specific super type that is marked for DI (so that injection occurs only once with pre-construction inejection
*/
public abstract pointcut leastSpecificSuperTypeConstruction();
-
+
/**
* Configure the bean
*/
public abstract void configureBean(Object bean);
-
- private pointcut preConstructionCondition() :
+
+ private pointcut preConstructionCondition() :
leastSpecificSuperTypeConstruction() && preConstructionConfiguration();
-
+
private pointcut postConstructionCondition() :
mostSpecificSubTypeConstruction() && !preConstructionConfiguration();
-
+
/**
* Pre-construction configuration.
*/
@SuppressAjWarnings("adviceDidNotMatch")
- before(Object bean) :
- beanConstruction(bean) && preConstructionCondition() && inConfigurableBean() {
+ before(Object bean) :
+ beanConstruction(bean) && preConstructionCondition() && inConfigurableBean() {
configureBean(bean);
}
/**
* Post-construction configuration.
*/
@SuppressAjWarnings("adviceDidNotMatch")
- after(Object bean) returning :
+ after(Object bean) returning :
beanConstruction(bean) && postConstructionCondition() && inConfigurableBean() {
configureBean(bean);
}
-
+
/**
* Post-deserialization configuration.
*/
@SuppressAjWarnings("adviceDidNotMatch")
- after(Object bean) returning :
+ after(Object bean) returning :
beanDeserialization(bean) && inConfigurableBean() {
configureBean(bean);
}
-
+
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractInterfaceDrivenDependencyInjectionAspect.aj | @@ -26,7 +26,7 @@ import java.io.Serializable;
* upon deserialization. Subaspects need to simply provide definition for the configureBean() method. This
* method may be implemented without relying on Spring container if so desired.
* </p>
- * <p>
+ * <p>
* There are two cases that needs to be handled:
* <ol>
* <li>Normal object creation via the '<code>new</code>' operator: this is
@@ -37,24 +37,24 @@ import java.io.Serializable;
* require user classes to implement any specific method. This implies that
* we need to <i>introduce</i> the chosen method. We should also handle the cases
* where the chosen method is already implemented in classes (in which case,
- * the user's implementation for that method should take precedence over the
+ * the user's implementation for that method should take precedence over the
* introduced implementation). There are a few choices for the chosen method:
* <ul>
* <li>readObject(ObjectOutputStream): Java requires that the method must be
- * <code>private</p>. Since aspects cannot introduce a private member,
+ * <code>private</p>. Since aspects cannot introduce a private member,
* while preserving its name, this option is ruled out.</li>
- * <li>readResolve(): Java doesn't pose any restriction on an access specifier.
- * Problem solved! There is one (minor) limitation of this approach in
- * that if a user class already has this method, that method must be
+ * <li>readResolve(): Java doesn't pose any restriction on an access specifier.
+ * Problem solved! There is one (minor) limitation of this approach in
+ * that if a user class already has this method, that method must be
* <code>public</code>. However, this shouldn't be a big burden, since
- * use cases that need classes to implement readResolve() (custom enums,
+ * use cases that need classes to implement readResolve() (custom enums,
* for example) are unlikely to be marked as @Configurable, and
* in any case asking to make that method <code>public</code> should not
* pose any undue burden.</li>
* </ul>
- * The minor collaboration needed by user classes (i.e., that the
- * implementation of <code>readResolve()</code>, if any, must be
- * <code>public</code>) can be lifted as well if we were to use an
+ * The minor collaboration needed by user classes (i.e., that the
+ * implementation of <code>readResolve()</code>, if any, must be
+ * <code>public</code>) can be lifted as well if we were to use an
* experimental feature in AspectJ - the <code>hasmethod()</code> PCD.</li>
* </ol>
@@ -63,55 +63,55 @@ import java.io.Serializable;
* is to use a 'declare parents' statement another aspect (a subaspect of this aspect would be a logical choice)
* that declares the classes that need to be configured by supplying the {@link ConfigurableObject} interface.
* </p>
- *
+ *
* @author Ramnivas Laddad
* @since 2.5.2
*/
public abstract aspect AbstractInterfaceDrivenDependencyInjectionAspect extends AbstractDependencyInjectionAspect {
/**
* Select initialization join point as object construction
*/
- public pointcut beanConstruction(Object bean) :
- initialization(ConfigurableObject+.new(..)) && this(bean);
+ public pointcut beanConstruction(Object bean) :
+ initialization(ConfigurableObject+.new(..)) && this(bean);
/**
* Select deserialization join point made available through ITDs for ConfigurableDeserializationSupport
*/
public pointcut beanDeserialization(Object bean) :
execution(Object ConfigurableDeserializationSupport+.readResolve()) &&
this(bean);
-
+
public pointcut leastSpecificSuperTypeConstruction() : initialization(ConfigurableObject.new(..));
-
-
-
+
+
+
// Implementation to support re-injecting dependencies once an object is deserialized
/**
- * Declare any class implementing Serializable and ConfigurableObject as also implementing
- * ConfigurableDeserializationSupport. This allows us to introduce the readResolve()
+ * Declare any class implementing Serializable and ConfigurableObject as also implementing
+ * ConfigurableDeserializationSupport. This allows us to introduce the readResolve()
* method and select it with the beanDeserialization() pointcut.
- *
+ *
* <p>Here is an improved version that uses the hasmethod() pointcut and lifts
* even the minor requirement on user classes:
*
* <pre class="code">declare parents: ConfigurableObject+ Serializable+
- * && !hasmethod(Object readResolve() throws ObjectStreamException)
+ * && !hasmethod(Object readResolve() throws ObjectStreamException)
* implements ConfigurableDeserializationSupport;
* </pre>
*/
- declare parents:
+ declare parents:
ConfigurableObject+ && Serializable+ implements ConfigurableDeserializationSupport;
-
+
/**
* A marker interface to which the <code>readResolve()</code> is introduced.
*/
static interface ConfigurableDeserializationSupport extends Serializable {
}
-
+
/**
* Introduce the <code>readResolve()</code> method so that we can advise its
* execution to configure the object.
- *
+ *
* <p>Note if a method with the same signature already exists in a
* <code>Serializable</code> class of ConfigurableObject type,
* that implementation will take precedence (a good thing, since we are | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AnnotationBeanConfigurerAspect.aj | @@ -43,15 +43,15 @@ import org.springframework.beans.factory.wiring.BeanConfigurerSupport;
* @see org.springframework.beans.factory.annotation.Configurable
* @see org.springframework.beans.factory.annotation.AnnotationBeanWiringInfoResolver
*/
-public aspect AnnotationBeanConfigurerAspect
+public aspect AnnotationBeanConfigurerAspect
extends AbstractInterfaceDrivenDependencyInjectionAspect
implements BeanFactoryAware, InitializingBean, DisposableBean {
private BeanConfigurerSupport beanConfigurerSupport = new BeanConfigurerSupport();
public pointcut inConfigurableBean() : @this(Configurable);
- public pointcut preConstructionConfiguration() : preConstructionConfigurationSupport(*);
+ public pointcut preConstructionConfiguration() : preConstructionConfigurationSupport(*);
declare parents: @Configurable * implements ConfigurableObject;
@@ -80,10 +80,10 @@ public aspect AnnotationBeanConfigurerAspect
private pointcut preConstructionConfigurationSupport(Configurable c) : @this(c) && if(c.preConstruction());
/*
- * This declaration shouldn't be needed,
+ * This declaration shouldn't be needed,
* except for an AspectJ bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=214559)
*/
- declare parents: @Configurable Serializable+
+ declare parents: @Configurable Serializable+
implements ConfigurableDeserializationSupport;
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/ConfigurableObject.java | @@ -17,7 +17,7 @@
/**
* Marker interface for domain object that need DI through aspects.
- *
+ *
* @author Ramnivas Laddad
* @since 2.5
*/ | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/GenericInterfaceDrivenDependencyInjectionAspect.aj | @@ -17,38 +17,38 @@ package org.springframework.beans.factory.aspectj;
/**
* Generic-based dependency injection aspect.
- * <p>
- * This aspect allows users to implement efficient, type-safe dependency injection without
+ * <p>
+ * This aspect allows users to implement efficient, type-safe dependency injection without
* the use of the @Configurable annotation.
- *
- * The subaspect of this aspect doesn't need to include any AOP constructs.
+ *
+ * The subaspect of this aspect doesn't need to include any AOP constructs.
* For example, here is a subaspect that configures the <code>PricingStrategyClient</code> objects.
* <pre>
- * aspect PricingStrategyDependencyInjectionAspect
+ * aspect PricingStrategyDependencyInjectionAspect
* extends GenericInterfaceDrivenDependencyInjectionAspect<PricingStrategyClient> {
* private PricingStrategy pricingStrategy;
- *
- * public void configure(PricingStrategyClient bean) {
- * bean.setPricingStrategy(pricingStrategy);
+ *
+ * public void configure(PricingStrategyClient bean) {
+ * bean.setPricingStrategy(pricingStrategy);
+ * }
+ *
+ * public void setPricingStrategy(PricingStrategy pricingStrategy) {
+ * this.pricingStrategy = pricingStrategy;
* }
- *
- * public void setPricingStrategy(PricingStrategy pricingStrategy) {
- * this.pricingStrategy = pricingStrategy;
- * }
* }
* </pre>
* @author Ramnivas Laddad
* @since 3.0.0
*/
public abstract aspect GenericInterfaceDrivenDependencyInjectionAspect<I> extends AbstractInterfaceDrivenDependencyInjectionAspect {
declare parents: I implements ConfigurableObject;
-
+
public pointcut inConfigurableBean() : within(I+);
-
+
public final void configureBean(Object bean) {
configure((I)bean);
}
-
- // Unfortunately, erasure used with generics won't allow to use the same named method
+
+ // Unfortunately, erasure used with generics won't allow to use the same named method
protected abstract void configure(I bean);
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/main/java/org/springframework/cache/aspectj/AbstractCacheAspect.aj | @@ -62,7 +62,7 @@ public abstract aspect AbstractCacheAspect extends CacheAspectSupport {
}
};
- return execute(aspectJInvoker, thisJoinPoint.getTarget(), method, thisJoinPoint.getArgs());
+ return execute(aspectJInvoker, thisJoinPoint.getTarget(), method, thisJoinPoint.getArgs());
}
/** | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/main/java/org/springframework/mock/staticmock/AbstractMethodMockingControl.aj | @@ -23,9 +23,9 @@ import java.util.List;
/**
* Abstract aspect to enable mocking of methods picked out by a pointcut.
* Sub-aspects must define the mockStaticsTestMethod() pointcut to
- * indicate call stacks when mocking should be triggered, and the
+ * indicate call stacks when mocking should be triggered, and the
* methodToMock() pointcut to pick out a method invocations to mock.
- *
+ *
* @author Rod Johnson
* @author Ramnivas Laddad
*/
@@ -42,29 +42,29 @@ public abstract aspect AbstractMethodMockingControl percflow(mockStaticsTestMeth
// Represents a list of expected calls to static entity methods
// Public to allow inserted code to access: is this normal??
public class Expectations {
-
+
// Represents an expected call to a static entity method
private class Call {
private final String signature;
private final Object[] args;
private Object responseObject; // return value or throwable
private CallResponse responseType = CallResponse.nothing;
-
+
public Call(String name, Object[] args) {
this.signature = name;
this.args = args;
}
-
+
public boolean hasResponseSpecified() {
return responseType != CallResponse.nothing;
}
-
+
public void setReturnVal(Object retVal) {
this.responseObject = retVal;
responseType = CallResponse.return_;
}
-
+
public void setThrow(Throwable throwable) {
this.responseObject = throwable;
responseType = CallResponse.throw_;
@@ -89,7 +89,7 @@ public abstract aspect AbstractMethodMockingControl percflow(mockStaticsTestMeth
}
}
}
-
+
private List<Call> calls = new LinkedList<Call>();
// Calls already verified
@@ -101,7 +101,7 @@ public abstract aspect AbstractMethodMockingControl percflow(mockStaticsTestMeth
+ " calls, received " + verified);
}
}
-
+
/**
* Validate the call and provide the expected return value
* @param lastSig
@@ -175,7 +175,7 @@ public abstract aspect AbstractMethodMockingControl percflow(mockStaticsTestMeth
return expectations.respond(thisJoinPointStaticPart.toLongString(), thisJoinPoint.getArgs());
}
}
-
+
public void expectReturnInternal(Object retVal) {
if (!recording) {
throw new IllegalStateException("Not recording: Cannot set return value"); | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/main/java/org/springframework/mock/staticmock/AnnotationDrivenStaticEntityMockingControl.aj | @@ -20,14 +20,14 @@ package org.springframework.mock.staticmock;
* Annotation-based aspect to use in test build to enable mocking static methods
* on JPA-annotated <code>@Entity</code> classes, as used by Roo for finders.
*
- * <p>Mocking will occur in the call stack of any method in a class (typically a test class)
- * that is annotated with the @MockStaticEntityMethods annotation.
+ * <p>Mocking will occur in the call stack of any method in a class (typically a test class)
+ * that is annotated with the @MockStaticEntityMethods annotation.
*
* <p>Also provides static methods to simplify the programming model for
* entering playback mode and setting expected return values.
*
* <p>Usage:
- * <ol>
+ * <ol>
* <li>Annotate a test class with @MockStaticEntityMethods.
* <li>In each test method, AnnotationDrivenStaticEntityMockingControl will begin in recording mode.
* Invoke static methods on Entity classes, with each recording-mode invocation
@@ -37,20 +37,20 @@ package org.springframework.mock.staticmock;
* <li>Call the code you wish to test that uses the static methods. Verification will
* occur automatically.
* </ol>
- *
+ *
* @author Rod Johnson
* @author Ramnivas Laddad
* @see MockStaticEntityMethods
*/
public aspect AnnotationDrivenStaticEntityMockingControl extends AbstractMethodMockingControl {
-
+
/**
* Stop recording mock calls and enter playback state
*/
public static void playback() {
AnnotationDrivenStaticEntityMockingControl.aspectOf().playbackInternal();
}
-
+
public static void expectReturn(Object retVal) {
AnnotationDrivenStaticEntityMockingControl.aspectOf().expectReturnInternal(retVal);
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/main/java/org/springframework/orm/jpa/aspectj/JpaExceptionTranslatorAspect.aj | @@ -10,13 +10,13 @@ import org.springframework.orm.jpa.EntityManagerFactoryUtils;
public aspect JpaExceptionTranslatorAspect {
pointcut entityManagerCall(): call(* EntityManager.*(..)) || call(* EntityManagerFactory.*(..)) || call(* EntityTransaction.*(..)) || call(* Query.*(..));
-
- after() throwing(RuntimeException re): entityManagerCall() {
+
+ after() throwing(RuntimeException re): entityManagerCall() {
DataAccessException dex = EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(re);
if (dex != null) {
throw dex;
} else {
throw re;
- }
- }
+ }
+ }
}
\ No newline at end of file | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/main/java/org/springframework/scheduling/aspectj/AbstractAsyncExecutionAspect.aj | @@ -28,7 +28,7 @@ import org.springframework.core.task.AsyncTaskExecutor;
/**
* Abstract aspect that routes selected methods asynchronously.
*
- * <p>This aspect needs to be injected with an implementation of
+ * <p>This aspect needs to be injected with an implementation of
* {@link Executor} to activate it for a specific thread pool.
* Otherwise it will simply delegate all calls synchronously.
* | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/main/java/org/springframework/transaction/aspectj/AnnotationTransactionAspect.aj | @@ -21,17 +21,17 @@ import org.springframework.transaction.annotation.Transactional;
/**
* Concrete AspectJ transaction aspect using Spring's @Transactional annotation.
- *
+ *
* <p>When using this aspect, you <i>must</i> annotate the implementation class
* (and/or methods within that class), <i>not</i> the interface (if any) that
- * the class implements. AspectJ follows Java's rule that annotations on
+ * the class implements. AspectJ follows Java's rule that annotations on
* interfaces are <i>not</i> inherited.
*
* <p>An @Transactional annotation on a class specifies the default transaction
* semantics for the execution of any <b>public</b> operation in the class.
*
* <p>An @Transactional annotation on a method within the class overrides the
- * default transaction semantics given by the class annotation (if present).
+ * default transaction semantics given by the class annotation (if present).
* Any method may be annotated (regardless of visibility).
* Annotating non-public methods directly is the only way
* to get transaction demarcation for the execution of such operations.
@@ -57,7 +57,7 @@ public aspect AnnotationTransactionAspect extends AbstractTransactionAspect {
execution(public * ((@Transactional *)+).*(..)) && within(@Transactional *);
/**
- * Matches the execution of any method with the
+ * Matches the execution of any method with the
* Transactional annotation.
*/
private pointcut executionOfTransactionalMethod() :
@@ -66,7 +66,7 @@ public aspect AnnotationTransactionAspect extends AbstractTransactionAspect {
/**
* Definition of pointcut from super aspect - matched join points
* will have Spring transaction management applied.
- */
+ */
protected pointcut transactionalMethodExecution(Object txObject) :
(executionOfAnyPublicMethodInAtTransactionalType()
|| executionOfTransactionalMethod() ) | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/test/java/org/springframework/aop/aspectj/autoproxy/AutoProxyWithCodeStyleAspectsTests.java | @@ -26,7 +26,7 @@
public class AutoProxyWithCodeStyleAspectsTests extends TestCase {
public void testNoAutoproxyingOfAjcCompiledAspects() {
- new ClassPathXmlApplicationContext("org/springframework/aop/aspectj/autoproxy/ajcAutoproxyTests.xml");
+ new ClassPathXmlApplicationContext("org/springframework/aop/aspectj/autoproxy/ajcAutoproxyTests.xml");
}
-
+
} | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/test/java/org/springframework/beans/INestedTestBean.java | @@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | true |
Other | spring-projects | spring-framework | 1762157ad1a89ff8778387a2c72a8e36ff341a40.json | Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
xargs perl -p -i -e "s/[ \t]*$//g" {} \;
Issue: SPR-10127 | spring-aspects/src/test/java/org/springframework/beans/IOther.java | @@ -1,13 +1,13 @@
/*
* Copyright 2002-2005 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
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.