Replace space indentation with tabs
Issue: SPR-10127
This commit is contained in:
committed by
Chris Beams
parent
1762157ad1
commit
2cf45bad86
@@ -1257,7 +1257,7 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
|
||||
*/
|
||||
protected MessageSource getInternalParentMessageSource() {
|
||||
return (getParent() instanceof AbstractApplicationContext) ?
|
||||
((AbstractApplicationContext) getParent()).messageSource : getParent();
|
||||
((AbstractApplicationContext) getParent()).messageSource : getParent();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public class LocalSlsbInvokerInterceptor extends AbstractSlsbInvokerInterceptor
|
||||
}
|
||||
catch (IllegalAccessException ex) {
|
||||
throw new EjbAccessException("Could not access method [" + invocation.getMethod().getName() +
|
||||
"] of local EJB [" + getJndiName() + "]", ex);
|
||||
"] of local EJB [" + getJndiName() + "]", ex);
|
||||
}
|
||||
finally {
|
||||
if (ejb instanceof EJBLocalObject) {
|
||||
|
||||
@@ -106,7 +106,7 @@ public class SimpleRemoteSlsbInvokerInterceptor extends AbstractRemoteSlsbInvoke
|
||||
if (targetEx instanceof RemoteException) {
|
||||
RemoteException rex = (RemoteException) targetEx;
|
||||
throw RmiClientInterceptorUtils.convertRmiAccessException(
|
||||
invocation.getMethod(), rex, isConnectFailure(rex), getJndiName());
|
||||
invocation.getMethod(), rex, isConnectFailure(rex), getJndiName());
|
||||
}
|
||||
else if (targetEx instanceof CreateException) {
|
||||
throw RmiClientInterceptorUtils.convertRmiAccessException(
|
||||
|
||||
@@ -190,8 +190,8 @@ public class JndiRmiClientInterceptor extends JndiObjectLocator implements Metho
|
||||
else if (getServiceInterface() != null) {
|
||||
boolean isImpl = getServiceInterface().isInstance(remoteObj);
|
||||
logger.debug("Using service interface [" + getServiceInterface().getName() +
|
||||
"] for JNDI RMI object [" + getJndiName() + "] - " +
|
||||
(!isImpl ? "not " : "") + "directly implemented");
|
||||
"] for JNDI RMI object [" + getJndiName() + "] - " +
|
||||
(!isImpl ? "not " : "") + "directly implemented");
|
||||
}
|
||||
}
|
||||
if (this.cacheStub) {
|
||||
@@ -426,7 +426,7 @@ public class JndiRmiClientInterceptor extends JndiObjectLocator implements Metho
|
||||
* @see org.springframework.remoting.support.RemoteInvocation
|
||||
*/
|
||||
protected Object doInvoke(MethodInvocation methodInvocation, RmiInvocationHandler invocationHandler)
|
||||
throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
|
||||
throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
|
||||
|
||||
if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
|
||||
return "RMI invoker proxy for service URL [" + getJndiName() + "]";
|
||||
|
||||
@@ -152,8 +152,8 @@ public class RmiClientInterceptor extends RemoteInvocationBasedAccessor
|
||||
else if (getServiceInterface() != null) {
|
||||
boolean isImpl = getServiceInterface().isInstance(remoteObj);
|
||||
logger.debug("Using service interface [" + getServiceInterface().getName() +
|
||||
"] for RMI stub [" + getServiceUrl() + "] - " +
|
||||
(!isImpl ? "not " : "") + "directly implemented");
|
||||
"] for RMI stub [" + getServiceUrl() + "] - " +
|
||||
(!isImpl ? "not " : "") + "directly implemented");
|
||||
}
|
||||
}
|
||||
if (this.cacheStub) {
|
||||
|
||||
@@ -54,6 +54,6 @@ public interface RmiInvocationHandler extends Remote {
|
||||
* @throws InvocationTargetException if the method invocation resulted in an exception
|
||||
*/
|
||||
public Object invoke(RemoteInvocation invocation)
|
||||
throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
|
||||
throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
|
||||
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class RmiInvocationWrapper implements RmiInvocationHandler {
|
||||
* @see RmiBasedExporter#invoke(org.springframework.remoting.support.RemoteInvocation, Object)
|
||||
*/
|
||||
public Object invoke(RemoteInvocation invocation)
|
||||
throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
|
||||
throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
|
||||
|
||||
return this.rmiExporter.invoke(invocation, this.wrappedObject);
|
||||
}
|
||||
|
||||
@@ -678,8 +678,8 @@ public final class ProxyFactoryBeanTests {
|
||||
public void testFrozenFactoryBean() {
|
||||
BeanFactory bf = new XmlBeanFactory(new ClassPathResource(FROZEN_CONTEXT, CLASS));
|
||||
|
||||
Advised advised = (Advised)bf.getBean("frozen");
|
||||
assertTrue("The proxy should be frozen", advised.isFrozen());
|
||||
Advised advised = (Advised)bf.getBean("frozen");
|
||||
assertTrue("The proxy should be frozen", advised.isFrozen());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -46,7 +46,7 @@ public class AutowiredConfigurationTests {
|
||||
@Test
|
||||
public void testAutowiredConfigurationDependencies() {
|
||||
ClassPathXmlApplicationContext factory = new ClassPathXmlApplicationContext(
|
||||
AutowiredConfigurationTests.class.getSimpleName() + ".xml", AutowiredConfigurationTests.class);
|
||||
AutowiredConfigurationTests.class.getSimpleName() + ".xml", AutowiredConfigurationTests.class);
|
||||
|
||||
assertThat(factory.getBean("colour", Colour.class), equalTo(Colour.RED));
|
||||
assertThat(factory.getBean("testBean", TestBean.class).getName(), equalTo(Colour.RED.toString()));
|
||||
@@ -100,7 +100,7 @@ public class AutowiredConfigurationTests {
|
||||
@Test
|
||||
public void testValueInjection() {
|
||||
ClassPathXmlApplicationContext factory = new ClassPathXmlApplicationContext(
|
||||
"ValueInjectionTests.xml", AutowiredConfigurationTests.class);
|
||||
"ValueInjectionTests.xml", AutowiredConfigurationTests.class);
|
||||
|
||||
System.clearProperty("myProp");
|
||||
|
||||
@@ -155,7 +155,7 @@ public class AutowiredConfigurationTests {
|
||||
@Test
|
||||
public void testCustomProperties() {
|
||||
ClassPathXmlApplicationContext factory = new ClassPathXmlApplicationContext(
|
||||
"AutowiredConfigurationTests-custom.xml", AutowiredConfigurationTests.class);
|
||||
"AutowiredConfigurationTests-custom.xml", AutowiredConfigurationTests.class);
|
||||
|
||||
TestBean testBean = factory.getBean("testBean", TestBean.class);
|
||||
assertThat(testBean.getName(), equalTo("localhost"));
|
||||
|
||||
@@ -42,140 +42,140 @@ import org.springframework.context.annotation.ImportResource;
|
||||
* @author Juergen Hoeller
|
||||
*/
|
||||
public class ImportResourceTests {
|
||||
@Test
|
||||
public void testImportXml() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ImportXmlConfig.class);
|
||||
assertTrue("did not contain java-declared bean", ctx.containsBean("javaDeclaredBean"));
|
||||
assertTrue("did not contain xml-declared bean", ctx.containsBean("xmlDeclaredBean"));
|
||||
@Test
|
||||
public void testImportXml() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ImportXmlConfig.class);
|
||||
assertTrue("did not contain java-declared bean", ctx.containsBean("javaDeclaredBean"));
|
||||
assertTrue("did not contain xml-declared bean", ctx.containsBean("xmlDeclaredBean"));
|
||||
TestBean tb = ctx.getBean("javaDeclaredBean", TestBean.class);
|
||||
assertEquals("myName", tb.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ImportResource("classpath:org/springframework/context/annotation/configuration/ImportXmlConfig-context.xml")
|
||||
static class ImportXmlConfig {
|
||||
@Configuration
|
||||
@ImportResource("classpath:org/springframework/context/annotation/configuration/ImportXmlConfig-context.xml")
|
||||
static class ImportXmlConfig {
|
||||
@Value("${name}")
|
||||
private String name;
|
||||
public @Bean TestBean javaDeclaredBean() {
|
||||
return new TestBean(this.name);
|
||||
}
|
||||
}
|
||||
public @Bean TestBean javaDeclaredBean() {
|
||||
return new TestBean(this.name);
|
||||
}
|
||||
}
|
||||
|
||||
@Ignore // TODO: SPR-6310
|
||||
@Test
|
||||
public void testImportXmlWithRelativePath() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ImportXmlWithRelativePathConfig.class);
|
||||
assertTrue("did not contain java-declared bean", ctx.containsBean("javaDeclaredBean"));
|
||||
assertTrue("did not contain xml-declared bean", ctx.containsBean("xmlDeclaredBean"));
|
||||
@Ignore // TODO: SPR-6310
|
||||
@Test
|
||||
public void testImportXmlWithRelativePath() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ImportXmlWithRelativePathConfig.class);
|
||||
assertTrue("did not contain java-declared bean", ctx.containsBean("javaDeclaredBean"));
|
||||
assertTrue("did not contain xml-declared bean", ctx.containsBean("xmlDeclaredBean"));
|
||||
TestBean tb = ctx.getBean("javaDeclaredBean", TestBean.class);
|
||||
assertEquals("myName", tb.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ImportResource("ImportXmlConfig-context.xml")
|
||||
static class ImportXmlWithRelativePathConfig {
|
||||
public @Bean TestBean javaDeclaredBean() {
|
||||
return new TestBean("java.declared");
|
||||
}
|
||||
}
|
||||
@Configuration
|
||||
@ImportResource("ImportXmlConfig-context.xml")
|
||||
static class ImportXmlWithRelativePathConfig {
|
||||
public @Bean TestBean javaDeclaredBean() {
|
||||
return new TestBean("java.declared");
|
||||
}
|
||||
}
|
||||
|
||||
@Ignore // TODO: SPR-6310
|
||||
@Test
|
||||
public void testImportXmlByConvention() {
|
||||
ApplicationContext ctx = new AnnotationConfigApplicationContext(ImportXmlByConventionConfig.class);
|
||||
assertTrue("context does not contain xml-declared bean", ctx.containsBean("xmlDeclaredBean"));
|
||||
}
|
||||
@Ignore // TODO: SPR-6310
|
||||
@Test
|
||||
public void testImportXmlByConvention() {
|
||||
ApplicationContext ctx = new AnnotationConfigApplicationContext(ImportXmlByConventionConfig.class);
|
||||
assertTrue("context does not contain xml-declared bean", ctx.containsBean("xmlDeclaredBean"));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
//@ImportXml
|
||||
static class ImportXmlByConventionConfig {
|
||||
}
|
||||
@Configuration
|
||||
//@ImportXml
|
||||
static class ImportXmlByConventionConfig {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testImportXmlIsInheritedFromSuperclassDeclarations() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(FirstLevelSubConfig.class);
|
||||
assertTrue(ctx.containsBean("xmlDeclaredBean"));
|
||||
}
|
||||
@Test
|
||||
public void testImportXmlIsInheritedFromSuperclassDeclarations() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(FirstLevelSubConfig.class);
|
||||
assertTrue(ctx.containsBean("xmlDeclaredBean"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testImportXmlIsMergedFromSuperclassDeclarations() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SecondLevelSubConfig.class);
|
||||
assertTrue("failed to pick up second-level-declared XML bean", ctx.containsBean("secondLevelXmlDeclaredBean"));
|
||||
assertTrue("failed to pick up parent-declared XML bean", ctx.containsBean("xmlDeclaredBean"));
|
||||
}
|
||||
@Test
|
||||
public void testImportXmlIsMergedFromSuperclassDeclarations() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SecondLevelSubConfig.class);
|
||||
assertTrue("failed to pick up second-level-declared XML bean", ctx.containsBean("secondLevelXmlDeclaredBean"));
|
||||
assertTrue("failed to pick up parent-declared XML bean", ctx.containsBean("xmlDeclaredBean"));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ImportResource("classpath:org/springframework/context/annotation/configuration/ImportXmlConfig-context.xml")
|
||||
static class BaseConfig {
|
||||
}
|
||||
@Configuration
|
||||
@ImportResource("classpath:org/springframework/context/annotation/configuration/ImportXmlConfig-context.xml")
|
||||
static class BaseConfig {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
static class FirstLevelSubConfig extends BaseConfig {
|
||||
}
|
||||
@Configuration
|
||||
static class FirstLevelSubConfig extends BaseConfig {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ImportResource("classpath:org/springframework/context/annotation/configuration/SecondLevelSubConfig-context.xml")
|
||||
static class SecondLevelSubConfig extends BaseConfig {
|
||||
}
|
||||
@Configuration
|
||||
@ImportResource("classpath:org/springframework/context/annotation/configuration/SecondLevelSubConfig-context.xml")
|
||||
static class SecondLevelSubConfig extends BaseConfig {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testImportXmlWithNamespaceConfig() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ImportXmlWithAopNamespaceConfig.class);
|
||||
Object bean = ctx.getBean("proxiedXmlBean");
|
||||
assertTrue(AopUtils.isAopProxy(bean));
|
||||
}
|
||||
@Test
|
||||
public void testImportXmlWithNamespaceConfig() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ImportXmlWithAopNamespaceConfig.class);
|
||||
Object bean = ctx.getBean("proxiedXmlBean");
|
||||
assertTrue(AopUtils.isAopProxy(bean));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ImportResource("classpath:org/springframework/context/annotation/configuration/ImportXmlWithAopNamespace-context.xml")
|
||||
static class ImportXmlWithAopNamespaceConfig {
|
||||
}
|
||||
@Configuration
|
||||
@ImportResource("classpath:org/springframework/context/annotation/configuration/ImportXmlWithAopNamespace-context.xml")
|
||||
static class ImportXmlWithAopNamespaceConfig {
|
||||
}
|
||||
|
||||
@Aspect
|
||||
static class AnAspect {
|
||||
@Before("execution(* test.beans.TestBean.*(..))")
|
||||
public void advice() { }
|
||||
}
|
||||
@Aspect
|
||||
static class AnAspect {
|
||||
@Before("execution(* test.beans.TestBean.*(..))")
|
||||
public void advice() { }
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testImportXmlWithAutowiredConfig() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ImportXmlAutowiredConfig.class);
|
||||
String name = ctx.getBean("xmlBeanName", String.class);
|
||||
assertThat(name, equalTo("xml.declared"));
|
||||
}
|
||||
@Test
|
||||
public void testImportXmlWithAutowiredConfig() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ImportXmlAutowiredConfig.class);
|
||||
String name = ctx.getBean("xmlBeanName", String.class);
|
||||
assertThat(name, equalTo("xml.declared"));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ImportResource(value="classpath:org/springframework/context/annotation/configuration/ImportXmlConfig-context.xml")
|
||||
static class ImportXmlAutowiredConfig {
|
||||
@Autowired TestBean xmlDeclaredBean;
|
||||
@Configuration
|
||||
@ImportResource(value="classpath:org/springframework/context/annotation/configuration/ImportXmlConfig-context.xml")
|
||||
static class ImportXmlAutowiredConfig {
|
||||
@Autowired TestBean xmlDeclaredBean;
|
||||
|
||||
public @Bean String xmlBeanName() {
|
||||
return xmlDeclaredBean.getName();
|
||||
}
|
||||
}
|
||||
public @Bean String xmlBeanName() {
|
||||
return xmlDeclaredBean.getName();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testImportNonXmlResource() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ImportNonXmlResourceConfig.class);
|
||||
assertTrue(ctx.containsBean("propertiesDeclaredBean"));
|
||||
}
|
||||
@Test
|
||||
public void testImportNonXmlResource() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ImportNonXmlResourceConfig.class);
|
||||
assertTrue(ctx.containsBean("propertiesDeclaredBean"));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ImportResource(value="classpath:org/springframework/context/annotation/configuration/ImportNonXmlResourceConfig-context.properties",
|
||||
reader=PropertiesBeanDefinitionReader.class)
|
||||
static class ImportNonXmlResourceConfig {
|
||||
}
|
||||
@Configuration
|
||||
@ImportResource(value="classpath:org/springframework/context/annotation/configuration/ImportNonXmlResourceConfig-context.properties",
|
||||
reader=PropertiesBeanDefinitionReader.class)
|
||||
static class ImportNonXmlResourceConfig {
|
||||
}
|
||||
|
||||
@Ignore // TODO: SPR-6327
|
||||
@Test
|
||||
public void testImportDifferentResourceTypes() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SubResourceConfig.class);
|
||||
assertTrue(ctx.containsBean("propertiesDeclaredBean"));
|
||||
assertTrue(ctx.containsBean("xmlDeclaredBean"));
|
||||
}
|
||||
@Ignore // TODO: SPR-6327
|
||||
@Test
|
||||
public void testImportDifferentResourceTypes() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SubResourceConfig.class);
|
||||
assertTrue(ctx.containsBean("propertiesDeclaredBean"));
|
||||
assertTrue(ctx.containsBean("xmlDeclaredBean"));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ImportResource(value="classpath:org/springframework/context/annotation/configuration/ImportXmlConfig-context.xml",
|
||||
reader=XmlBeanDefinitionReader.class)
|
||||
static class SubResourceConfig extends ImportNonXmlResourceConfig {
|
||||
}
|
||||
}
|
||||
@Configuration
|
||||
@ImportResource(value="classpath:org/springframework/context/annotation/configuration/ImportXmlConfig-context.xml",
|
||||
reader=XmlBeanDefinitionReader.class)
|
||||
static class SubResourceConfig extends ImportNonXmlResourceConfig {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,8 +319,7 @@ public final class ClassPathXmlApplicationContextTests {
|
||||
|
||||
@Test
|
||||
public void testResourceAndInputStream() throws IOException {
|
||||
ClassPathXmlApplicationContext ctx =
|
||||
new ClassPathXmlApplicationContext(RESOURCE_CONTEXT) {
|
||||
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(RESOURCE_CONTEXT) {
|
||||
public Resource getResource(String location) {
|
||||
if (TEST_PROPERTIES.equals(location)) {
|
||||
return new ClassPathResource(TEST_PROPERTIES, ClassPathXmlApplicationContextTests.class);
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.aop.ThrowsAdvice;
|
||||
public class NoOpAdvice implements ThrowsAdvice {
|
||||
|
||||
public void afterThrowing(Exception ex) throws Throwable {
|
||||
// no-op
|
||||
// no-op
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,22 +27,22 @@ import org.junit.Test;
|
||||
*/
|
||||
public class Spr7283Tests {
|
||||
|
||||
@Test
|
||||
public void testListWithInconsistentElementType() {
|
||||
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("spr7283.xml", getClass());
|
||||
@Test
|
||||
public void testListWithInconsistentElementType() {
|
||||
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("spr7283.xml", getClass());
|
||||
List list = ctx.getBean("list", List.class);
|
||||
assertEquals(2, list.size());
|
||||
assertTrue(list.get(0) instanceof A);
|
||||
assertTrue(list.get(1) instanceof B);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class A {
|
||||
public A() {}
|
||||
}
|
||||
public static class A {
|
||||
public A() {}
|
||||
}
|
||||
|
||||
public static class B {
|
||||
public B() {}
|
||||
}
|
||||
public static class B {
|
||||
public B() {}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,17 +13,17 @@ public class LogUserAdvice implements MethodBeforeAdvice, ThrowsAdvice {
|
||||
|
||||
public void before(Method method, Object[] objects, Object o) throws Throwable {
|
||||
countBefore++;
|
||||
System.out.println("Method:"+method.getName());
|
||||
}
|
||||
System.out.println("Method:"+method.getName());
|
||||
}
|
||||
|
||||
public void afterThrowing(Exception e) throws Throwable {
|
||||
countThrows++;
|
||||
System.out.println("***********************************************************************************");
|
||||
System.out.println("Exception caught:");
|
||||
System.out.println("***********************************************************************************");
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
System.out.println("***********************************************************************************");
|
||||
System.out.println("Exception caught:");
|
||||
System.out.println("***********************************************************************************");
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
|
||||
public int getCountBefore() {
|
||||
return countBefore;
|
||||
|
||||
Reference in New Issue
Block a user