Open Owen-s1eep opened 2 years ago
com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration#containsInterceptor 判断是否注册过拦截器,应该判断下class,而不是实例吧?每次都是PageInterceptor interceptor = new PageInterceptor(); 新创建的,肯定不一样。或者可以考虑重写PageInterceptor中的equals和hashcode方法去做判断?
问题方法
public void afterPropertiesSet() throws Exception { PageInterceptor interceptor = new PageInterceptor(); ... while(var2.hasNext()) { ... if (!this.containsInterceptor(configuration, interceptor)) { configuration.addInterceptor(interceptor); } } } private boolean containsInterceptor(org.apache.ibatis.session.Configuration configuration, Interceptor interceptor) { try { return configuration.getInterceptors().contains(interceptor); } catch (Exception var4) { return false; } }
com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration#containsInterceptor 判断是否注册过拦截器,应该判断下class,而不是实例吧?每次都是PageInterceptor interceptor = new PageInterceptor(); 新创建的,肯定不一样。或者可以考虑重写PageInterceptor中的equals和hashcode方法去做判断?
问题方法