maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-artifact/src/main/java/org/apache/maven/artifact DefaultArtifact.java
Date Tue, 22 Mar 2005 06:51:16 GMT
brett       2005/03/21 22:51:16

  Modified:    maven-artifact/src/main/java/org/apache/maven/artifact/handler/manager
                        ArtifactHandlerManager.java
               maven-artifact/src/main/java/org/apache/maven/artifact
                        DefaultArtifact.java
  Log:
  clean up artifact handler a little - fields are all final
  
  Revision  Changes    Path
  1.4       +8 -7      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/handler/manager/ArtifactHandlerManager.java
  
  Index: ArtifactHandlerManager.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/handler/manager/ArtifactHandlerManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ArtifactHandlerManager.java	21 Mar 2005 08:18:34 -0000	1.3
  +++ ArtifactHandlerManager.java	22 Mar 2005 06:51:16 -0000	1.4
  @@ -1,11 +1,7 @@
   package org.apache.maven.artifact.handler.manager;
   
  -import org.apache.maven.artifact.handler.ArtifactHandler;
  -
  -import java.util.Set;
  -
   /*
  - * Copyright 2001-2004 The Apache Software Foundation.
  + * Copyright 2001-2005 The Apache Software Foundation.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
  @@ -20,6 +16,10 @@
    * limitations under the License.
    */
   
  +import org.apache.maven.artifact.handler.ArtifactHandler;
  +
  +import java.util.Set;
  +
   /**
    * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
    * @version $Id$
  @@ -28,7 +28,8 @@
   {
       String ROLE = ArtifactHandlerManager.class.getName();
   
  -    ArtifactHandler getArtifactHandler( String type ) throws ArtifactHandlerNotFoundException;
  +    ArtifactHandler getArtifactHandler( String type )
  +        throws ArtifactHandlerNotFoundException;
   
       //    String localRepositoryPath( Artifact artifact, ArtifactRepository localRepository
)
       //         throws ArtifactHandlerNotFoundException;
  
  
  
  1.14      +19 -17    maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
  
  Index: DefaultArtifact.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DefaultArtifact.java	21 Mar 2005 08:45:44 -0000	1.13
  +++ DefaultArtifact.java	22 Mar 2005 06:51:16 -0000	1.14
  @@ -32,19 +32,19 @@
       // These are the only things i need to specify
       // ----------------------------------------------------------------------
   
  -    private String groupId;
  +    private final String groupId;
   
  -    private String artifactId;
  +    private final String artifactId;
   
  -    private String version;
  +    private final String version;
   
  -    private String type;
  +    private final String type;
   
  -    private String classifier;
  +    private final String classifier;
   
  -    private String scope;
  +    private final String scope;
   
  -    private String extension;
  +    private final String extension;
   
       private String path;
   
  @@ -52,7 +52,7 @@
        * @todo this should be replaced by type handler
        */
       public DefaultArtifact( String groupId, String artifactId, String version, String scope,
String type,
  -                           String extension )
  +                            String extension )
       {
           this( groupId, artifactId, version, scope, type, null, extension );
       }
  @@ -62,7 +62,7 @@
        * only. Classifier is for specifying derived artifacts, like ejb-client.
        */
       public DefaultArtifact( String groupId, String artifactId, String version, String scope,
String type,
  -                           String classifier, String extension )
  +                            String classifier, String extension )
       {
           if ( type == null )
           {
  @@ -81,7 +81,14 @@
   
           this.classifier = classifier;
   
  -        this.extension = extension;
  +        if ( extension == null )
  +        {
  +            this.extension = type;
  +        }
  +        else
  +        {
  +            this.extension = extension;
  +        }
       }
   
       public DefaultArtifact( String groupId, String artifactId, String version, String type
)
  @@ -126,12 +133,7 @@
   
       public String getExtension()
       {
  -        if ( extension != null )
  -        {
  -            return extension;
  -        }
  -
  -        return type;
  +        return extension;
       }
   
       // ----------------------------------------------------------------------
  
  
  

Mime
View raw message