1616import org .directwebremoting .extend .PlainProperty ;
1717import org .directwebremoting .extend .Property ;
1818import org .hibernate .Hibernate ;
19- import org .hibernate .engine .spi .SessionImplementor ;
19+ import org .hibernate .engine .spi .SharedSessionContractImplementor ;
2020import org .hibernate .proxy .HibernateProxy ;
2121import org .hibernate .proxy .LazyInitializer ;
2222
@@ -154,16 +154,16 @@ public Class<?> getClass(Object example)
154154 {
155155 if (example instanceof HibernateProxy )
156156 {
157- HibernateProxy proxy = (HibernateProxy ) example ;
158- LazyInitializer initializer = proxy .getHibernateLazyInitializer ();
159- SessionImplementor implementor = initializer .getSession ();
157+ final HibernateProxy proxy = (HibernateProxy ) example ;
158+ final LazyInitializer initializer = proxy .getHibernateLazyInitializer ();
159+ final SharedSessionContractImplementor implementor = initializer .getSession ();
160160
161- if (initializer .isUninitialized ())
161+ if ( initializer .isUninitialized () )
162162 {
163163 try
164164 {
165165 // getImplementation is going to want to talk to a session
166- if (implementor .isClosed ())
166+ if ( implementor .isClosed () )
167167 {
168168 // Give up and return example.getClass();
169169 return example .getClass ();
@@ -189,13 +189,15 @@ public Class<?> getClass(Object example)
189189 */
190190 protected Method findGetter (Object data , String property ) throws IntrospectionException
191191 {
192- Class <?> clazz = getClass (data );
193- String key = clazz .getName () + ":" + property ;
192+ final Class <?> clazz = getClass (data );
193+ final String key = clazz .getName () + ":" + property ;
194194 Method method = methods .get (key );
195+
195196 if (method == null )
196197 {
197198 Method newMethod = null ;
198- PropertyDescriptor [] props = Introspector .getBeanInfo (clazz ).getPropertyDescriptors ();
199+ PropertyDescriptor [] props = Introspector .getBeanInfo (clazz ).getPropertyDescriptors ();
200+
199201 for (PropertyDescriptor prop : props )
200202 {
201203 if (prop .getName ().equalsIgnoreCase (property ))
@@ -204,7 +206,9 @@ protected Method findGetter(Object data, String property) throws IntrospectionEx
204206 }
205207 }
206208 method = methods .putIfAbsent (key , newMethod );
207- if (method == null ) {
209+
210+ if (method == null )
211+ {
208212 // put succeeded, use new value
209213 method = newMethod ;
210214 }
0 commit comments