maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ogusa...@apache.org
Subject svn commit: r707673 - in /maven/mercury/trunk: mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/ mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/version/ mercury-artifact/src/test/java/org/apache/maven/mercury/artifact/...
Date Fri, 24 Oct 2008 16:33:46 GMT
Author: ogusakov
Date: Fri Oct 24 09:33:45 2008
New Revision: 707673

URL: http://svn.apache.org/viewvc?rev=707673&view=rev
Log:
converting VersionRange to pluggable component

Added:
    maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/version/MavenVersionRange.java
  (contents, props changed)
      - copied, changed from r707423, maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/version/VersionRange.java
    maven/mercury/trunk/mercury-artifact/src/test/java/org/apache/maven/mercury/artifact/version/MavenVersionRangeTest.java
  (contents, props changed)
      - copied, changed from r707423, maven/mercury/trunk/mercury-artifact/src/test/java/org/apache/maven/mercury/artifact/version/VersionRangeTest.java
Removed:
    maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/version/VersionRange.java
    maven/mercury/trunk/mercury-artifact/src/test/java/org/apache/maven/mercury/artifact/version/VersionRangeTest.java
Modified:
    maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/ArtifactBasicMetadata.java
    maven/mercury/trunk/mercury-repo/mercury-repo-local-m2/src/main/java/org/apache/maven/mercury/repository/local/m2/LocalRepositoryReaderM2.java
    maven/mercury/trunk/mercury-repo/mercury-repo-remote-m2/src/main/java/org/apache/maven/mercury/repository/remote/m2/RemoteRepositoryReaderM2.java

Modified: maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/ArtifactBasicMetadata.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/ArtifactBasicMetadata.java?rev=707673&r1=707672&r2=707673&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/ArtifactBasicMetadata.java
(original)
+++ maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/ArtifactBasicMetadata.java
Fri Oct 24 09:33:45 2008
@@ -5,7 +5,7 @@
 import java.util.List;
 
 import org.apache.maven.mercury.artifact.version.VersionException;
-import org.apache.maven.mercury.artifact.version.VersionRange;
+import org.apache.maven.mercury.artifact.version.MavenVersionRange;
 
 
 /**
@@ -411,7 +411,7 @@
       {
         if( !filterMd.hasVersion() )
           return false; // no version in the filter - catch by GA
-        VersionRange vr = new VersionRange( filterMd.getVersion() );
+        MavenVersionRange vr = new MavenVersionRange( filterMd.getVersion() );
         if( vr.includes( dep.getVersion() ))
           return false; // catch by version query
       }

Copied: maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/version/MavenVersionRange.java
(from r707423, maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/version/VersionRange.java)
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/version/MavenVersionRange.java?p2=maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/version/MavenVersionRange.java&p1=maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/version/VersionRange.java&r1=707423&r2=707673&rev=707673&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/version/VersionRange.java
(original)
+++ maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/version/MavenVersionRange.java
Fri Oct 24 09:33:45 2008
@@ -22,10 +22,10 @@
  * @author Oleg Gusakov
  * @version $Id$
  */
-public class VersionRange
+public class MavenVersionRange
 {
   private static final DefaultArtifactVersion ZERO_VERSION = new DefaultArtifactVersion("0.0.0");
-  private static final Language _lang = new DefaultLanguage( VersionRange.class );
+  private static final Language _lang = new DefaultLanguage( MavenVersionRange.class );
   
   QualityRange _toQualityRange = QualityRange.ALL;
   
@@ -36,14 +36,14 @@
   boolean _toInclusive = false;
   
   //--------------------------------------------------------------------------------------------
-  public VersionRange( String range, QualityRange qRange )
+  public MavenVersionRange( String range, QualityRange qRange )
   throws VersionException
   {
     this( range );
     setToQualityRange( qRange );
   }
   //--------------------------------------------------------------------------------------------
-  public VersionRange( final String rangeIn )
+  public MavenVersionRange( final String rangeIn )
   throws VersionException
   {
     String range = AttributeQuery.stripExpression( rangeIn );
@@ -112,7 +112,7 @@
     }
   }
   //--------------------------------------------------------------------------------------------
-  public void setToQualityRange( QualityRange qRange )
+  protected void setToQualityRange( QualityRange qRange )
   {
     this._toQualityRange = qRange;
   }

Propchange: maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/version/MavenVersionRange.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: maven/mercury/trunk/mercury-artifact/src/test/java/org/apache/maven/mercury/artifact/version/MavenVersionRangeTest.java
(from r707423, maven/mercury/trunk/mercury-artifact/src/test/java/org/apache/maven/mercury/artifact/version/VersionRangeTest.java)
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-artifact/src/test/java/org/apache/maven/mercury/artifact/version/MavenVersionRangeTest.java?p2=maven/mercury/trunk/mercury-artifact/src/test/java/org/apache/maven/mercury/artifact/version/MavenVersionRangeTest.java&p1=maven/mercury/trunk/mercury-artifact/src/test/java/org/apache/maven/mercury/artifact/version/VersionRangeTest.java&r1=707423&r2=707673&rev=707673&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-artifact/src/test/java/org/apache/maven/mercury/artifact/version/VersionRangeTest.java
(original)
+++ maven/mercury/trunk/mercury-artifact/src/test/java/org/apache/maven/mercury/artifact/version/MavenVersionRangeTest.java
Fri Oct 24 09:33:45 2008
@@ -10,16 +10,16 @@
  * @author Oleg Gusakov
  * @version $Id$
  */
-public class VersionRangeTest
+public class MavenVersionRangeTest
     extends TestCase
 {
-  VersionRange range;
+  MavenVersionRange range;
 
   public void testSimple()
   throws VersionException
   {
     String rangeS = "[ 1.2.3 , 2.0.0 )";
-    range = new VersionRange( rangeS );
+    range = new MavenVersionRange( rangeS );
 
     assertTrue(  "1.2.4 did not match the range "+rangeS, range.includes( "1.2.4" ) ); 
     assertTrue(  "1.3.1 did not match the range "+rangeS, range.includes( "1.3.1" ) ); 
@@ -33,7 +33,7 @@
   throws VersionException
   {
     String rangeS = "[ 1.2.3 , )";
-    range = new VersionRange( rangeS );
+    range = new MavenVersionRange( rangeS );
 
     assertTrue(  "1.2.4 did not match the range "+rangeS, range.includes( "1.2.4" ) ); 
     assertTrue(  "1.3.1 did not match the range "+rangeS, range.includes( "1.3.1" ) ); 
@@ -47,7 +47,7 @@
   throws VersionException
   {
     String rangeS = "[ 1.0.0.1.2.1 , )";
-    range = new VersionRange( rangeS );
+    range = new MavenVersionRange( rangeS );
 
     assertTrue(  "1.0.0.1.2.1 did not match the range "+rangeS, range.includes( "1.0.0.1.2.1"
) );
     assertTrue(  "1.0.0.1.2.2 did not match the range "+rangeS, range.includes( "1.0.0.1.2.2"
) );
@@ -61,7 +61,7 @@
   throws VersionException
   {
     String rangeS = "[1.0.0.0.22,)";
-    range = new VersionRange( rangeS );
+    range = new MavenVersionRange( rangeS );
 
     assertFalse( "1.0.0.0.9 does match the range "+rangeS, range.includes( "1.0.0.0.9" )
);
   }
@@ -70,7 +70,7 @@
   throws VersionException
   {
     String rangeS = "[1.0,2.0)";
-    range = new VersionRange( rangeS );
+    range = new MavenVersionRange( rangeS );
 
     assertFalse( range.includes( "1.0-SNAPSHOT" ) );
     assertTrue( range.includes( "1.1-SNAPSHOT" ) );
@@ -84,7 +84,7 @@
   throws VersionException
   {
     String rangeS = "[1.0,2.0)";
-    range = new VersionRange( rangeS );
+    range = new MavenVersionRange( rangeS );
     range.setToQualityRange( new QualityRange( Quality.BETA_QUALITY, true, Quality.RELEASE_QUALITY,
true  ) );
 
     assertFalse( range.includes( "1.0-SNAPSHOT" ) );
@@ -100,7 +100,7 @@
   throws VersionException
   {
     String rangeS = "[1.0,2.0)";
-    range = new VersionRange( rangeS );
+    range = new MavenVersionRange( rangeS );
     range.setToQualityRange( new QualityRange( Quality.ALPHA_QUALITY, true, Quality.RELEASE_QUALITY,
true  ) );
 
     assertFalse( range.includes( "1.0-SNAPSHOT" ) );

Propchange: maven/mercury/trunk/mercury-artifact/src/test/java/org/apache/maven/mercury/artifact/version/MavenVersionRangeTest.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: maven/mercury/trunk/mercury-repo/mercury-repo-local-m2/src/main/java/org/apache/maven/mercury/repository/local/m2/LocalRepositoryReaderM2.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-repo/mercury-repo-local-m2/src/main/java/org/apache/maven/mercury/repository/local/m2/LocalRepositoryReaderM2.java?rev=707673&r1=707672&r2=707673&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-repo/mercury-repo-local-m2/src/main/java/org/apache/maven/mercury/repository/local/m2/LocalRepositoryReaderM2.java
(original)
+++ maven/mercury/trunk/mercury-repo/mercury-repo-local-m2/src/main/java/org/apache/maven/mercury/repository/local/m2/LocalRepositoryReaderM2.java
Fri Oct 24 09:33:45 2008
@@ -15,7 +15,7 @@
 import org.apache.maven.mercury.artifact.Quality;
 import org.apache.maven.mercury.artifact.version.DefaultArtifactVersion;
 import org.apache.maven.mercury.artifact.version.VersionException;
-import org.apache.maven.mercury.artifact.version.VersionRange;
+import org.apache.maven.mercury.artifact.version.MavenVersionRange;
 import org.apache.maven.mercury.builder.api.DependencyProcessor;
 import org.apache.maven.mercury.builder.api.MetadataReader;
 import org.apache.maven.mercury.builder.api.MetadataReaderException;
@@ -436,10 +436,10 @@
       
       File [] versionFiles = gaDir.listFiles();
       
-      VersionRange versionQuery;
+      MavenVersionRange versionQuery;
       try
       {
-        versionQuery = new VersionRange( bmd.getVersion(), _repo.getVersionRangeQualityRange()
);
+        versionQuery = new MavenVersionRange( bmd.getVersion(), _repo.getVersionRangeQualityRange()
);
       }
       catch( VersionException e )
       {

Modified: maven/mercury/trunk/mercury-repo/mercury-repo-remote-m2/src/main/java/org/apache/maven/mercury/repository/remote/m2/RemoteRepositoryReaderM2.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-repo/mercury-repo-remote-m2/src/main/java/org/apache/maven/mercury/repository/remote/m2/RemoteRepositoryReaderM2.java?rev=707673&r1=707672&r2=707673&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-repo/mercury-repo-remote-m2/src/main/java/org/apache/maven/mercury/repository/remote/m2/RemoteRepositoryReaderM2.java
(original)
+++ maven/mercury/trunk/mercury-repo/mercury-repo-remote-m2/src/main/java/org/apache/maven/mercury/repository/remote/m2/RemoteRepositoryReaderM2.java
Fri Oct 24 09:33:45 2008
@@ -18,7 +18,7 @@
 import org.apache.maven.mercury.artifact.Quality;
 import org.apache.maven.mercury.artifact.version.DefaultArtifactVersion;
 import org.apache.maven.mercury.artifact.version.VersionException;
-import org.apache.maven.mercury.artifact.version.VersionRange;
+import org.apache.maven.mercury.artifact.version.MavenVersionRange;
 import org.apache.maven.mercury.builder.api.DependencyProcessor;
 import org.apache.maven.mercury.builder.api.MetadataReader;
 import org.apache.maven.mercury.builder.api.MetadataReaderException;
@@ -172,7 +172,7 @@
       )
     {
       boolean noSnapshots = Artifact.RELEASE_VERSION.equals( loc.getVersion() );
-      String ver = VersionRange.findLatest( versions, noSnapshots );
+      String ver = MavenVersionRange.findLatest( versions, noSnapshots );
 
       if( ver == null )
       {
@@ -287,7 +287,7 @@
     }
     
     // nothing to do, but find latest
-    String ver = VersionRange.findLatest( versions, true );
+    String ver = MavenVersionRange.findLatest( versions, true );
 
     if( ver == null )
     {
@@ -501,10 +501,10 @@
         continue;
       }
 
-      VersionRange versionQuery;
+      MavenVersionRange versionQuery;
       try
       {
-        versionQuery = new VersionRange( bmd.getVersion(), _repo.getVersionRangeQualityRange()
);
+        versionQuery = new MavenVersionRange( bmd.getVersion(), _repo.getVersionRangeQualityRange()
);
       }
       catch( VersionException e )
       {



Mime
View raw message