avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl AbstractBlock.java
Date Tue, 20 Jan 2004 05:43:35 GMT
mcconnell    2004/01/19 21:43:35

  Modified:    merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl
                        AbstractBlock.java
  Log:
  Correction to invalid path handling plus a NPE check.
  
  Revision  Changes    Path
  1.17      +14 -4     avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl/AbstractBlock.java
  
  Index: AbstractBlock.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl/AbstractBlock.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- AbstractBlock.java	20 Jan 2004 05:26:17 -0000	1.16
  +++ AbstractBlock.java	20 Jan 2004 05:43:35 -0000	1.17
  @@ -223,8 +223,9 @@
      /**
       * Return an appliance relative to a specific path.
       * @param source the appliance path
  -    * @return the appliance, or null if it couldn't be found.
  -    * @exception IllegalArgumentException if the supplied path is invalid
  +    * @return the appliance
  +    * @exception IllegalArgumentException if the supplied does
  +    *    not refer to a know appliance
       * @exception ApplianceException if an error occurs during appliance
       *    resolution
       */
  @@ -233,7 +234,11 @@
           DeploymentModel model =
             getContainmentModel().getModel( source );
           if( model == null )
  -            return null;
  +        {
  +            final String error = 
  +              "Path [" + source + "] does not refer to a known appliance.";
  +            throw new IllegalArgumentException( error );
  +        }
           return locate( model );
       }
   
  @@ -251,6 +256,11 @@
   
       private Appliance getAppliance( final DeploymentModel model, boolean create )
       {
  +        if( null == model )
  +        {
  +            throw new NullPointerException( "model" );
  +        }
  +
           Appliance appliance = (Appliance) model.getHandler();
           if( null != appliance )
           {
  
  
  

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


Mime
View raw message