个人博客 地址:http://www.wenhaofan.com/article/20181108132519

问题描述

在项目运行以及main方法中能够正常运行,但是使用junit单元测试时却报如下错误

java.lang.AssertionError: TokenStream implementation classes or at least their incrementToken() implementation must be final
lucene.analysis.TokenStream.assertFinal(TokenStream.java:117)
TokenStream implementation classes or at least their incrementToken() implementation must be final

解决方案

debug至assertFinal() 发现这里断言了clazz的类是否为final 如果不为final则抛出异常,于是将其对应的类改为final类型即可以解决问题,具体原理因时间问题未深究,先记录下解决办法,等以后有空再来debug看看

最新文章

  1. json文本装换为JSONArray
  2. GJM : 数据结构 - 轻松看懂机器学习十大常用算法 [转载]
  3. bootstrapt model 的多罩层,禁用罩层
  4. js团购倒计时
  5. oracle 根据汉字返回拼音函数
  6. HDU 1712 ACboy needs your help 典型的分组背包
  7. centos 6.4 更新源地址
  8. dell PowerEdge R720 自动重启分析
  9. 【2017-03-30】JS-document对象
  10. ChartControl设置坐标轴范围
  11. Java_Runtime&Process&ProcessBuilder
  12. ubuntu 创建文件夹和删除文件
  13. “幕后英雄”之Backing Fields【Microsoft Entity Framework Core随笔】
  14. 【转】How to initialize a two-dimensional array in Python?
  15. 深入理解java虚拟机(一)-----java内存区域以及内存溢出异常
  16. redis跳跃表
  17. maya2012卸载/安装失败/如何彻底卸载清除干净maya2012注册表和文件的方法
  18. mac 报错Root chmod operation not permitted on file
  19. setitimer函数
  20. 【Kafka】Kafka数据可靠性深度解读

热门文章

  1. C#实现把String字符串转化为SQL语句中的In后接的参数
  2. go 算法与数据结构
  3. warning: LF will be replaced by CRLF in
  4. oracle分组后取最新的记录
  5. 【37】池化层讲解(Pooling layers)
  6. Postman测试上传MultipartFile文件
  7. 容错保护机制:Spring Cloud Hystrix
  8. form表单中给input 添加 数量可以增减的按钮
  9. 论文阅读笔记(二十二)【CVPR2017】:See the Forest for the Trees: Joint Spatial and Temporal Recurrent Neural Networks for Video-based Person Re-identification
  10. 电脑和手机上常用apk或Pc软件的重要目录或文件或文件夹路径