Eclipse中划掉的静态导入是什么意思? [英] What does a crossed out static import in Eclipse mean?

查看:27
本文介绍了Eclipse中划掉的静态导入是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是在玩 JUnit 4 ,所以我沉迷于这两个静态导入:

I was just playing around with JUnit 4 so I whacked in these two static imports:

import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;

编写了世界上最好的单元测试,并在Eclipse中做了 optimise import (优化导入),因为我在保存文件时就设置了该设置.

Wrote the best unit test in the world and did an optimise imports in Eclipse just because I have that set to happen on saving a file.

我的屏幕现在看起来像这样(当然没有红色的大箭头-我画了那个):

My screen now looks like this (except of course without the big red arrow - I drew that):

好的,这样就可以了,因为它可以编译并运行(并且测试甚至可以通过),但是我很讨厌,因为Eclipse已经删除了 is ,我不知道为什么

OK, so it is all fine in that it compiles and runs (and the test even passes) but I have the heeby-jeebies because Eclipse has crossed out the is and I do not know why.

那么,专家,此删除线是什么意思?

So, experts, what does this strikethrough mean?

紧张地悬停在它上面,表明存在三种可能的 is 方法-可能是原因吗?

Nervously hovering over it reveals there are three possible is methods - could that be the reason?

推荐答案

这意味着不赞成使用 is 方法.

It means the method is is deprecated.

这篇关于Eclipse中划掉的静态导入是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆