情况
不知道自己点了啥,运行一下就一块一块地变色,吓死作为新手的自己了
解决方法
点击下方工具栏的coverage
如果你是全屏状态那么就应该在上方工具栏依次点击 Window ——>show view ——> Other——>Java——>Coverage ——>Remove all Sessions(两个×按钮)
出现这个东西的原因
你点错了隔壁
那些颜色的意义
Source lines containing executable code get the following color code:
green for fully covered lines,
yellow for partly covered lines (some instructions or branches missed) and
red for lines that have not been executed at all.
绿色全覆盖,黄色部分覆盖,红色未执行
参考资料
- Eclipse下代码字体背景变红/变绿/变黄原因
https://blog.csdn.net/summerxiachen/article/details/79921400 - Source Code Annotation
https://www.eclemma.org/userdoc/annotations.html