commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Diggory <mdigg...@gmail.com>
Subject [Configuration] Configuration throws no exceptions...
Date Mon, 11 Sep 2006 20:04:48 GMT
Hello Friends,

I notice that the code for AbstractConfiguration eats exceptions that  
the javadoc claims it should throw.

http://jakarta.apache.org/commons/configuration/xref/org/apache/ 
commons/configuration/AbstractConfiguration.html#692

> /***
> 690      * {@inheritDoc}
> 691      */
> 692     public Integer getInteger(String key, Integer defaultValue)
> 693     {
> 694         Object value = resolveContainerStore(key);
> 695
> 696         if (value == null)
> 697         {
> 698             return defaultValue;
> 699         }
> 700         else
> 701         {
> 702             try
> 703             {
> 704                 return PropertyConverter.toInteger(interpolate 
> (value));
> 705             }
> 706             catch (ConversionException e)
> 707             {
> 708                 throw new ConversionException('\'' + key + "'  
> doesn't map to an Integer object", e);
> 709             }
> 710         }
> 711     }

How is it that this can compile when the method signature clearly  
doesn't shoe "throws ConfigurationException" ? I thought, maybe its  
an extension of RuntimeException, but it doesn't appear so.

Cheers,
Mark

Mark R. Diggory
~~~~~~~~~~~~~
DSpace Systems Manager
MIT Libraries, Systems and Technology Services
Massachusetts Institute of Technology


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message