You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by bd...@apache.org on 2010/08/18 23:21:46 UTC

svn commit: r986947 - /tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java

Author: bdaniel
Date: Wed Aug 18 21:21:46 2010
New Revision: 986947

URL: http://svn.apache.org/viewvc?rev=986947&view=rev
Log:
JCA_9013 Throw an IllegalArgumentException when getProperty() is called with an invalid property name

Modified:
    tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java

Modified: tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java?rev=986947&r1=986946&r2=986947&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java Wed Aug 18 21:21:46 2010
@@ -219,11 +219,10 @@ public class ComponentContextImpl implem
     public <B> B getProperty(Class<B> type, String propertyName) {
         for (ComponentProperty p : component.getProperties()) {
             if (propertyName.equals(p.getName())) {
-            	B o = propertyFactory.createPropertyValue(p, type);
-                return o;
+            	return propertyFactory.createPropertyValue(p, type);           
             }
         }
-        throw new ServiceRuntimeException("Property not found: " + propertyName);
+        throw new IllegalArgumentException("Property not found: " + propertyName);
     }
 
     /**