Author: ivaynberg
Date: Wed Sep 23 04:50:17 2009
New Revision: 817963
URL: http://svn.apache.org/viewvc?rev=817963&view=rev
Log:
WICKET-2120
Modified:
wicket/branches/wicket-1.4.x/wicket-guice/.settings/org.eclipse.jdt.core.prefs
wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/GuiceComponentInjector.java
wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/GuiceProxyTargetLocator.java
wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/InjectionFlagCachingGuiceComponentInjector.java
Modified:
wicket/branches/wicket-1.4.x/wicket-guice/.settings/org.eclipse.jdt.core.prefs
URL:
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket-guice/.settings/org.eclipse.jdt.core.prefs?rev=817963&r1=817962&r2=817963&view=diff
==============================================================================
---
wicket/branches/wicket-1.4.x/wicket-guice/.settings/org.eclipse.jdt.core.prefs
(original)
+++
wicket/branches/wicket-1.4.x/wicket-guice/.settings/org.eclipse.jdt.core.prefs
Wed Sep 23 04:50:17 2009
@@ -1,4 +1,4 @@
-#Sun Jul 01 09:58:45 PDT 2007
+#Wed Aug 26 08:14:09 PDT 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
Modified:
wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/GuiceComponentInjector.java
URL:
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/GuiceComponentInjector.java?rev=817963&r1=817962&r2=817963&view=diff
==============================================================================
---
wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/GuiceComponentInjector.java
(original)
+++
wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/GuiceComponentInjector.java
Wed Sep 23 04:50:17 2009
@@ -195,27 +195,33 @@
inject(component);
}
- private Annotation findBindingAnnotation(Annotation[] annotations)
+ /**
+ *
+ * @param annotations
+ * @return
+ * @throws MoreThanOneBindingException
+ */
+ public static Annotation findBindingAnnotation(final Annotation[]
annotations)
throws MoreThanOneBindingException
{
Annotation bindingAnnotation = null;
// Work out if we have a BindingAnnotation on this parameter.
- for (int i = 0; i < annotations.length; i++)
+ for (Annotation annotation : annotations)
{
- if
(annotations[i].annotationType().getAnnotation(BindingAnnotation.class) != null)
+ if
(annotation.annotationType().getAnnotation(BindingAnnotation.class) != null)
{
if (bindingAnnotation != null)
{
throw new MoreThanOneBindingException();
}
- bindingAnnotation = annotations[i];
+ bindingAnnotation = annotation;
}
}
return bindingAnnotation;
}
- private static class MoreThanOneBindingException extends Exception
+ public static class MoreThanOneBindingException extends Exception
{
private static final long serialVersionUID = 1L;
}
Modified:
wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/GuiceProxyTargetLocator.java
URL:
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/GuiceProxyTargetLocator.java?rev=817963&r1=817962&r2=817963&view=diff
==============================================================================
---
wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/GuiceProxyTargetLocator.java
(original)
+++
wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/GuiceProxyTargetLocator.java
Wed Sep 23 04:50:17 2009
@@ -42,7 +42,7 @@
/** index of argument in the method being injected, or -1 for field */
private final int argIndex;
- GuiceProxyTargetLocator(Field field, Annotation bindingAnnotation,
boolean optional)
+ public GuiceProxyTargetLocator(Field field, Annotation
bindingAnnotation, boolean optional)
{
this.bindingAnnotation = bindingAnnotation;
this.optional = optional;
@@ -52,7 +52,7 @@
argIndex = -1;
}
- GuiceProxyTargetLocator(Method method, int argIndex, Annotation
bindingAnnotation,
+ public GuiceProxyTargetLocator(Method method, int argIndex, Annotation
bindingAnnotation,
boolean optional)
{
this.bindingAnnotation = bindingAnnotation;
Modified:
wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/InjectionFlagCachingGuiceComponentInjector.java
URL:
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/InjectionFlagCachingGuiceComponentInjector.java?rev=817963&r1=817962&r2=817963&view=diff
==============================================================================
---
wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/InjectionFlagCachingGuiceComponentInjector.java
(original)
+++
wicket/branches/wicket-1.4.x/wicket-guice/src/main/java/org/apache/wicket/guice/InjectionFlagCachingGuiceComponentInjector.java
Wed Sep 23 04:50:17 2009
@@ -30,7 +30,6 @@
import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.proxy.LazyInitProxyFactory;
-import com.google.inject.BindingAnnotation;
import com.google.inject.Inject;
import com.google.inject.Injector;
@@ -183,37 +182,5 @@
inject(component);
}
- /**
- *
- * @param annotations
- * @return
- * @throws MoreThanOneBindingException
- */
- private Annotation findBindingAnnotation(final Annotation[] annotations)
- throws MoreThanOneBindingException
- {
- Annotation bindingAnnotation = null;
- // Work out if we have a BindingAnnotation on this parameter.
- for (Annotation annotation : annotations)
- {
- if
(annotation.annotationType().getAnnotation(BindingAnnotation.class) != null)
- {
- if (bindingAnnotation != null)
- {
- throw new MoreThanOneBindingException();
- }
- bindingAnnotation = annotation;
- }
- }
- return bindingAnnotation;
- }
-
- /**
- *
- */
- private static class MoreThanOneBindingException extends Exception
- {
- private static final long serialVersionUID = 1L;
- }
}