Fixed type resolution for uninitialized factory-method declaration

Issue: SPR-11112
This commit is contained in:
Juergen Hoeller
2013-12-09 18:53:27 +01:00
parent a3b022aa48
commit 5dcd28761c
4 changed files with 119 additions and 13 deletions

View File

@@ -54,11 +54,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")
@@ -119,4 +119,12 @@ public class FactoryMethods {
this.name = name;
}
public static class ExtendedFactoryMethods extends FactoryMethods {
ExtendedFactoryMethods(TestBean tb, String name, int num) {
super(tb, name, num);
}
}
}