Commit 67d3b846 authored by Petr Tuma's avatar Petr Tuma

Example for synthetic local variable

parent 8b4182e6
Pipeline #9264 passed with stages
in 2 minutes and 28 seconds
<project name="disl-example" basedir="." default="build">
<import file="../build-example.xml" />
</project>
public class Main {
public static void main(String[] args) {
System.out.println("Application: Inside method main");
}
}
import ch.usi.dag.disl.annotation.After;
import ch.usi.dag.disl.annotation.AfterReturning;
import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.annotation.SyntheticLocal;
import ch.usi.dag.disl.marker.BodyMarker;
public class DiSLClass {
@SyntheticLocal
public static long timeBefore;
@Before(marker = BodyMarker.class, scope = "Main.main")
public static void beforemain() {
System.out.println("Instrumentation: Before method main");
timeBefore = System.nanoTime ();
}
@After(marker = BodyMarker.class, scope = "Main.main")
public static void aftermain() {
long timeAfter = System.nanoTime ();
System.out.println("Instrumentation: After method main which took " + (timeAfter - timeBefore) + "ns");
}
}
Manifest-Version: 1.0
DiSL-Classes: DiSLClass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment