25
25
import org .springframework .beans .BeanInstantiationException ;
26
26
import org .springframework .beans .BeanUtils ;
27
27
import org .springframework .beans .factory .BeanFactory ;
28
+
28
29
import org .springframework .cglib .core .SpringNamingPolicy ;
29
30
import org .springframework .cglib .proxy .Callback ;
30
31
import org .springframework .cglib .proxy .CallbackFilter ;
@@ -146,7 +147,7 @@ private Class<?> createEnhancedSubclass(RootBeanDefinition beanDefinition) {
146
147
Enhancer enhancer = new Enhancer ();
147
148
enhancer .setSuperclass (beanDefinition .getBeanClass ());
148
149
enhancer .setNamingPolicy (SpringNamingPolicy .INSTANCE );
149
- enhancer .setCallbackFilter (new CallbackFilterImpl (beanDefinition ));
150
+ enhancer .setCallbackFilter (new MethodOverrideCallbackFilter (beanDefinition ));
150
151
enhancer .setCallbackTypes (CALLBACK_TYPES );
151
152
return enhancer .createClass ();
152
153
}
@@ -166,34 +167,31 @@ private static class CglibIdentitySupport {
166
167
this .beanDefinition = beanDefinition ;
167
168
}
168
169
169
- /**
170
- * Exposed for equals method to allow access to enclosing class field
171
- */
172
- protected RootBeanDefinition getBeanDefinition () {
173
- return beanDefinition ;
170
+ RootBeanDefinition getBeanDefinition () {
171
+ return this .beanDefinition ;
174
172
}
175
173
176
174
@ Override
177
175
public boolean equals (Object other ) {
178
- return ( other .getClass ().equals (getClass ()) && (( CglibIdentitySupport ) other ). getBeanDefinition (). equals (
179
- beanDefinition ));
176
+ return other .getClass ().equals (this . getClass ())
177
+ && (( CglibIdentitySupport ) other ). getBeanDefinition (). equals ( this . getBeanDefinition ( ));
180
178
}
181
179
182
180
@ Override
183
181
public int hashCode () {
184
- return beanDefinition .hashCode ();
182
+ return this . beanDefinition .hashCode ();
185
183
}
186
184
}
187
185
188
186
/**
189
- * CGLIB object to filter method interception behavior.
187
+ * CGLIB callback for filtering method interception behavior.
190
188
*/
191
- private static class CallbackFilterImpl extends CglibIdentitySupport implements CallbackFilter {
189
+ private static class MethodOverrideCallbackFilter extends CglibIdentitySupport implements CallbackFilter {
192
190
193
- private static final Log logger = LogFactory .getLog (CallbackFilterImpl .class );
191
+ private static final Log logger = LogFactory .getLog (MethodOverrideCallbackFilter .class );
194
192
195
193
196
- CallbackFilterImpl (RootBeanDefinition beanDefinition ) {
194
+ MethodOverrideCallbackFilter (RootBeanDefinition beanDefinition ) {
197
195
super (beanDefinition );
198
196
}
199
197
0 commit comments