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

Fix type error in DefaultResourceInjector

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 8
    • xml
    • None
    • b15

      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)

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

              Created:
              Updated:
              Resolved: