This is an automated email from the ASF dual-hosted git repository. rfscholte pushed a commit to branch MNG-7063 in repository https://gitbox.apache.org/repos/asf/maven.git
commit e30f2c8e5549a5480561d636c24b252628fd03fe Author: Guillaume Nodet <gno...@gmail.com> AuthorDate: Sat Nov 28 21:54:29 2020 +0100 Make sure ModelCacheTag.FILEMODEL is always and only used in readModel() # Conflicts: # maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java --- .../maven/model/building/DefaultModelBuilder.java | 27 +--------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index ebe0336..9417619 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java @@ -592,7 +592,7 @@ public class DefaultModelBuilder throws ModelBuildingException { ModelSource modelSource = request.getModelSource(); - Model model = getModelFromCache( modelSource, request.getModelCache() ); + Model model = fromCache( request.getModelCache(), modelSource, ModelCacheTag.FILE ); if ( model != null ) { return model; @@ -780,31 +780,6 @@ public class DefaultModelBuilder return rawModel; } - private Model getModelFromCache( Source source, ModelCache cache ) - { - Model model; - if ( source instanceof ArtifactModelSource ) - { - ArtifactModelSource artifactModelSource = ( ArtifactModelSource ) source; - ModelData modelData = fromCache( cache, artifactModelSource.getGroupId(), - artifactModelSource.getArtifactId(), - artifactModelSource.getVersion(), ModelCacheTag.RAW ); - if ( modelData != null ) - { - model = modelData.getModel(); - } - else - { - model = null; - } - } - else - { - model = fromCache( cache, source, ModelCacheTag.FILE ); - } - return model; - } - private String getGroupId( Model model ) { String groupId = model.getGroupId();