You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Harvey Raja (JIRA)" <ji...@apache.org> on 2016/06/15 12:30:09 UTC

[jira] [Comment Edited] (MSHADE-228) Shade can incorrectly re-write an InterfaceMethodRef in the constant pool to a MethodRef

    [ https://issues.apache.org/jira/browse/MSHADE-228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331631#comment-15331631 ] 

Harvey Raja edited comment on MSHADE-228 at 6/15/16 12:30 PM:
--------------------------------------------------------------

BTW - looks like I can trivially work around it by bumping the ASM version:

{code}
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm</artifactId>
            <version>5.1</version>
          </dependency>
          <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm-commons</artifactId>
            <version>5.1</version>
          </dependency>
        </dependencies>
{code}


was (Author: harveyraja):
BTW - looks like I can trivially work around it by bumping the ASM version:

{code}
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm</artifactId>
            <version>${asm.version}</version>
          </dependency>
          <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm-commons</artifactId>
            <version>${asm.version}</version>
          </dependency>
        </dependencies>
{code}

> Shade can incorrectly re-write an InterfaceMethodRef in the constant pool to a MethodRef
> ----------------------------------------------------------------------------------------
>
>                 Key: MSHADE-228
>                 URL: https://issues.apache.org/jira/browse/MSHADE-228
>             Project: Maven Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 2.4.3
>            Reporter: Harvey Raja
>
> Given an interface such as:
> {code}
> public interface InvalidMethodRefExample
>     {
>     String getLocation();
>     static InvalidMethodRefExample autoDetect()
>         {
>         return () -> "$Default$";
>         }
>     }
> {code}
> {{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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)