Uploaded image for project: 'Maven Shade Plugin'
  1. Maven Shade Plugin
  2. MSHADE-228

Shade can incorrectly re-write an InterfaceMethodRef in the constant pool to a MethodRef

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.3
    • 3.0.0
    • None

    Description

      Given an interface such as:

      public interface InvalidMethodRefExample
          {
          String getLocation();
      
          static InvalidMethodRefExample autoDetect()
              {
              return () -> "$Default$";
              }
          }
      

      javac correctly produces a bootstrap method that has a MethodHandle for its second argument to LambdaMetafactory.metafactory, and the MethodHandle is to an InterfaceMethodref.

      After running shade the InterfaceMethodref becomes a Methodref.

      This seems to have been the result for some time now but with Java 9 it appears that the java team have decided to enforce this CP type and will be a real problem when using shade and Java 9.

      Attachments

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              harveyraja Harvey Raja
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: