JDK-8039210 : Fix type error in DefaultResourceInjector
  • Type: Bug
  • Component: xml
  • Sub-Component: jax-ws
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-04-03
  • Updated: 2014-05-30
  • Resolved: 2014-05-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 9
9 b15Fixed
Related Reports
Blocks :  
Description
javac has a bug in which the upper bound of a capture variable is used for inference, rather than the capture variable itself.  This allows the following incorrect code, from jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/DefaultResourceInjector.java, to compile without error:

InjectionPlan.buildInjectionPlan(instance.getClass(),WebServiceContext.class,false)
            .inject(instance,context)

(javac infers T=Object for 'buildInjectionPlan', when it should infer T=capturevar)

When the javac bug gets fixed, this code will no longer compile.  So this bug blocks the javac bug fix.

Suggested fix:

InjectionPlan.<Object>buildInjectionPlan(instance.getClass(),WebServiceContext.class,false)
            .inject(instance,context)

Comments
Fix pushed to upstream repo, soon will be submitted for jdk review
14-05-2014

Raised priority because the issue this blocks leads to a compiler regression.
09-05-2014