Skip to content

Invalid bytecode in shaded JAR reported under stricter checks in JDK9 #173

@retronym

Description

@retronym

Libraries, Version

shaded-async-client 1.0.1

API

Neither

JDK

Java(TM) SE Runtime Environment (build 9+178)

Expected Behavior

JVM loads classfile

Actual Behavior

⚡ (java_use 9; scala -cp /Users/jz/.ivy2/cache/com.typesafe.play/shaded-asynchttpclient/jars/shaded-asynchttpclient-1.0.1.jar)
Welcome to Scala 2.12.2 (Java HotSpot(TM) 64-Bit Server VM, Java 9).
Type in expressions for evaluation. Or try :help.

scala> play.shaded.ahc.org.asynchttpclient.proxy.ProxyServerSelector.NO_PROXY_SELECTOR
java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class play/shaded/ahc/org/asynchttpclient/proxy/ProxyServerSelector. Method lambda$static$0(Lplay/shaded/ahc/org/asynchttpclient/uri/Uri;)Lplay/shaded/ahc/org/asynchttpclient/proxy/ProxyServer; at index 30 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
  at play.shaded.ahc.org.asynchttpclient.proxy.ProxyServerSelector.<clinit>(ProxyServerSelector.java:21)
  ... 29 elided
⚡ javap -private -c -cp /Users/jz/.ivy2/cache/com.typesafe.play/shaded-asynchttpclient/jars/shaded-asynchttpclient-1.0.1.jar play.shaded.a
Compiled from "ProxyServerSelector.java"
public interface play.shaded.ahc.org.asynchttpclient.proxy.ProxyServerSelector {
  public static final play.shaded.ahc.org.asynchttpclient.proxy.ProxyServerSelector NO_PROXY_SELECTOR;

  public abstract play.shaded.ahc.org.asynchttpclient.proxy.ProxyServer select(play.shaded.ahc.org.asynchttpclient.uri.Uri);

  private static play.shaded.ahc.org.asynchttpclient.proxy.ProxyServer lambda$static$0(play.shaded.ahc.org.asynchttpclient.uri.Uri);
    Code:
       0: aconst_null
       1: areturn

  static {};
    Code:
       0: invokedynamic #33,  0             // InvokeDynamic #0:select:()Lplay/shaded/ahc/org/asynchttpclient/proxy/ProxyServerSelector;
       5: putstatic     #35                 // Field NO_PROXY_SELECTOR:Lplay/shaded/ahc/org/asynchttpclient/proxy/ProxyServerSelector;
       8: return
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions