Skip to content

Commit b3add79

Browse files
committed
Polishing
1 parent d2e269e commit b3add79

File tree

3 files changed

+13
-22
lines changed

3 files changed

+13
-22
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/support/ReplaceOverride.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,28 +69,22 @@ public void addTypeIdentifier(String identifier) {
6969
this.typeIdentifiers.add(identifier);
7070
}
7171

72-
7372
@Override
7473
public boolean matches(Method method) {
75-
// TODO could cache result for efficiency
7674
if (!method.getName().equals(getMethodName())) {
77-
// It can't match.
7875
return false;
7976
}
80-
8177
if (!isOverloaded()) {
82-
// No overloaded: don't worry about arg type matching.
78+
// Not overloaded: don't worry about arg type matching...
8379
return true;
8480
}
85-
86-
// If we get to here, we need to insist on precise argument matching.
81+
// If we get here, we need to insist on precise argument matching...
8782
if (this.typeIdentifiers.size() != method.getParameterTypes().length) {
8883
return false;
8984
}
9085
for (int i = 0; i < this.typeIdentifiers.size(); i++) {
9186
String identifier = this.typeIdentifiers.get(i);
9287
if (!method.getParameterTypes()[i].getName().contains(identifier)) {
93-
// This parameter cannot match.
9488
return false;
9589
}
9690
}

spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTestTypes.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,24 +27,26 @@
2727
import javax.sql.DataSource;
2828

2929
import org.springframework.beans.BeansException;
30-
import org.springframework.tests.sample.beans.ITestBean;
31-
import org.springframework.tests.sample.beans.IndexedTestBean;
32-
import org.springframework.tests.sample.beans.TestBean;
3330
import org.springframework.beans.factory.BeanFactory;
3431
import org.springframework.beans.factory.BeanFactoryAware;
3532
import org.springframework.beans.factory.BeanNameAware;
3633
import org.springframework.beans.factory.DisposableBean;
37-
import org.springframework.tests.sample.beans.factory.DummyFactory;
3834
import org.springframework.beans.factory.InitializingBean;
3935
import org.springframework.beans.factory.config.BeanPostProcessor;
4036
import org.springframework.beans.factory.support.MethodReplacer;
37+
import org.springframework.tests.sample.beans.ITestBean;
38+
import org.springframework.tests.sample.beans.IndexedTestBean;
39+
import org.springframework.tests.sample.beans.TestBean;
40+
import org.springframework.tests.sample.beans.factory.DummyFactory;
4141

4242
/**
4343
* Types used by {@link XmlBeanFactoryTests} and its attendant XML config files.
4444
*
4545
* @author Chris Beams
4646
*/
47-
final class XmlBeanFactoryTestTypes { }
47+
final class XmlBeanFactoryTestTypes {
48+
}
49+
4850

4951
/**
5052
* Simple bean used to check constructor dependency checking.
@@ -176,15 +178,10 @@ public ITestBean getTestBean() {
176178

177179
protected abstract FactoryMethods createFactoryMethods();
178180

179-
/**
180-
* @return Returns the setterString.
181-
*/
182181
public String getSetterString() {
183182
return setterString;
184183
}
185-
/**
186-
* @param setterString The setterString to set.
187-
*/
184+
188185
public void setSetterString(String setterString) {
189186
this.setterString = setterString;
190187
}
@@ -502,7 +499,7 @@ public TestBean getPrototypeDependency(Object someParam) {
502499
return new TestBean();
503500
}
504501

505-
public TestBean invokesOverridenMethodOnSelf() {
502+
public TestBean invokesOverriddenMethodOnSelf() {
506503
return getPrototypeDependency();
507504
}
508505

spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ private void lookupOverrideMethodsWithSetterInjection(BeanFactory xbf,
13321332
// This differs from Spring's AOP support, which has a distinct notion
13331333
// of a "target" object, meaning that the target needs explicit knowledge
13341334
// of AOP proxying to invoke an advised method on itself.
1335-
TestBean jenny3 = oom.invokesOverridenMethodOnSelf();
1335+
TestBean jenny3 = oom.invokesOverriddenMethodOnSelf();
13361336
assertEquals("Jenny", jenny3.getName());
13371337
assertNotSame(jenny1, jenny3);
13381338

0 commit comments

Comments
 (0)