以下是示例代码
public class DeprecatedTest {
private final List<Object> instances;
public DeprecatedTest(){
instances = new ArrayList<Object>();
instances.add(new Depr());
instances.add(new Depr1());
instances.add(new Depr2());
instances.add(new Depr3());
Depr depr = new Depr();
Depr2 depr2 = new Depr2();
}
@Deprecated
public class Depr{}
@Deprecated
public class Depr1{}
@Deprecated
public class Depr2{}
@Deprecated
public class Depr3{}
}
Eclipse会在实例名称(最后两个声明)之前删除类名。但是如果它是匿名类,则Eclipse在新操作数之后不会触发类初始化。这真的很不方便!它是可配置的吗?
SpringSource工具套件版本: 2.5.0.M3 Build Id:201008251000
答案 0 :(得分:3)
应该很容易 - &gt;
tadaa!