pantsbuild / jarjar

An export of https://code.google.com/p/jarjar/ @ svn:r142 for pants tool use and further development.
Apache License 2.0
37 stars 27 forks source link

Calls in $deserializeLambda$ don't get remapped to use the new package #45

Closed johnedmonds closed 5 years ago

johnedmonds commented 5 years ago

I'm trying to replace com.google with shaded.com.google but see the line below to find (Lorg/apache/beam/sdk/transforms/SerializableFunction;Lcom/google/cloud/bigtable/config/BigtableOptions$Builder;)Lcom/google/cloud/bigtable/config/BigtableOptions$Builder; was not renamed.

I suspect this is because javac just emitted this as an actual string argument to SerializedLambda.getImplMethodSignature.

private static java.lang.Object $deserializeLambda$(java.lang.invoke.SerializedLambda);
    Code:
       0: aload_0
       1: invokevirtual #281                // Method java/lang/invoke/SerializedLambda.getImplMethodName:()Ljava/lang/String;
       4: astore_1
       5: iconst_m1
       6: istore_2
       7: aload_1
       8: invokevirtual #287                // Method java/lang/String.hashCode:()I
      11: lookupswitch  { // 1
            -788612761: 28
               default: 40
          }
      28: aload_1
      29: ldc_w         #288                // String lambda$enableBulkApiConfigurator$436438d5$1
      32: invokevirtual #292                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
      35: ifeq          40
      38: iconst_0
      39: istore_2
      40: iload_2
      41: lookupswitch  { // 1
                     0: 60
               default: 148
          }
      60: aload_0
      61: invokevirtual #295                // Method java/lang/invoke/SerializedLambda.getImplMethodKind:()I
      64: bipush        6
      66: if_icmpne     148
      69: aload_0
      70: invokevirtual #298                // Method java/lang/invoke/SerializedLambda.getFunctionalInterfaceClass:()Ljava/lang/String;
      73: ldc_w         #300                // String org/apache/beam/sdk/transforms/SerializableFunction
      76: invokevirtual #303                // Method java/lang/Object.equals:(Ljava/lang/Object;)Z
      79: ifeq          148
      82: aload_0
      83: invokevirtual #306                // Method java/lang/invoke/SerializedLambda.getFunctionalInterfaceMethodName:()Ljava/lang/String;
      86: ldc_w         #307                // String apply
      89: invokevirtual #303                // Method java/lang/Object.equals:(Ljava/lang/Object;)Z
      92: ifeq          148
      95: aload_0
      96: invokevirtual #310                // Method java/lang/invoke/SerializedLambda.getFunctionalInterfaceMethodSignature:()Ljava/lang/String;
      99: ldc_w         #311                // String (Ljava/lang/Object;)Ljava/lang/Object;
     102: invokevirtual #303                // Method java/lang/Object.equals:(Ljava/lang/Object;)Z
     105: ifeq          148
     108: aload_0
     109: invokevirtual #314                // Method java/lang/invoke/SerializedLambda.getImplClass:()Ljava/lang/String;
     112: ldc_w         #315                // String org/apache/beam/sdk/io/gcp/bigtable/BigtableIO$Write
     115: invokevirtual #303                // Method java/lang/Object.equals:(Ljava/lang/Object;)Z
     118: ifeq          148
     121: aload_0
     122: invokevirtual #318                // Method java/lang/invoke/SerializedLambda.getImplMethodSignature:()Ljava/lang/String;
     125: ldc_w         #320                // String (Lorg/apache/beam/sdk/transforms/SerializableFunction;Lcom/google/cloud/bigtable/config/BigtableOptions$Builder;)Lcom/google/cloud/bigtable/config/BigtableOptions$Builder;
     128: invokevirtual #303                // Method java/lang/Object.equals:(Ljava/lang/Object;)Z
     131: ifeq          148
     134: aload_0
     135: iconst_0
     136: invokevirtual #324                // Method java/lang/invoke/SerializedLambda.getCapturedArg:(I)Ljava/lang/Object;
     139: checkcast     #325                // class org/apache/beam/sdk/transforms/SerializableFunction
     142: invokedynamic #96,  0             // InvokeDynamic #0:apply:(Lorg/apache/beam/sdk/transforms/SerializableFunction;)Lorg/apache/beam/sdk/transforms/SerializableFunction;
     147: areturn
     148: new           #327                // class java/lang/IllegalArgumentException
     151: dup
     152: ldc_w         #329                // String Invalid lambda deserialization
     155: invokespecial #332                // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
     158: athrow