You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2004/02/22 00:06:02 UTC

cvs commit: avalon/meta/api/src/java/org/apache/avalon/meta/info ReferenceDescriptor.java

mcconnell    2004/02/21 15:06:02

  Modified:    meta/api/src/java/org/apache/avalon/meta/info
                        ReferenceDescriptor.java
  Log:
  Correct default version assignment.
  
  Revision  Changes    Path
  1.3       +8 -5      avalon/meta/api/src/java/org/apache/avalon/meta/info/ReferenceDescriptor.java
  
  Index: ReferenceDescriptor.java
  ===================================================================
  RCS file: /home/cvs/avalon/meta/api/src/java/org/apache/avalon/meta/info/ReferenceDescriptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ReferenceDescriptor.java	24 Jan 2004 23:20:45 -0000	1.2
  +++ ReferenceDescriptor.java	21 Feb 2004 23:06:02 -0000	1.3
  @@ -45,7 +45,9 @@
       private final Version m_version;
   
       /**
  -     * Construct a service with specified type.
  +     * Construct a service with specified type. The type argument will be 
  +     * parsed for a classname and version in the form [classname]:[version]. 
  +     * If not version is present a default 1.0.0 version will be assigned.
        *
        * @param type the service type spec
        * @exception NullPointerException if the classname is null
  @@ -120,8 +122,9 @@
        */
       public boolean matches( final ReferenceDescriptor other )
       {
  -        return m_classname.equals( other.m_classname )
  -                && other.getVersion().complies( getVersion() );
  +        if( !m_classname.equals( other.m_classname ) ) return false;
  +        if( other.getVersion().complies( getVersion() ) ) return true;
  +        return false;
       }
   
       /**
  @@ -194,7 +197,7 @@
       {
           if( type.indexOf( ":" ) == -1 )
           {
  -            return Version.getVersion( "" );
  +            return Version.getVersion( "1.0" );
           }
           else
           {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org