Benjamin Bentmann wrote:

I did some major changes in the relocator component for MSHADE-28 which
according to the plugin's release history is quite the only change that
might be related. Maybe I managed to get something wrong in there.

OK, I called that MSHADE-38 and have fixed the relocator to work as in version 1.0.x.

There is some subtle behavior of the relocator that makes me wonder whether this is intended. Consider a Shade configuration like this:

  <relocation>
    <pattern>org.util</pattern>
    <excludes>
      <exclude>org.util.noreloc.*</exclude>
    </excludes>
  </relocation>

the notation ".*" at the end of an exclude will also prevent the plugin from renaming the package name itself, i.e. the string literal "org.util.noreloc" in bytecode will stay as is instead of becoming "hidden.org.util.noreloc".

Now imagine rather than using wildcards we would explicitly list up all the classes to be excluded:

  <relocation>
    <pattern>org.util</pattern>
    <excludes>
      <exclude>org.util.noreloc.A</exclude>
      ... all the other classes from this package ...
      <exclude>org.util.noreloc.Z</exclude>
    </excludes>
  </relocation>

In terms of classes, both configurations describe the same set and naively one would expect the plugin to behave just as before (at least I did). However, this time all occurrences of the string "org.util.noreloc" will be changed to "hidden.org.util.noreloc". This will, for instance, wreck havoc on the package imports used to link Classworld's ClassRealms together.

Should we maybe change the relocator to always leave the package names of excluded classes untouched? Algorithmically, this would mean to have an implicit exclusion of the form "package" for every exclude "package.SomeClass" from the plugin configuration.


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to