From: Juergen H. <jho...@us...> - 2008-10-14 11:16:20
|
Update of /cvsroot/springframework/spring/src/org/springframework/beans/factory/support In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14394/src/org/springframework/beans/factory/support Modified Files: AbstractBeanDefinition.java Log Message: fixed corner case in AbstractBeanDefinition where a ClassCastException could arise in "getBeanClass(Name)" Index: AbstractBeanDefinition.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/factory/support/AbstractBeanDefinition.java,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** AbstractBeanDefinition.java 1 Aug 2008 13:54:52 -0000 1.94 --- AbstractBeanDefinition.java 14 Oct 2008 11:16:04 -0000 1.95 *************** *** 345,356 **** */ public Class getBeanClass() throws IllegalStateException { ! if (this.beanClass == null) { throw new IllegalStateException("No bean class specified on bean definition"); } ! if (!(this.beanClass instanceof Class)) { throw new IllegalStateException( ! "Bean class name [" + this.beanClass + "] has not been resolved into an actual Class"); } ! return (Class) this.beanClass; } --- 345,357 ---- */ public Class getBeanClass() throws IllegalStateException { ! Object beanClassObject = this.beanClass; ! if (beanClassObject == null) { throw new IllegalStateException("No bean class specified on bean definition"); } ! if (!(beanClassObject instanceof Class)) { throw new IllegalStateException( ! "Bean class name [" + beanClassObject + "] has not been resolved into an actual Class"); } ! return (Class) beanClassObject; } *************** *** 360,368 **** public String getBeanClassName() { ! if (this.beanClass instanceof Class) { ! return ((Class) this.beanClass).getName(); } else { ! return (String) this.beanClass; } } --- 361,370 ---- public String getBeanClassName() { ! Object beanClassObject = this.beanClass; ! if (beanClassObject instanceof Class) { ! return ((Class) beanClassObject).getName(); } else { ! return (String) beanClassObject; } } |