REQ-2010: 添加分析代码
This commit is contained in:
parent
cbe5b1a811
commit
0904e8a995
@ -33,13 +33,13 @@ public class SqlSessionFactoryPostProcessor implements BeanPostProcessor {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@SuppressWarnings("DataFlowIssue")
|
||||
private void analyze(SqlSessionFactory sessionFactory) {
|
||||
org.apache.ibatis.session.Configuration configuration = sessionFactory.getConfiguration();
|
||||
Field chainField = ReflectionUtils.findField(configuration.getClass(), "interceptorChain");
|
||||
Field modifiers = ReflectionUtils.findField(Field.class, "modifiers");
|
||||
//noinspection DataFlowIssue
|
||||
ReflectionUtils.setField(modifiers, chainField, chainField.getModifiers() & ~Modifier.FINAL);
|
||||
chainField.setAccessible(true);
|
||||
ReflectionUtils.setField(modifiers, chainField, chainField.getModifiers() & ~Modifier.FINAL);
|
||||
ReflectionUtils.setField(chainField, configuration, new AnalyzeInterceptorChain());
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user