JDK-8062523 : [TEST_BUG] Try without catch or finally results in compilation error for 3 tests in JDK 6u91b05
  • Type: Bug
  • Component: core-svc
  • Affected Version: 6u91
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2014-10-30
  • Updated: 2014-11-17
  • Resolved: 2014-11-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u91 b09Fixed
Related Reports
Relates :  
Description
Testsuite name: j2se_rest
Test name(s): com/sun/tools/attach/BasicTests.java
Product(s) tested: JDK 6u91b05
OS/architecture: Linux
Product Bug or Test Bug : Test Bug
Reproducible: Always
Reproducible on machine: stt-33.ru.oracle.com, spb23117.ru.oracle.com, spb23297.ru.oracle.com(Windows)

Is it a Regression: No
Regression introduced in release/build: N/A
Test result on the last GAed release for this train: 
Test result on FCS:  
Is it a platform specific issue: No( fails in linux and windows)

Exception/Error from Log:
----------System.err:(16/919)----------
/export/local/aurora/CommonData/j2se/test/com/sun/tools/attach/Application.java:30: '{' expected
        try (PrintWriter writer = new PrintWriter(outFileName)) {
           ^
/export/local/aurora/CommonData/j2se/test/com/sun/tools/attach/Application.java:30: ')' expected
        try (PrintWriter writer = new PrintWriter(outFileName)) {
                        ^
/export/local/aurora/CommonData/j2se/test/com/sun/tools/attach/Application.java:30: ';' expected
        try (PrintWriter writer = new PrintWriter(outFileName)) {
                                                              ^
/export/local/aurora/CommonData/j2se/test/com/sun/tools/attach/Application.java:30: 'try' without 'catch' or 'finally'
        try (PrintWriter writer = new PrintWriter(outFileName)) {
        ^
/export/local/aurora/CommonData/j2se/test/com/sun/tools/attach/Application.java:42: reached end of file while parsing
}
 ^
5 errors
result: Failed. Compilation failed: Compilation failed


test result: Failed. Compilation failed: Compilation failed

Test run log location:
Steps to reproduce: 
1. login into stt-33.ru.oracle.com
2. run : /export/jdk/jdk1.6.0_91b05/bin/java -jar /net/stt-13.ru.oracle.com/export/home0/regression/tools/jtreg/lib/jtreg.jar -timeout:10 -noreport -verbose -vmoptions:'-Xmixed -server -d64' -automatic -jdk:/export/jdk/jdk1.6.0_91b05  -r:/export/home/gtee -w:/export/home/gtee/ -dir:/net/stt-13.ru.oracle.com/export/home0/regression/workspaces/1.6.0/1.6.0_91b05/j2se/test com/sun/tools/attach/BasicTests.java

New code has been added in Application.java which is causing compilation error as try-with-resources statement is introduced in JDK 7. 
Comments
Critical Request Template - Justification : Fixing test - Risk Analysis : None, pure test fix - Webrev : http://closedjdk.us.oracle.com/jdk6u/jdk6u-cpu/j2se/rev/24a0f518613f - Testing (done/to-be-done) : Run new test - Back ports (done/to-be-done) : Done - Fix For Release : JDK 6
11-11-2014

SQE OK to take test bug fixes in CPU15_01
11-11-2014

This seems related to the tests that were added/changed in JDK-8041979
04-11-2014

Only a problem in jdk6, try with resource exist in jdk7 and up.
04-11-2014

It is a test issue. New tests were introduced in 6u91 b05.
31-10-2014

RULE com/sun/tools/attach/BasicTests.java CompilationError Compilation failed RULE com/sun/tools/attach/PermissionTest.java CompilationError Compilation failed RULE com/sun/tools/attach/TempDirTest.java CompilationError Compilation failed
30-10-2014