public static Method getBridgeMethodTarget(Method someMethod) {
        TraitBridge annotation = someMethod.getAnnotation(TraitBridge.class);
        if (annotation==null) {
            return null;
        }
        Class aClass = annotation.traitClass();
        String desc = annotation.desc();
        for (Method method : aClass.getDeclaredMethods()) {
            String methodDescriptor = BytecodeHelper.getMethodDescriptor(method.getReturnType(), method.getParameterTypes());
            if (desc.equals(methodDescriptor)) {
                return method;
            }
        }
        return null;
    }
public static Method getBridgeMethodTarget ( Method someMethod ) { TraitBridge annotation = someMethod . getAnnotation ( TraitBridge . class ) ; if ( annotation == null ) { return null ; } Class aClass = annotation . traitClass ( ) ; String desc = annotation . desc ( ) ; for ( Method method : aClass . getDeclaredMethods ( ) ) { String methodDescriptor = BytecodeHelper . getMethodDescriptor ( method . getReturnType ( ) , method . getParameterTypes ( ) ) ; if ( desc . equals ( methodDescriptor ) ) { return method ; } } return null ; }
Reflection API to find the method corresponding to the default implementation of a trait, given a bridge method.
@param someMethod a method node
@return null if it is not a method implemented in a trait. If it is, returns the method from the trait class.