@@ -93,7 +93,7 @@ public Object getBean(String name) throws BeansException {
93
93
94
94
if (bean instanceof FactoryBean && !BeanFactoryUtils .isFactoryDereference (name )) {
95
95
try {
96
- return ((FactoryBean ) bean ).getObject ();
96
+ return ((FactoryBean <?> ) bean ).getObject ();
97
97
}
98
98
catch (Exception ex ) {
99
99
throw new BeanCreationException (beanName , "FactoryBean threw exception on object creation" , ex );
@@ -141,18 +141,18 @@ public boolean containsBean(String name) {
141
141
public boolean isSingleton (String name ) throws NoSuchBeanDefinitionException {
142
142
Object bean = getBean (name );
143
143
// In case of FactoryBean, return singleton status of created object.
144
- return (bean instanceof FactoryBean && ((FactoryBean ) bean ).isSingleton ());
144
+ return (bean instanceof FactoryBean && ((FactoryBean <?> ) bean ).isSingleton ());
145
145
}
146
146
147
147
public boolean isPrototype (String name ) throws NoSuchBeanDefinitionException {
148
148
Object bean = getBean (name );
149
149
// In case of FactoryBean, return prototype status of created object.
150
- return ((bean instanceof SmartFactoryBean && ((SmartFactoryBean ) bean ).isPrototype ()) ||
151
- (bean instanceof FactoryBean && !((FactoryBean ) bean ).isSingleton ()));
150
+ return ((bean instanceof SmartFactoryBean && ((SmartFactoryBean <?> ) bean ).isPrototype ()) ||
151
+ (bean instanceof FactoryBean && !((FactoryBean <?> ) bean ).isSingleton ()));
152
152
}
153
153
154
- public boolean isTypeMatch (String name , Class targetType ) throws NoSuchBeanDefinitionException {
155
- Class type = getType (name );
154
+ public boolean isTypeMatch (String name , Class <?> targetType ) throws NoSuchBeanDefinitionException {
155
+ Class <?> type = getType (name );
156
156
return (targetType == null || (type != null && targetType .isAssignableFrom (type )));
157
157
}
158
158
@@ -167,7 +167,7 @@ public Class<?> getType(String name) throws NoSuchBeanDefinitionException {
167
167
168
168
if (bean instanceof FactoryBean && !BeanFactoryUtils .isFactoryDereference (name )) {
169
169
// If it's a FactoryBean, we want to look at what it creates, not the factory class.
170
- return ((FactoryBean ) bean ).getObjectType ();
170
+ return ((FactoryBean <?> ) bean ).getObjectType ();
171
171
}
172
172
return bean .getClass ();
173
173
}
@@ -193,18 +193,18 @@ public String[] getBeanDefinitionNames() {
193
193
return StringUtils .toStringArray (this .beans .keySet ());
194
194
}
195
195
196
- public String [] getBeanNamesForType (Class type ) {
196
+ public String [] getBeanNamesForType (Class <?> type ) {
197
197
return getBeanNamesForType (type , true , true );
198
198
}
199
199
200
- public String [] getBeanNamesForType (Class type , boolean includeNonSingletons , boolean includeFactoryBeans ) {
200
+ public String [] getBeanNamesForType (Class <?> type , boolean includeNonSingletons , boolean includeFactoryBeans ) {
201
201
boolean isFactoryType = (type != null && FactoryBean .class .isAssignableFrom (type ));
202
202
List <String > matches = new ArrayList <String >();
203
203
for (String name : this .beans .keySet ()) {
204
204
Object beanInstance = this .beans .get (name );
205
205
if (beanInstance instanceof FactoryBean && !isFactoryType ) {
206
206
if (includeFactoryBeans ) {
207
- Class objectType = ((FactoryBean ) beanInstance ).getObjectType ();
207
+ Class <?> objectType = ((FactoryBean <?> ) beanInstance ).getObjectType ();
208
208
if (objectType != null && (type == null || type .isAssignableFrom (objectType ))) {
209
209
matches .add (name );
210
210
}
@@ -237,8 +237,8 @@ public <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingle
237
237
if (beanInstance instanceof FactoryBean && !isFactoryType ) {
238
238
if (includeFactoryBeans ) {
239
239
// Match object created by FactoryBean.
240
- FactoryBean factory = (FactoryBean ) beanInstance ;
241
- Class objectType = factory .getObjectType ();
240
+ FactoryBean <?> factory = (FactoryBean <?> ) beanInstance ;
241
+ Class <?> objectType = factory .getObjectType ();
242
242
if ((includeNonSingletons || factory .isSingleton ()) &&
243
243
objectType != null && (type == null || type .isAssignableFrom (objectType ))) {
244
244
matches .put (beanName , getBean (beanName , type ));
0 commit comments