You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2019/08/11 09:32:22 UTC

[maven] branch master updated: small refactoring in StringSearchModelInterpolator (removed unused variables, removed too open modifier 'protected')

This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/master by this push:
     new b893c3e  small refactoring in StringSearchModelInterpolator (removed unused variables, removed too open modifier 'protected')
b893c3e is described below

commit b893c3eca483e2de4c78ed0a6baf6568acda8b1f
Author: tibordigana <ti...@apache.org>
AuthorDate: Sun Aug 11 11:32:11 2019 +0200

    small refactoring in StringSearchModelInterpolator (removed unused variables, removed too open modifier 'protected')
---
 .../StringSearchModelInterpolator.java             | 35 +++++-----------------
 1 file changed, 7 insertions(+), 28 deletions(-)

diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java
index 279c388..ee5c8b0 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java
@@ -57,7 +57,6 @@ import javax.inject.Singleton;
 public class StringSearchModelInterpolator
     extends AbstractStringBasedModelInterpolator
 {
-
     private static final Map<Class<?>, InterpolateObjectAction.CacheItem> CACHED_ENTRIES =
         new ConcurrentHashMap<>( 80, 0.75f, 2 );
     // Empirical data from 3.x, actual =40
@@ -72,23 +71,19 @@ public class StringSearchModelInterpolator
                                    ModelProblemCollector problems )
     {
         interpolateObject( model, model, projectDir, config, problems );
-
         return model;
     }
 
-    protected void interpolateObject( Object obj, Model model, File projectDir, ModelBuildingRequest config,
-                                      final ModelProblemCollector problems )
+    void interpolateObject( Object obj, Model model, File projectDir, ModelBuildingRequest config,
+                            ModelProblemCollector problems )
     {
         List<? extends ValueSource> valueSources = createValueSources( model, projectDir, config, problems );
-        List<? extends InterpolationPostProcessor> postProcessors =
-            createPostProcessors( model, projectDir, config );
+        List<? extends InterpolationPostProcessor> postProcessors = createPostProcessors( model, projectDir, config );
 
         InnerInterpolator innerInterpolator = createInterpolator( valueSources, postProcessors, problems );
 
-        PrivilegedAction<Object> action;
-        action = new InterpolateObjectAction( obj, valueSources, postProcessors, innerInterpolator, problems );
+        PrivilegedAction<Object> action = new InterpolateObjectAction( obj, innerInterpolator, problems );
         AccessController.doPrivileged( action );
-
     }
 
     private InnerInterpolator createInterpolator( List<? extends ValueSource> valueSources,
@@ -138,24 +133,14 @@ public class StringSearchModelInterpolator
     private static final class InterpolateObjectAction
         implements PrivilegedAction<Object>
     {
-
         private final LinkedList<Object> interpolationTargets;
 
         private final InnerInterpolator interpolator;
 
-        private final List<? extends ValueSource> valueSources;
-
-        private final List<? extends InterpolationPostProcessor> postProcessors;
-
         private final ModelProblemCollector problems;
 
-        InterpolateObjectAction( Object target, List<? extends ValueSource> valueSources,
-                                 List<? extends InterpolationPostProcessor> postProcessors,
-                                 InnerInterpolator interpolator, ModelProblemCollector problems )
+        InterpolateObjectAction( Object target, InnerInterpolator interpolator, ModelProblemCollector problems )
         {
-            this.valueSources = valueSources;
-            this.postProcessors = postProcessors;
-
             this.interpolationTargets = new LinkedList<>();
             interpolationTargets.add( target );
 
@@ -173,11 +158,9 @@ public class StringSearchModelInterpolator
 
                 traverseObjectWithParents( obj.getClass(), obj );
             }
-
             return null;
         }
 
-
         private String interpolate( String value )
         {
             return interpolator.interpolate( value );
@@ -203,7 +186,6 @@ public class StringSearchModelInterpolator
             }
         }
 
-
         private CacheItem getCacheEntry( Class<?> cls )
         {
             CacheItem cacheItem = CACHED_ENTRIES.get( cls );
@@ -319,7 +301,6 @@ public class StringSearchModelInterpolator
                     }
                 }
                 this.fields = fields.toArray( new CacheField[0] );
-
             }
 
             public void interpolate( Object target, InterpolateObjectAction interpolateObjectAction )
@@ -330,7 +311,7 @@ public class StringSearchModelInterpolator
                 }
             }
 
-            public boolean isArray()
+            boolean isArray()
             {
                 return isArray;
             }
@@ -338,7 +319,7 @@ public class StringSearchModelInterpolator
 
         abstract static class CacheField
         {
-            protected final Field field;
+            final Field field;
 
             CacheField( Field field )
             {
@@ -543,7 +524,5 @@ public class StringSearchModelInterpolator
                 }
             }
         }
-
     }
-
 }