You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "NicolaIsotta (via GitHub)" <gi...@apache.org> on 2025/06/25 19:58:26 UTC

[PR] Fix loading of IDE registered JSF libraries [netbeans]

NicolaIsotta opened a new pull request, #8623:
URL: https://github.com/apache/netbeans/pull/8623

   Just discoreved, opening a legacy ant web project, that the loading of JSF libraries registered in the IDE does not work. This commit fixes it.
   
   
   ---
   **^Add meaningful description above**
   
   <details open>
   <summary>Click to collapse/expand PR instructions</summary>
   
   By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
   
    - are all your own work, and you have the right to contribute them.
    - are contributed solely under the terms and conditions of the Apache License 2.0 (see section 5 of the license for more information).
   
   Please make sure (eg. `git log`) that all commits have a valid name and email address for you in the Author field.
   
   If you're a first time contributor, see the Contributing guidelines for more information.
   
   If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.
   
   ### PR approval and merge checklist:
   
   1. [ ] Was this PR [correctly labeled](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=240884239#PRsandYouAreviewerGuide-PRtriggeredCIJobs(conditionalCIpipeline)), did the right tests run? When did they run?
   2. [ ] Is this PR [squashed](https://cwiki.apache.org/confluence/display/NETBEANS/git%3A+squash+and+merge)?
   3. [ ] Are author name / email address correct? Are [co-authors](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors#creating-co-authored-commits-on-the-command-line) correctly listed? Do the commit messages need updates?
   3. [ ] Does the PR title and description still fit after the Nth iteration? Is the description sufficient to appear in the release notes?
   
   If this PR targets the delivery branch: [don't merge](https://cwiki.apache.org/confluence/display/NETBEANS/Pull+requests+for+delivery). ([full wiki article](https://cwiki.apache.org/confluence/display/NETBEANS/PRs+and+You+-+A+reviewer+Guide))
   
   </details>


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Fix loading of IDE registered JSF libraries [netbeans]

Posted by "NicolaIsotta (via GitHub)" <gi...@apache.org>.
NicolaIsotta commented on code in PR #8623:
URL: https://github.com/apache/netbeans/pull/8623#discussion_r2189521883


##########
enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanelVisual.java:
##########
@@ -153,15 +152,13 @@ public class JSFConfigurationPanelVisual extends javax.swing.JPanel implements H
     private static volatile boolean jsfLibrariesCacheDirty = true;
     private static final List<Library> JSF_LIBRARIES_CACHE = new CopyOnWriteArrayList<>();
 
-    /** Map used for faster seek of JSF registered libraries. */
-    private static final Map<Boolean, String> JSF_SEEKING_MAP = new LinkedHashMap<>(2);
-
-    static {
-        JSF_SEEKING_MAP.put(false, JSFUtils.EJB_STATELESS);    //NOI18N
-        JSF_SEEKING_MAP.put(true, JSFUtils.FACES_EXCEPTION);   //NOI18N
-        JSF_SEEKING_MAP.put(false, JSFUtils.JAKARTAEE_EJB_STATELESS);    //NOI18N
-        JSF_SEEKING_MAP.put(true, JSFUtils.JAKARTAEE_FACES_EXCEPTION);   //NOI18N
-    }
+    /** Maps used for faster seek of JSF/Jakarta Faces registered libraries. */
+    private static final Map<Boolean, String> JSF_SEEKING_MAP = Map.of(
+            false, JSFUtils.EJB_STATELESS,
+            true, JSFUtils.FACES_EXCEPTION);

Review Comment:
   fixed



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Fix loading of IDE registered JSF libraries [netbeans]

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on code in PR #8623:
URL: https://github.com/apache/netbeans/pull/8623#discussion_r2188486593


##########
enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanelVisual.java:
##########
@@ -153,15 +152,13 @@ public class JSFConfigurationPanelVisual extends javax.swing.JPanel implements H
     private static volatile boolean jsfLibrariesCacheDirty = true;
     private static final List<Library> JSF_LIBRARIES_CACHE = new CopyOnWriteArrayList<>();
 
-    /** Map used for faster seek of JSF registered libraries. */
-    private static final Map<Boolean, String> JSF_SEEKING_MAP = new LinkedHashMap<>(2);
-
-    static {
-        JSF_SEEKING_MAP.put(false, JSFUtils.EJB_STATELESS);    //NOI18N
-        JSF_SEEKING_MAP.put(true, JSFUtils.FACES_EXCEPTION);   //NOI18N
-        JSF_SEEKING_MAP.put(false, JSFUtils.JAKARTAEE_EJB_STATELESS);    //NOI18N
-        JSF_SEEKING_MAP.put(true, JSFUtils.JAKARTAEE_FACES_EXCEPTION);   //NOI18N
-    }
+    /** Maps used for faster seek of JSF/Jakarta Faces registered libraries. */
+    private static final Map<Boolean, String> JSF_SEEKING_MAP = Map.of(
+            false, JSFUtils.EJB_STATELESS,
+            true, JSFUtils.FACES_EXCEPTION);

Review Comment:
   This change is invalid. `Map#of` explicitly returns a map with undefined iteration order:
   
   > The iteration order of mappings is unspecified and is subject to change. 
   
   while `org.netbeans.modules.j2ee.common.ClasspathUtil.containsClass(List<URL>, Map<T, String>)` explictly states:
   
   > The value returned is the key of corresponding classname value in the classNames map. The priority of the classnames is determined by the Map iterator, so if the key values to be returned are distinct the Map with defined iteration should be used (such as [TreeMap](https://github.com/apache/netbeans/pull/8623/*9) or [LinkedHashMap](https://github.com/apache/netbeans/pull/8623/*10)).
   
   So the split looks correct, but the implementation needs to be adjusted.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Fix loading of IDE registered JSF libraries [netbeans]

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing merged PR #8623:
URL: https://github.com/apache/netbeans/pull/8623


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] Fix loading of IDE registered JSF libraries [netbeans]

Posted by "NicolaIsotta (via GitHub)" <gi...@apache.org>.
NicolaIsotta commented on PR #8623:
URL: https://github.com/apache/netbeans/pull/8623#issuecomment-3005991362

   To test:
   New Project -> Java with Ant -> Java Web -> Java Web -> Web Application -> Next -> Next -> Choose a Tomcat -> Next -> Check "Java Server Faces" and look at the "Registered Libraries" combo


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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