JDK-6856165 : tests with explicit -target 1.5 fail with jdk7 since javac now defaults to 1.7
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: hs24,7,7u6,7u40
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic,linux
  • CPU: generic,arm
  • Submitted: 2009-06-30
  • Updated: 2016-12-07
  • Resolved: 2016-12-07
Related Reports
Relates :  
Description
During jdk7b63 pit we discovered the following:

Due to recent changes in javac (http://ccc.sfbay.sun.com/6827026)
-target and -source now default to 1.7 (in previous build -source defaulted to 1.5)
so the following tests which explicitly specify -target 1.5 now fail with 
javac: target release 1.5 conflicts with default source release 1.7

XXX/com/sun/jdi/StepTest.java
(specified via annotation)
closed/runtime/4413696/tstc.java
(see closed/runtime/4413696/Test4413696.sh, full path: /net/sqenfs-1.sfbay/export1/comp/vm/testbase/jtreg/7/HS_REGRESSION/test/closed/runtime/4413696/Test4413696.sh
option is specified directly in the shell script.)

possible fixes may be 
- omit the option at all 
(since it defaults to 1.5/1.6 in jdk 6)
- change it to 1.7
- specify also -source 1.5 if 1.5 is required for this test.

To reproduce try
/net/sqenfs-1.sfbay/export1/comp/vm/jdk/hsx/16/pit/b05/jdk7b63/product/*/bin/javac -target 1.5
and
/net/sqenfs-1.sfbay/export1/comp/vm/jdk/hsx/16/pit/b04/jdk7b61/product/*/bin/javac -target 1.5 
and -target 1.4

Update: prefixed StepTest.java test path with 'XXX/' since that
test is being handled by 6868533. That will keep this bug from
causing StepTest.java to appear on the fail_list.

Comments
This is not on our list of current priorities. If this changes, please reopen this issue.
07-12-2016

closed/runtime/4413696/tstc.java passes in 8 promotion, removing hs25 affectedversion.
11-10-2013

EVALUATION Here is some analysis for XXX/com/sun/jdi/StepTest.java test only. The "-target 1.5" option was added in the following delta: test/com/sun/jdi/SCCS/s.StepTest.java: D 1.10 04/01/29 11:27:33 jjh 12 11 00001/00001/00165 MRs: COMMENTS: Testcase fix to match : 4981566: Default javac -target in 1.5 should be 1.4
04-08-2009