Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8039210

Fix type error in DefaultResourceInjector

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 9
    • Component/s: xml
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b15

      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)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mkos Miroslav Kos (Inactive)
                Reporter:
                dlsmith Dan Smith
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: