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 @@ private void traverseObjectWithParents( Class cls, Object target ) } else if ( cacheEntry.isQualifiedForInterpolation ) { - cacheEntry.interpolate( target, problems, this ); + cacheEntry.interpolate( target, this ); traverseObjectWithParents( cls.getSuperclass(), target ); } @@ -170,26 +170,6 @@ private CacheItem getCacheEntry( Class cls ) 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 @@ private boolean isQualifiedForInterpolation( Field field, Class fieldType ) return false; } + //noinspection SimplifiableIfStatement if ( fieldType.isPrimitive() ) { return false; @@ -279,12 +260,11 @@ else if ( Map.class.isAssignableFrom( type ) ) } - 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 @@ static abstract class CacheField this.field = field; } - void interpolate( Object target, ModelProblemCollector problems, - InterpolateObjectAction interpolateObjectAction ) + void interpolate( Object target, InterpolateObjectAction interpolateObjectAction ) { synchronized ( field ) { @@ -470,9 +449,8 @@ void doInterpolate( Object target, InterpolateObjectAction ctx ) { entry.setValue( interpolated ); } - catch ( UnsupportedOperationException e ) + catch ( UnsupportedOperationException ignore ) { - continue; } } }