-
-
Notifications
You must be signed in to change notification settings - Fork 808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shaded multi-release ASM classes are missing nested classes #1724
Comments
Yes, indeed. The regex does not include the $ symbol, so the inner classes only exist in the Java 5 version. My bad, I fixed this now and will do a new release. |
Thanks! Though it looks like your fix might contain a typo which is now causing another issue: f164ddd#r148674133 (haven't verified it yet though) |
It just includes a character that will never be there, so it has no effect, but it is better to fix it of course. I assume my IDE auto-completed something there. Thanks for pointing it out! |
I was a bit unsure how the
"ModuleHashesAttribute.class".matches("ModuleHashesAttribute[a-zA-Z0-9$\\.]]*.class")
// => false (but for example Thanks for the follow-up fix! |
Seems to be fixed in 1.15.10, thanks! (feel free to close this issue if you want) Another thing I noticed: The multi-release directory seems to be missing these classes, is that intended?
|
That is true. Those classes are templating classes, used for build plugins, but they are never loaded. If one wanted to use the standard build plugins, one would need to keep those. |
Do you mean a user would have to manually keep those? That might not be obvious, and might cause issues when users only keep Would it be possible and make sense to copy those classes to (Side note: I am not affected by this currently, but I assume other users might be?) |
Or do you mean they are never needed at runtime, regardless of how Byte Buddy is used? I guess in that case it would not matter in most cases whether they exist in |
They are never loaded but used as advice templates when the plugin is used. I thought about this and decided to remove the entire precompilation and rather generate the advice on demand dynamically. This makes the implementation independent of the underlying class loader, too, what always was a minor concern of mine. And this resolves this issue, too. I think the issue is save to ignore for 99.9% of users, so I will not rush a release, but it is already added to master. |
Version
byte-buddy-1.15.9.jar
Description
The latest Byte Buddy versions include classes for both Java 5 (regular location in JAR) and Java 8 (as multi-release classes under
META-INF/versions/9
), see #1657 and #1719.The problem is that the multi-release shaded ASM classes (under
META-INF/versions/9/net/bytebuddy/jar/asm/
) seem to be incomplete, these classes are missing:Attribute$Set.class
SymbolTable$Entry.class
SymbolTable$LabelEntry.class
So the advice in #1719 of omitting either the Java 5 or Java 8 classes to avoid duplication does not work; you encounter a
ClassNotFoundException: net.bytebuddy.jar.asm.SymbolTable$Entry
.Maybe the problem is that these include patterns don't contain
$
to also match nested classes (respectively an escaped\$
)?byte-buddy/byte-buddy/pom.xml
Lines 448 to 451 in c15b988
The text was updated successfully, but these errors were encountered: