Skip to content

Commit

Permalink
fix: add methods and fields types into usage info (#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
skylot committed May 27, 2020
1 parent 7d29c5d commit e7b00cc
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,16 @@ public void clsUse(ClassNode cls, ClassNode depCls) {
public void methodUse(MethodNode mth, MethodNode useMth) {
clsUse(mth, useMth.getParentClass());
mthUsage.add(useMth, mth);
// implicit usage
clsUse(mth, useMth.getReturnType());
useMth.getMethodInfo().getArgumentsTypes().forEach(argType -> clsUse(mth, argType));
}

public void fieldUse(MethodNode mth, FieldNode useFld) {
clsUse(mth, useFld.getParentClass());
fieldUsage.add(useFld, mth);
// implicit usage
clsUse(mth, useFld.getType());
}

private void processType(ArgType type, Consumer<ClassNode> consumer) {
Expand Down

0 comments on commit e7b00cc

Please sign in to comment.