You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by da...@apache.org on 2014/03/31 09:46:50 UTC

svn commit: r1583252 - /aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java

Author: davidb
Date: Mon Mar 31 07:46:49 2014
New Revision: 1583252

URL: http://svn.apache.org/r1583252
Log:
Fix class name in exception message.

Patch applied on behalf of alexandreroman with many thanks.
Pull request #1 can be closed.

Modified:
    aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java

Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java?rev=1583252&r1=1583251&r2=1583252&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java Mon Mar 31 07:46:49 2014
@@ -284,7 +284,7 @@ public class BeanRecipe extends Abstract
                 try {
                     factoryObj = ((ReferenceRecipe.ServiceProxyWrapper) factoryObj).convert(new ReifiedType(Object.class));
                 } catch (Exception e) {
-                    throw new ComponentDefinitionException("Error when instantiating bean " + getName() + " of class " + getType(), getRealCause(e));
+                    throw new ComponentDefinitionException("Error when instantiating bean " + getName() + " of class " + getType().getName(), getRealCause(e));
                 }
             } else if (factoryObj instanceof UnwrapperedBeanHolder) {
             	factoryObj = wrap((UnwrapperedBeanHolder) factoryObj, Object.class);
@@ -297,7 +297,7 @@ public class BeanRecipe extends Abstract
                     Map.Entry<Method, List<Object>> match = matches.entrySet().iterator().next();
                     instance = invoke(match.getKey(), factoryObj, match.getValue().toArray());
                 } catch (Throwable e) {
-                    throw new ComponentDefinitionException("Error when instantiating bean " + getName() + " of class " + getType(), getRealCause(e));
+                    throw new ComponentDefinitionException("Error when instantiating bean " + getName() + " of class " + getType().getName(), getRealCause(e));
                 }
             } else if (matches.size() == 0) {
                 throw new ComponentDefinitionException("Unable to find a matching factory method " + factoryMethod + " on class " + factoryObj.getClass().getName() + " for arguments " + args + " when instanciating bean " + getName());
@@ -312,7 +312,7 @@ public class BeanRecipe extends Abstract
                     Map.Entry<Method, List<Object>> match = matches.entrySet().iterator().next();
                     instance = invoke(match.getKey(), null, match.getValue().toArray());
                 } catch (Throwable e) {
-                    throw new ComponentDefinitionException("Error when instantiating bean " + getName() + " of class " + getType(), getRealCause(e));
+                    throw new ComponentDefinitionException("Error when instantiating bean " + getName() + " of class " + getType().getName(), getRealCause(e));
                 }
             } else if (matches.size() == 0) {
                 throw new ComponentDefinitionException("Unable to find a matching factory method " + factoryMethod + " on class " + getType().getName() + " for arguments " + args + " when instanciating bean " + getName());
@@ -330,7 +330,7 @@ public class BeanRecipe extends Abstract
                     Map.Entry<Constructor, List<Object>> match = matches.entrySet().iterator().next();
                     instance = newInstance(match.getKey(), match.getValue().toArray());
                 } catch (Throwable e) {
-                    throw new ComponentDefinitionException("Error when instantiating bean " + getName() + " of class " + getType(), getRealCause(e));
+                    throw new ComponentDefinitionException("Error when instantiating bean " + getName() + " of class " + getType().getName(), getRealCause(e));
                 }
             } else if (matches.size() == 0) {
                 throw new ComponentDefinitionException("Unable to find a matching constructor on class " + getType().getName() + " for arguments " + args + " when instanciating bean " + getName());