Skip to content

Latest commit

 

History

History
58 lines (47 loc) · 900 Bytes

README.md

File metadata and controls

58 lines (47 loc) · 900 Bytes

smethods

Method level dependency graph.

Requirements

Java 8

Usage

mvn test-compile
mvn exec:java -Dexec.mainClass=org.smethods.MethodLevelStaticDepsBuilder -Dexec.args="path to test classes"

Background

  1. ASM
  2. Visitor pattern

Example

public class A {
    public static int i = 0;

    public static void inc() {
        i++;
    }

    public static void main(String[] args) {
        B b = new C();
        b.foo();

        inc();
    }
}

class B {
    public void foo() {
        System.out.println("B foo");
    }
}

class C extends B{
    public void foo() {
        System.out.println("C foo");
    }
}
A#<clinit>() A#i
B#foo() 
A#main([Ljava/lang/String;) A#inc(),B#foo(),C#<init>(),C#foo()
A#inc() A#i
B#<init>() 
A#i A#<clinit>()
C#<init>() B#<init>()
C#foo() 
A#<init>()