Closed beikov closed 1 month ago
I cannot reproduce this problem. Can you create an executable sample?
Turns out, one of the parameters of the method was not visible to the class in which I wanted to define the method: bytebuddy-1465.zip
You are apparently filtering out methods with instrumentedType.getDeclaredMethods().filter(not(isVirtual()).and(relevanceMatcher))
in net.bytebuddy.dynamic.scaffold.MethodRegistry.Default#prepare
, and the relevanceMatcher
seems to consider visibility. Wouldn't it be better to throw an error instead?
Those methods do sometimes exist for bridging calls with respect to generics. But it should indeed be more explicit if you define such methods explicitly. I will have a look if this can be improved.
Hi there, I'm trying to add a static method to a newly created class but there seem to be method filters in place that prevent non-virtual methods to be compiled. This is how I create the method:
net.bytebuddy.dynamic.scaffold.subclass.SubclassDynamicTypeBuilder.InstrumentableMatcher#resolve
andnet.bytebuddy.dynamic.scaffold.MethodGraph.Compiler.Default#compile
both create matchers that only handle methods which are virtual.How am I supposed to add a static method to a class that I want to create?