Closed perlun closed 6 days ago
protected
for this to work (with the default class loading strategy).Yep, thanks for noting this down for the sake of other people. :bow: I'll leave this open for now in case @raphw or anyone else wants to improve the UX here, to make it easier for people running into this to know how they need to modify their code.
That's a tricky thing because the class loading will actually implicate a visibility here. This cannot be decided during compilation, and might be legal when loading, this is why it is not failing the class creation.
Hi,
Similarly as in https://github.com/raphw/byte-buddy/issues/539, we are seeing
<subj>
when trying to use ByteBuddy in our code base. More specifically, this exception (note that the bytecode is different to the one in that issue):The calling code (where we try to create the ByteBuddy-based instance) looks like this. It's the
load( getClass().getClassLoader() )
call that fails.I looked at this in the debugger and I get the feeling that ByteBuddy somehow fails to get the fields from the type it has defined itself. :thinking: But I am clearly not an expert on the ByteBuddy internals so this may clearly be an incorrect understanding of the problem at hand.
I realize that this might be hard to say much about without a MCVE, but do you have any obvious ideas of what could go wrong here, or where we could/should look next? If so, much appreciated. :bow:
(ByteBuddy version: 1.14.11. JDK versions: reproduced on JDK 8, 17 and 21)