From b6c679a1272382aa95a1d8f65a823d38cf5b42df Mon Sep 17 00:00:00 2001 From: Kristian Rosenvold Date: Thu, 23 Aug 2012 18:55:46 +0000 Subject: [PATCH] o Removed unused methods/params git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1376648 13f79535-47bb-0310-9956-ffa450edef68 --- .../StringSearchModelInterpolator.java | 36 ++++--------------- 1 file changed, 7 insertions(+), 29 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 28a5273c3b..e7fb57c336 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 @@ -51,7 +51,7 @@ public class StringSearchModelInterpolator private static final Map, InterpolateObjectAction.CacheItem> cachedEntries = new ConcurrentHashMap, InterpolateObjectAction.CacheItem>( 80, 0.75f, 2 ); - // Empirical data from 3.x, actual =40 + // Empirical data from 3.x, actual =40 public Model interpolateModel( Model model, File projectDir, ModelBuildingRequest config, @@ -152,7 +152,7 @@ public class StringSearchModelInterpolator } else if ( cacheEntry.isQualifiedForInterpolation ) { - cacheEntry.interpolate( target, problems, this ); + cacheEntry.interpolate( target, this ); traverseObjectWithParents( cls.getSuperclass(), target ); } @@ -170,26 +170,6 @@ public class StringSearchModelInterpolator return cacheItem; } - private boolean isQualifiedForInterpolation( Class cls ) - { - return !cls.getName().startsWith( "java" ); - } - - private boolean isQualifiedForInterpolation( Field field, Class fieldType ) - { - if ( Map.class.equals( fieldType ) && "locations".equals( field.getName() ) ) - { - return false; - } - - if ( fieldType.isPrimitive() ) - { - return false; - } - - return !"parent".equals( field.getName() ); - } - private static void evaluateArray( Object target, InterpolateObjectAction ctx ) { int len = Array.getLength( target ); @@ -235,6 +215,7 @@ public class StringSearchModelInterpolator return false; } + //noinspection SimplifiableIfStatement if ( fieldType.isPrimitive() ) { return false; @@ -279,12 +260,11 @@ public class StringSearchModelInterpolator } - public void interpolate( Object target, ModelProblemCollector problems, - InterpolateObjectAction interpolateObjectAction ) + public void interpolate( Object target, InterpolateObjectAction interpolateObjectAction ) { for ( CacheField field : fields ) { - field.interpolate( target, problems, interpolateObjectAction ); + field.interpolate( target, interpolateObjectAction ); } } @@ -303,8 +283,7 @@ public class StringSearchModelInterpolator this.field = field; } - void interpolate( Object target, ModelProblemCollector problems, - InterpolateObjectAction interpolateObjectAction ) + void interpolate( Object target, InterpolateObjectAction interpolateObjectAction ) { synchronized ( field ) { @@ -470,9 +449,8 @@ public class StringSearchModelInterpolator { entry.setValue( interpolated ); } - catch ( UnsupportedOperationException e ) + catch ( UnsupportedOperationException ignore ) { - continue; } } }