- nt = case constsPool cls M.! idx of
- (CMethod _ nt') -> nt'
- (CIfaceMethod _ nt') -> nt'
- _ -> error "methodHaveReturnValue: something wrong. abort."
- (MethodSignature _ ret) = ntSignature nt
+ nt = case constsPool cls M.! idx of
+ (CMethod _ nt') -> nt'
+ (CIfaceMethod _ nt') -> nt'
+ _ -> error "methodHaveReturnValue: something wrong. abort."
+ (MethodSignature _ ret) = ntSignature nt
+
+methodInfoToMethod :: MethodInfo -> Class Direct -> Method Direct
+methodInfoToMethod mi cls =
+ fromJust $ lookupMethodSig (methName mi) (methSignature mi) cls
+
+methodIsStatic :: Method Direct -> Bool
+methodIsStatic = S.member ACC_STATIC . methodAccessFlags
+
+lookupMethodSig :: B.ByteString -> MethodSignature -> Class Direct -> Maybe (Method Direct)
+lookupMethodSig name sig cls =
+ find (\x -> methodName x == name && methodSignature x == sig) $ classMethods cls