matthiasblaesing commented on code in PR #9077: URL: https://github.com/apache/netbeans/pull/9077#discussion_r2616249797
########## enterprise/web.jsf20/external/jakarta.faces-4.1.5-license.txt: ########## @@ -0,0 +1,93 @@ +Name: Jakarta Faces +Version: 4.1.3 +License: EPL-v20 +Description: Jakarta Faces 4.1.5 +Origin: Eclipse Foundation (https://repo1.maven.org/maven2/org/glassfish/jakarta.faces/4.1.5/) +Files: jakarta.faces-4.1.5.jar Review Comment: Just for information: This is only needed if the license file does not match the target filename. For the latter case take a jar, strip the `.jar`, append `-license.txt` and you have a matching name. ########## enterprise/web.jsf20/external/jakarta.faces-4.1.5-license.txt: ########## @@ -0,0 +1,93 @@ +Name: Jakarta Faces +Version: 4.1.3 Review Comment: This needs to match the filename. I.e. the license file declaring version `4.1.3` should be named `jakarta.faces-4.1.3-license.txt` and the file `jakarta.faces-4.1.5-license.txt` should declare version `4.1.5`. ########## enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/DefaultFaceletLibraries.java: ########## @@ -49,14 +50,27 @@ public class DefaultFaceletLibraries { private static DefaultFaceletLibraries INSTANCE; + + private static String getJarPath(JsfVersion version) { + if (version == null) { + version = JsfVersion.JSF_2_3; + } + return switch (version) { + case JSF_4_1 -> "modules/ext/jsf-4_1/jakarta.faces.jar"; + case JSF_4_0 -> "modules/ext/jsf-4_0/jakarta.faces.jar"; + case JSF_3_0 -> "modules/ext/jsf-3_0/jakarta.faces.jar"; + default -> "modules/ext/jsf-2_3/javax.faces.jar"; + }; + } + private File jsfImplJar; private Collection<FileObject> libraryDescriptorsFiles; private Map<String, FaceletsLibraryDescriptor> librariesDescriptors; private static Map<String, Library> jsf22FaceletPseudoLibraries; public static synchronized DefaultFaceletLibraries getInstance() { if (INSTANCE == null) { - INSTANCE = new DefaultFaceletLibraries(); + INSTANCE = new DefaultFaceletLibraries(JsfVersion.JSF_2_3); Review Comment: This makes me nervous. Shouldn't the callers of `getInstance` updated to get correctly versioned variants? You create an instance per Version and get `JsfVersion` as parameter. Having both singletons and explicitly created instances seems wrong to me. -- 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
