diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java
index 2a682a67559..ef479927dc7 100644
--- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java
+++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java
@@ -16,7 +16,10 @@
package org.springframework.beans.factory.config;
+import java.io.Serializable;
+
import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.util.Assert;
@@ -41,7 +44,7 @@ import org.springframework.util.Assert;
*
<beans>
*
* <!-- Prototype bean since we have state -->
- * <bean id="myService" class="a.b.c.MyService" singleton="false"/>
+ * <bean id="myService" class="a.b.c.MyService" scope="prototype"/>
*
* <bean id="myServiceFactory"
* class="org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean">
@@ -63,9 +66,9 @@ import org.springframework.util.Assert;
*
* public class MyClientBean {
*
- * private ObjectFactory myServiceFactory;
+ * private ObjectFactory<MyService> myServiceFactory;
*
- * public void setMyServiceFactory(ObjectFactory myServiceFactory) {
+ * public void setMyServiceFactory(ObjectFactory<MyService> myServiceFactory) {
* this.myServiceFactory = myServiceFactory;
* }
*
@@ -98,13 +101,10 @@ public class ObjectFactoryCreatingFactoryBean extends AbstractFactoryBean