myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (MYFACES-4235) PERF: DataModelBuilderProxy uses CDI.current().getBeanManager() rather than cached BeanManager in application map
Date Mon, 04 Jun 2018 21:00:00 GMT

    [ https://issues.apache.org/jira/browse/MYFACES-4235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16500843#comment-16500843
] 

ASF GitHub Bot commented on MYFACES-4235:
-----------------------------------------

pnicolucci closed pull request #4: MYFACES-4235: Use cached BeanManager
URL: https://github.com/apache/myfaces/pull/4
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/impl/src/main/java/org/apache/myfaces/cdi/model/DataModelBuilderProxy.java b/impl/src/main/java/org/apache/myfaces/cdi/model/DataModelBuilderProxy.java
index c1a21e8a7..45f2c7422 100644
--- a/impl/src/main/java/org/apache/myfaces/cdi/model/DataModelBuilderProxy.java
+++ b/impl/src/main/java/org/apache/myfaces/cdi/model/DataModelBuilderProxy.java
@@ -20,7 +20,6 @@
 package org.apache.myfaces.cdi.model;
 
 import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.CDI;
 import javax.faces.context.FacesContext;
 import javax.faces.model.DataModel;
 import org.apache.myfaces.cdi.util.CDIUtils;
@@ -34,7 +33,7 @@
     @Override
     public DataModel createDataModel(FacesContext facesContext, Class<?> forClass,
Object value)
     {
-        BeanManager beanManager = CDI.current().getBeanManager();
+        BeanManager beanManager = CDIUtils.getBeanManager(facesContext.getExternalContext());
         FacesDataModelClassBeanHolder holder = CDIUtils.lookup(beanManager, FacesDataModelClassBeanHolder.class);
         return holder.createDataModel(facesContext, forClass, value);
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> PERF: DataModelBuilderProxy uses CDI.current().getBeanManager() rather than cached BeanManager
in application map
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-4235
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4235
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-372
>    Affects Versions: 2.3.1
>            Reporter: Paul Nicolucci
>            Assignee: Paul Nicolucci
>            Priority: Minor
>             Fix For: 2.3.2
>
>
> Using the cached BeanManager is a performance improvement.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message