pedrosans commented on code in PR #1369:
URL: https://github.com/apache/wicket/pull/1369#discussion_r2813501287


##########
wicket-cdi/src/main/java/org/apache/wicket/cdi/CdiConfiguration.java:
##########
@@ -61,46 +64,10 @@ public CdiConfiguration 
setPropagation(IConversationPropagation propagation)
 
        public BeanManager getBeanManager()
        {
-               return beanManager;
-       }
-
-       /**
-        * Sets a BeanManager that should be used at first.
-        * 
-        * @param beanManager
-        * @return this instance
-        */
-       public CdiConfiguration setBeanManager(BeanManager beanManager)
-       {
-
-               if (Application.exists() && 
CdiConfiguration.get(Application.get()) != null)
+               if (beanManager == null)
                        throw new IllegalStateException(
-                               "A CdiConfiguration is already set for the 
application.");
-
-               this.beanManager = beanManager;
-               return this;
-       }
-
-       public BeanManager getFallbackBeanManager()
-       {
-               return fallbackBeanManager;
-       }
-
-       /**
-        * Sets a BeanManager that should be used if all strategies to lookup a
-        * BeanManager fail. This can be used in scenarios where you do not have
-        * JNDI available and do not want to bootstrap the CDI provider. It 
should
-        * be noted that the fallback BeanManager can only be used within the
-        * context of a Wicket application (ie. Application.get() should return 
the
-        * application that was configured with this CdiConfiguration).
-        * 
-        * @param fallbackBeanManager
-        * @return this instance
-        */
-       public CdiConfiguration setFallbackBeanManager(BeanManager 
fallbackBeanManager)
-       {
-               this.fallbackBeanManager = fallbackBeanManager;
-               return this;
+                               "app not configured or no BeanManager was 
resolved during the configuration");

Review Comment:
   Because the message is inside CdiConfiguration#getBeanManager, I found it 
specific. Maybe to add actionable guidance would be enough: "Be sure to call 
CdiConfiguration#configure and to specify a BeanManager to CdiConfiguration or 
that one can be resolved by BeanManagerLookup." 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to