Java 7的Clover instrumentation尝试使用资源后编译失败

Java 7的Clover instrumentation尝试使用资源后编译失败,java,instrumentation,java-7,clover,try-with-resources,Java,Instrumentation,Java 7,Clover,Try With Resources,我使用了一个简单的try with resources语句,如下所示: try (final CSVWriter w = new CSVWriter(new OutputStreamWriter(r.getOutputStream(), "UTF-8"));){ //do stuff...... } 它使用普通的javacAnt任务编译得很好,但是当我先使用Clover工具编译代码时,生成的代码就不再编译了(请参阅下面包含的编译消息) ,此版本的Clover不支持Java 7。有没有其

我使用了一个简单的try with resources语句,如下所示:

try (final CSVWriter w = new CSVWriter(new OutputStreamWriter(r.getOutputStream(), "UTF-8"));){
    //do stuff......
}
它使用普通的
javac
Ant任务编译得很好,但是当我先使用Clover工具编译代码时,生成的代码就不再编译了(请参阅下面包含的编译消息)

,此版本的Clover不支持Java 7。有没有其他人遇到过这个问题,或者知道问题是什么

Java版本:

java version "1.7.0" Java(TM) SE Runtime Environment (build pxi3270-20110827_01) IBM J9 VM (build 2.6, JRE 1.7.0 Linux x86-32 20110810_88604 (JIT enabled, AOT enabled) J9VM - R26_Java726_GA_20110810_1208_B88592 JIT - r11_20110810_20466 GC - R26_Java726_GA_20110810_1208_B88592 J9CL - 20110810_88604) JCL - 20110809_01 based on Oracle 7b147 compile: [echo] Compiling source code... [javac] Compiling 135 source files to /home/*********/WEB-INF/classes [clover] Clover Version 3.1.2, built on November 07 2011 (build-842) [clover] Loaded from: /home/*******/clover.jar [clover] Clover: Commercial License registered to *******. [clover] Updating existing database at '/home/********/dist/clover/clover.db'. [clover] Processing files at 1.7 source level. [clover] Clover all over. Instrumented 135 files (12 packages). [clover] Elapsed time = 1.597 secs. (84.534 files/sec, 12,463.369 srclines/sec) [javac] /tmp/clover2218935617827048125.tmp/com/****/web/DownloadService.java:232: error: illegal start of type [javac] __CLR3_1_24ae4aegwpi0zhh.R.inc(5592);try (new java.lang.AutoCloseable() {{__CLR3_1_24ae4aegwpi0zhh.R.inc(5593);}public void close(){}};CSVWriter w = new CSVWriter(new OutputStreamWriter(response.getOutputStream(), "UTF-8"));){ java版本“1.7.0” Java(TM)SE运行时环境(构建pxi3270-20110827_01) IBM J9虚拟机(build 2.6,JRE 1.7.0 Linux x86-32 20110810_88604)(支持JIT,支持AOT) J9VM-R26_Java726_GA_20110810_1208_B88592 JIT-r11_20110810_20466 GC-R26_Java726_GA_20110810_1208_B88592 J9CL-20110810_88604) JCL-20110809_01基于Oracle 7b147 蚂蚁任务的输出:

java version "1.7.0" Java(TM) SE Runtime Environment (build pxi3270-20110827_01) IBM J9 VM (build 2.6, JRE 1.7.0 Linux x86-32 20110810_88604 (JIT enabled, AOT enabled) J9VM - R26_Java726_GA_20110810_1208_B88592 JIT - r11_20110810_20466 GC - R26_Java726_GA_20110810_1208_B88592 J9CL - 20110810_88604) JCL - 20110809_01 based on Oracle 7b147 compile: [echo] Compiling source code... [javac] Compiling 135 source files to /home/*********/WEB-INF/classes [clover] Clover Version 3.1.2, built on November 07 2011 (build-842) [clover] Loaded from: /home/*******/clover.jar [clover] Clover: Commercial License registered to *******. [clover] Updating existing database at '/home/********/dist/clover/clover.db'. [clover] Processing files at 1.7 source level. [clover] Clover all over. Instrumented 135 files (12 packages). [clover] Elapsed time = 1.597 secs. (84.534 files/sec, 12,463.369 srclines/sec) [javac] /tmp/clover2218935617827048125.tmp/com/****/web/DownloadService.java:232: error: illegal start of type [javac] __CLR3_1_24ae4aegwpi0zhh.R.inc(5592);try (new java.lang.AutoCloseable() {{__CLR3_1_24ae4aegwpi0zhh.R.inc(5593);}public void close(){}};CSVWriter w = new CSVWriter(new OutputStreamWriter(response.getOutputStream(), "UTF-8"));){ 汇编: [echo]正在编译源代码。。。 [javac]将135个源文件编译到/home/************/WEB-INF/classes [clover]clover版本3.1.2,于2011年11月7日建成(build-842) [clover]加载自:/home/********/clover.jar [clover]clover:注册于*******的商业许可证。 [clover]正在更新位于“/home/********/dist/clover/clover.db”的现有数据库。 [clover]在1.7源代码级别处理文件。 到处都是三叶草。检测了135个文件(12个包)。 [clover]经过的时间=1.597秒。(84.534文件/秒,12463.369行/秒) [javac]/tmp/clover2218935617827048125.tmp/com/**/web/DownloadService.java:232:错误:类型的非法开始 [javac]uu CLR3_1_24ae4aegwpi0zhh.R.inc(5592);try(new java.lang.AutoCloseable(){{{{uuu CLR3_1_24ae4aewpi0zhh.R.inc(5593);}public void close(){};CSVWriter w=new CSVWriter(new OutputStreamWriter(response.getOutputStream(),“UTF-8”);){ 您的JDK版本,似乎不允许这样做

选中此项:

语法:JLS§14.20中关于幽会的现有语法作品集增加了:

TryStatement:
    try ResourceSpecification Block Catchesopt Finallyopt 

Supporting new grammar productions are added:

ResourceSpecification:
    ( Resources ) 
Resources:
    Resource 
    Resource ; Resources 
Resource:
    VariableModifiers Type VariableDeclaratorId = Expression 
    Expression 
[组合语法的一个含义是try语句必须至少包含catch子句、finally块和资源规范中的一个。此外,try语句允许正好包含这三个组件中的一个。请注意,在资源规范中使用尾随分号是非法的。 .]

尝试删除最后一个分号:

try (final CSVWriter w = new CSVWriter(new OutputStreamWriter(r.getOutputStream(), "UTF-8"))){
//do stuff......
}
您的JDK版本,似乎不允许这样做

选中此项:

语法:JLS§14.20中关于幽会的现有语法作品集增加了:

TryStatement:
    try ResourceSpecification Block Catchesopt Finallyopt 

Supporting new grammar productions are added:

ResourceSpecification:
    ( Resources ) 
Resources:
    Resource 
    Resource ; Resources 
Resource:
    VariableModifiers Type VariableDeclaratorId = Expression 
    Expression 
[组合语法的一个含义是try语句必须至少包含catch子句、finally块和资源规范中的一个。此外,try语句允许正好包含这三个组件中的一个。请注意,在资源规范中使用尾随分号是非法的。 .]

尝试删除最后一个分号:

try (final CSVWriter w = new CSVWriter(new OutputStreamWriter(r.getOutputStream(), "UTF-8"))){
//do stuff......
}