From 53fd3dd6fbafa7a0400fc2eea20b4adb16d7b8b6 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Thu, 21 Jul 2005 13:05:26 +0000 Subject: [PATCH] PR: MNG-567 fix off by one error git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@220058 13f79535-47bb-0310-9956-ffa450edef68 --- .../plugin/PluginParameterExpressionEvaluator.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java index 2dfaa8b1fe..6dbbadf7b3 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java @@ -85,19 +85,19 @@ public class PluginParameterExpressionEvaluator return expression; } - if ( expression.equals( "localRepository" ) ) + if ( "localRepository".equals( expression ) ) { value = context.getLocalRepository(); } - else if ( expression.equals( "session" ) ) + else if ( "session".equals( expression ) ) { value = context; } - else if ( expression.equals( "project" ) ) + else if ( "project".equals( expression ) ) { value = project; } - else if ( expression.equals( "executedProject" ) ) + else if ( "executedProject".equals( expression ) ) { value = project.getExecutionProject(); } @@ -109,7 +109,7 @@ public class PluginParameterExpressionEvaluator if ( pathSeparator > 0 ) { - String pathExpression = expression.substring( 1, pathSeparator ); + String pathExpression = expression.substring( 0, pathSeparator ); value = ReflectionValueExtractor.evaluate( pathExpression, project ); value = value + expression.substring( pathSeparator ); } @@ -177,7 +177,7 @@ public class PluginParameterExpressionEvaluator e ); } } - else if ( expression.equals( "basedir" ) ) + else if ( "basedir".equals( expression ) ) { value = project.getBasedir().getAbsolutePath(); } @@ -250,7 +250,7 @@ public class PluginParameterExpressionEvaluator public File alignToBaseDirectory( File file ) { - File basedir = null; + File basedir; if ( project != null && project.getFile() != null ) {