You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "slawekjaranowski (via GitHub)" <gi...@apache.org> on 2023/02/23 08:40:44 UTC

[GitHub] [maven] slawekjaranowski commented on a diff in pull request #1008: [MNG-7693] For older clients make OOTB defaults

slawekjaranowski commented on code in PR #1008:
URL: https://github.com/apache/maven/pull/1008#discussion_r1115372215


##########
maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java:
##########
@@ -999,6 +1000,9 @@ class InternalConfig {
     }
 
     private ModelCache createModelCache(RepositorySystemSession session) {
-        return modelCacheFactory.createCache(session);
+        // MNG-7693: for older clients (not injecting ModelCacheFactory), make this work OOTB w/ defaults
+        return modelCacheFactory != null
+                ? modelCacheFactory.createCache(session)
+                : new DefaultModelCacheFactory().createCache(session);

Review Comment:
   Can we save result to avoid many instances creation?
   How often this method is used?



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