offline building of site deploy to improve performance.
[utils] / support / cdi / src / main / java / org / wamblee / cdi / CdiInjector.java
index 46d434b4a3d4649123a777baab9da5db861b0da2..ccf716c97d988de7ce0c2bcec3ba844bacf45831 100644 (file)
@@ -20,6 +20,8 @@ import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.inject.spi.BeanManager;
 import javax.enterprise.inject.spi.InjectionTarget;
 
+import org.wamblee.inject.Injector;
+
 /**
  * Class encapsulating bean injection into a specific non-contextual object of a
  * given class.
@@ -54,7 +56,7 @@ public class CdiInjector implements Injector {
     public void inject(Object aComponent) {
         if (aComponent != null) {
             if (!clazz.isInstance(aComponent)) {
-                throw new RuntimeException("Object '" + aComponent +
+                throw new IllegalArgumentException("Object '" + aComponent +
                     "' is of type " + aComponent.getClass().getName() +
                     " but expected " + clazz.getName());
             }