Skip to content

[MSHADE-436] Skips relocation of dependencies if not referenced from class body. #458

Open

Description

@jira-importer

Andres Luuk opened MSHADE-436 and commented

So I have a class like this:

import static org.objectweb.asm.Opcodes.*;

public class CheckUtil {

  public static boolean isPrivate(int access) {
    return (access & ACC_PRIVATE) == ACC_PRIVATE;
  }
}

At compile time Opcodes is inlined. So nothing in the class should reference the class.

But If I look at the javap of CheckUtil.class I see the following:

Constant pool:
    #1 = Class              #2            // org/objectweb/asm/Opcodes
    #2 = Utf8               org/objectweb/asm/Opcodes

Nothing in the method body/later references Opcodes!

Now with shade plugin I want to relocation the package of Opcodes.

Whit shade 3.2.4 the reference was stripped and was not present in the shaded jar, but now with 3.3.0+ the original not-relocation Opcodes is still present in the constant pool of that class.

Maybe stripping the Opcodes was wrong, but in case you don't strip it, you should probably relocation it even it the class body does not reference the class if the class is in the relocation list.

We have a shade & relocation into proguard job, where proguard starts to complain that the input shaded jar to the original not-relocation Opcodes.

 


Affects: 3.3.0, 3.4.0, 3.4.1

Activity

  1. added
    bug
    priority:major
    on Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:major

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions