Eclipse 3.2(以及Eclipse Callisto)在6月30日就要release了,为此,Ed Burnette专门写了一篇报道:What's New in Eclipse 3.2 Java Development Tools,着重介绍在Eclipse 3.2中JDT的新特性:
编译器(Compiler)
Eclipse 3.2开始支持Java SE 6.0,同时增加了更多的编译诊断工具,比如:
- Using variables that are obviously
null
.
- Unnecessary checks against
null
.
- Accidentally assigning to method parameters.
- Switch cases entered by falling through previous cases.
- Using non-generic (raw) types.
- Unused labels.
- Unnecessary
$NON-NLS$
tags.
从Eclipse 3.2开始,可以单独下载独立的JDT编译器,大约只有1MB大小(Apache Tomcat就在使用Eclipse的JDT编译器)。这个命令行工具,和javac兼容。
编辑(Editing)
编辑器中增强的一个功能是Ctrl-Space,比如一个非常长的变量名: LongJavaName,只要打入"LJN",然后通过Ctrl-Space,编辑器就知道你需要LongJavaName这个变量。这个功能被称之为CamelCase completion.
另一个增强是: 比如你需要 StringBuffer buffer = new StringBuffer();
,你不需要全部自己输入了,在3.2中,尝试这样做:输入SB,
Ctrl
-Space
, Space
, Ctrl
-Space
, 输入 = new
, Ctrl
-Space
, 输入();
。这是不是大大缩短了击键的次数呢?
另外一个功能称之为"rename type"。 比如你有一个类型Bar,通常你可能会命名你的变量为fBar,把方法命名为createBar()。 那么,如果你通过重构把Bar给改名了,3.2将尝试同时改正 fBar和createBar() 。

运行和测试(Running)
在3.2中,可以同时运行多个测试案例(test suite),而且,3.2开始支持JUnit 4.0了。
团队工作(Team Working)
Eclispe 3.2现在可以通过读取CVS的历史记录,来高亮度的颜色标记来提示当前行哪个其他的程序员做过改动,如果把鼠标移到这个高亮颜色块上,会显示出程序员的名字,日期和所做的批注。

清洁代码 (Code Hygiene)
3.2提供了一个新的Clean Up向导来进一步格式化和清洁代码:
- Remove unused imports.
- Remove unused private methods and constructors.
- Add missing
@Override
and @Deprecated
annotations.
- Add missing
$NON-NLS$
tags, or remove unnecessary ones.
- Convert all
for
loops to be enhanced-for
loops.
- Convert control statement bodies to blocks.
- Remove unnecessary casts.
- Add serial version ID to
Serializable
and Externalizable
classes.

【参考】部分内容节译自 《What's New in Eclipse 3.2 Java Development Tools》