You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/12/03 16:45:54 UTC

[GitHub] [maven] gnodet commented on a diff in pull request #893: [MNG-7615] Multithreaded model builder

gnodet commented on code in PR #893:
URL: https://github.com/apache/maven/pull/893#discussion_r1038806942


##########
maven-model-builder/src/main/java/org/apache/maven/model/superpom/DefaultSuperPomProvider.java:
##########
@@ -52,8 +53,8 @@ public DefaultSuperPomProvider(ModelProcessor modelProcessor) {
 
     @Override
     public Model getSuperModel(String version) {
-        if (superModel == null) {
-            String resource = "/org/apache/maven/model/pom-" + version + ".xml";
+        return SUPER_MODELS.computeIfAbsent(version, v -> {

Review Comment:
   It could, though the only place it's called is with `4.0.0` afaik, and that's since ages.  I found the code does not reflect the javadoc and that the `version` parameter is not used, so I fixed it.
   If that's not intended, then we should remove the parameter completely.
   The version was originally hardcoded, see https://github.com/apache/maven/commit/dd635ca490bae271442d7b69eafdf595a627cafd
   The commit added a version parameter, but it's only used the first time and subsequent calls return the cached version.
   
   As for having multiple superpoms, I think the problem is that the version has never been updated when the pom changed.  So not sure what the future will be for the supermom...
   



-- 
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: issues-unsubscribe@maven.apache.org

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