Fixed type resolution for uninitialized factory-method declaration

Issue: SPR-11112
(cherry picked from commit 5dcd287)
This commit is contained in:
Juergen Hoeller
2013-12-10 13:12:32 +01:00
parent 71650c0a44
commit 8e52e650f4
7 changed files with 151 additions and 44 deletions

View File

@@ -55,11 +55,11 @@ public class FactoryMethods {
return new FactoryMethods(tb, name, num);
}
static FactoryMethods newInstance(TestBean tb, int num, Integer something) {
static ExtendedFactoryMethods newInstance(TestBean tb, int num, Integer something) {
if (something != null) {
throw new IllegalStateException("Should never be called with non-null value");
}
return new FactoryMethods(tb, null, num);
return new ExtendedFactoryMethods(tb, null, num);
}
@SuppressWarnings("unused")
@@ -120,4 +120,12 @@ public class FactoryMethods {
this.name = name;
}
public static class ExtendedFactoryMethods extends FactoryMethods {
ExtendedFactoryMethods(TestBean tb, String name, int num) {
super(tb, name, num);
}
}
}