From 8a889ceadf565d4cd7c2ac15a81fb1b491b4bc44 Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Wed, 15 Aug 2007 14:51:59 +0000 Subject: [PATCH] Changing internal setBaseVersion(..) calls to setBaseVersionInternal(..) to prevent side effects with extending implementations that disallow setting versions directly (as in maven-project). git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@566205 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/maven/artifact/DefaultArtifact.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java b/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java index 48828afa07..a1fd2c835f 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java @@ -187,7 +187,7 @@ public class DefaultArtifact public void setVersion( String version ) { this.version = version; - this.setBaseVersion( version ); + this.setBaseVersionInternal( version ); this.versionRange = null; } @@ -361,12 +361,17 @@ public class DefaultArtifact { throw new NullPointerException( "version was null for " + groupId + ":" + artifactId ); } - setBaseVersion( version ); + setBaseVersionInternal( version ); } return baseVersion; } public void setBaseVersion( String baseVersion ) + { + setBaseVersionInternal( baseVersion ); + } + + protected void setBaseVersionInternal( String baseVersion ) { Matcher m = VERSION_FILE_PATTERN.matcher( baseVersion ); if ( m.matches() ) @@ -495,7 +500,7 @@ public class DefaultArtifact public void selectVersion( String version ) { this.version = version; - setBaseVersion( version ); + setBaseVersionInternal( version ); } public void setGroupId( String groupId )