-methodGetArgsCount :: Class Direct -> Word16 -> Word32
-methodGetArgsCount cls idx = fromIntegral $ length args
- where
- nt = case constsPool cls M.! idx of
- (CMethod _ nt') -> nt'
- (CIfaceMethod _ nt') -> nt'
- _ -> error "methodGetArgsCount: something wrong. abort."
- (MethodSignature args _) = ntSignature nt
+
+methodNameTypeByIdx :: Class Direct -> Word16 -> NameType (Method Direct)
+methodNameTypeByIdx cls idx = case constsPool cls M.! idx of
+ (CMethod _ nt') -> nt'
+ (CIfaceMethod _ nt') -> nt'
+ _ -> error "methodGetArgsCount: something wrong. abort."
+
+methodGetArgsCount :: NameType (Method Direct) -> Word32
+methodGetArgsCount nt = genericLength args
+ where (MethodSignature args _) = ntSignature nt