JDK-8005937 : Remove -source 1.4 -target 1.4 from tests
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-01-09
  • Updated: 2014-01-14
  • Resolved: 2013-01-23
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 8
8 b75Fixed
Related Reports
Relates :  
Description
The following tests should be checked to see if it really necessary to specify -source and/or -target in the @compile tag:

closed/java/security/cert/X509CRLSelector/MatchCRLWithNonStdIssuerDN.java
java/security/cert/PKIXBuilderParameters/InvalidParameters.java
java/security/cert/PKIXParameters/InvalidParameters.java

Another one is sun/security/util/Oid/S11N.sh, which calls javac with -source and -target 1.4.

The motivation for this bug is that these options are not compatible with the -profile option and so the tests are marked in error when run on profile builds.
Comments
An invalid set can be constructed under source 1.5 or higher by the use of a few unsafe casts. In other words, using source 1.4 is not necessary to test the condition in question.
14-01-2014

The two InvalidParameters.java tests won't be changed for now because they are testing a valid use-case. If an application (compiled with a JDK prior to 1.5) is using our APIs but has not updated its code to use generics, it still throws ClassCastException. The -source 1.4 option is necessary to test this case.
23-01-2013

All the tests modified at the same time, and have the following comment: ^Ad D 1.3 04/04/16 12:19:58 gafter 4 3 ^Ac Modify test to accomodate default -source 1.5 The error on one of these is: % javac InvalidParameters.java InvalidParameters.java:34: error: no suitable constructor found for PKIXBuilderParameters(Set<String>,<null>) new PKIXBuilderParameters(Collections.singleton(new String()), null); ^ constructor PKIXBuilderParameters.PKIXBuilderParameters(KeyStore,CertSelector) is not applicable (actual argument Set<String> cannot be converted to KeyStore by method invocation conversion) constructor PKIXBuilderParameters.PKIXBuilderParameters(Set<TrustAnchor>,CertSelector) is not applicable (actual argument Set<String> cannot be converted to Set<TrustAnchor> by method invocation conversion) Note: InvalidParameters.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
09-01-2013