You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2008/06/19 19:00:17 UTC

svn commit: r669569 - /wicket/branches/wicket-1.3.x/jdk-1.5/wicket-spring-annot/src/main/java/org/apache/wicket/spring/injection/annot/AnnotProxyFieldValueFactory.java

Author: ivaynberg
Date: Thu Jun 19 10:00:16 2008
New Revision: 669569

URL: http://svn.apache.org/viewvc?rev=669569&view=rev
Log:
WICKET-613

Modified:
    wicket/branches/wicket-1.3.x/jdk-1.5/wicket-spring-annot/src/main/java/org/apache/wicket/spring/injection/annot/AnnotProxyFieldValueFactory.java

Modified: wicket/branches/wicket-1.3.x/jdk-1.5/wicket-spring-annot/src/main/java/org/apache/wicket/spring/injection/annot/AnnotProxyFieldValueFactory.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.5/wicket-spring-annot/src/main/java/org/apache/wicket/spring/injection/annot/AnnotProxyFieldValueFactory.java?rev=669569&r1=669568&r2=669569&view=diff
==============================================================================
--- wicket/branches/wicket-1.3.x/jdk-1.5/wicket-spring-annot/src/main/java/org/apache/wicket/spring/injection/annot/AnnotProxyFieldValueFactory.java (original)
+++ wicket/branches/wicket-1.3.x/jdk-1.5/wicket-spring-annot/src/main/java/org/apache/wicket/spring/injection/annot/AnnotProxyFieldValueFactory.java Thu Jun 19 10:00:16 2008
@@ -56,8 +56,7 @@
  */
 public class AnnotProxyFieldValueFactory implements IFieldValueFactory
 {
-	private ISpringContextLocator contextLocator;
-	private boolean failFast = true;
+	private final ISpringContextLocator contextLocator;
 
 	private final ConcurrentHashMap<SpringBeanLocator, Object> cache = new ConcurrentHashMap<SpringBeanLocator, Object>();
 
@@ -93,11 +92,6 @@
 				return cache.get(locator);
 			}
 
-			if (failFast)
-			{
-				testLocator(locator, fieldOwner, field);
-			}
-
 			Object proxy = LazyInitProxyFactory.createProxy(field.getType(), locator);
 			// only put the proxy into the cache if the bean is a singleton
 			if (locator.isSingletonBean())
@@ -113,39 +107,13 @@
 	}
 
 	/**
-	 * Tests if the locator can retrieve the bean it is responsible for.
-	 * 
-	 * @param locator
-	 * @param fieldOwner
-	 * @param field
-	 */
-	private void testLocator(SpringBeanLocator locator, Object fieldOwner, Field field)
-	{
-		try
-		{
-			locator.locateProxyTarget();
-		}
-		catch (Throwable e)
-		{
-			String errorMessage = "Could not locate spring bean of class [[" +
-					locator.getBeanType().getName() + "]] ";
-			if (locator.getBeanName() != null && locator.getBeanName().length() > 0)
-			{
-				errorMessage += "and id [[" + locator.getBeanName() + "]] ";
-			}
-			errorMessage += "needed in class [[" + fieldOwner.getClass().getName() + "]] field [[" +
-					field.getName() + "]]";
-			throw new RuntimeException(errorMessage, e);
-		}
-	}
-
-	/**
 	 * @param failFast
 	 *            true if the locator fails if a bean can't be located
 	 */
 	public void setFailFast(boolean failFast)
 	{
-		this.failFast = failFast;
+		throw new UnsupportedOperationException(
+				"This feature is no longer supported because it interferes with prototype beans. see WICKET-613.");
 	}
 
 	/**