diff options
author | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-18 21:21:46 +0000 |
---|---|---|
committer | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-18 21:21:46 +0000 |
commit | e2f48b843dc5ec188c7ce4a804bf3f87d9dc6b6f (patch) | |
tree | 28509cbf1c7941a012cc3fba43f9f5a0096164ef /sca-java-2.x/trunk/modules/core | |
parent | 5a3d8b8892782ab02265323094b090b64532957f (diff) |
JCA_9013 Throw an IllegalArgumentException when getProperty() is called with an invalid property name
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@986947 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/core')
-rw-r--r-- | sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java index f8df72241c..cfa2a3c7e3 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java @@ -219,11 +219,10 @@ public class ComponentContextImpl implements RuntimeComponentContext { 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); } /** |