matthiasblaesing commented on code in PR #5866:
URL: https://github.com/apache/netbeans/pull/5866#discussion_r1178075771


##########
enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/el/WebBeansELVariableResolver.java:
##########
@@ -101,29 +101,52 @@ private List<WebBean> getWebBeans(FileObject target, 
ResolverContext context) {
             return Collections.<WebBean>emptyList();
         } else {
             if (context.getContent(CONTENT_NAME) == null) {
-                context.setContent(CONTENT_NAME, 
getNamedBeans(jsfSupport.getWebBeansModel()));
+                if(jsfSupport.isJsf30Plus()){
+                    context.setContent(CONTENT_NAME, 
getJakartaNamedBeans(jsfSupport.getJakartaWebBeansModel()));
+                } else {
+                    context.setContent(CONTENT_NAME, 
getNamedBeans(jsfSupport.getWebBeansModel()));
+                }
             }
             return (List<WebBean>) context.getContent(CONTENT_NAME);
         }
     }
 
     private static List<WebBean> getNamedBeans(MetadataModel<WebBeansModel> 
webBeansModel) {
         try {
-            return webBeansModel.runReadAction(new 
MetadataModelAction<WebBeansModel, List<WebBean>>() {
-
-                @Override
-                public List<WebBean> run(WebBeansModel metadata) throws 
Exception {
-                    List<Element> namedElements = metadata.getNamedElements();
-                    List<WebBean> webBeans = new LinkedList<>();
-                    for (Element e : namedElements) {
-                        //filter out null elements - probably a WebBeansModel 
bug,
-                        //happens under some circumstances when 
renaming/deleting beans
-                        if (e != null) {
-                            webBeans.add(new WebBean(e, metadata.getName(e)));
-                        }
+            return webBeansModel.runReadAction((WebBeansModel metadata) -> {
+                List<Element> namedElements = metadata.getNamedElements();
+                List<WebBean> webBeans = new LinkedList<>();
+                for (Element e : namedElements) {
+                    //filter out null elements - probably a WebBeansModel bug,
+                    //happens under some circumstances when renaming/deleting 
beans
+                    if (e != null) {
+                        webBeans.add(new WebBean(e, metadata.getName(e)));
+                    }
+                }
+                return webBeans;
+            });
+        } catch (MetadataModelException ex) {
+            Exceptions.printStackTrace(ex);
+        } catch (IOException ex) {
+            Exceptions.printStackTrace(ex);
+        }
+
+        return Collections.emptyList();
+    }
+
+    private static List<WebBean> 
getJakartaNamedBeans(MetadataModel<org.netbeans.modules.jakarta.web.beans.api.model.WebBeansModel>
 webBeansModel) {
+        try {
+            return 
webBeansModel.runReadAction((org.netbeans.modules.jakarta.web.beans.api.model.WebBeansModel
 metadata) -> {

Review Comment:
   This lambda can be further stream lined to:
   
   ```java
               return webBeansModel.runReadAction(metadata -> {
                   List<Element> namedElements = metadata.getNamedElements();
                   List<WebBean> webBeans = new LinkedList<>();
                   for (Element e : namedElements) {
                       //filter out null elements - probably a WebBeansModel 
bug,
                       //happens under some circumstances when 
renaming/deleting beans
                       if (e != null) {
                           webBeans.add(new WebBean(e, metadata.getName(e)));
                       }
                   }
                   return webBeans;
               });
   ```



##########
java/java.lsp.server/nbcode/nbproject/platform.properties:
##########
@@ -173,7 +173,6 @@ disabled.modules=\
     org.netbeans.modules.java.graph,\
     org.netbeans.modules.java.hints.declarative.test,\
     org.netbeans.modules.java.hints.test,\
-    org.netbeans.modules.java.hints.ui,\

Review Comment:
   This removal look suspicous. In master this module is present.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to