Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DiSL
DiSL
Commits
67d3b846
Commit
67d3b846
authored
Apr 07, 2020
by
Petr Tuma
Browse files
Example for synthetic local variable
parent
8b4182e6
Pipeline
#8247
passed with stages
in 3 minutes and 46 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
examples/local/build.xml
0 → 100644
View file @
67d3b846
<project
name=
"disl-example"
basedir=
"."
default=
"build"
>
<import
file=
"../build-example.xml"
/>
</project>
examples/local/src-app/Main.java
0 → 100644
View file @
67d3b846
public
class
Main
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"Application: Inside method main"
);
}
}
examples/local/src-inst/DiSLClass.java
0 → 100644
View file @
67d3b846
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"
);
}
}
examples/local/src-inst/MANIFEST.MF
0 → 100644
View file @
67d3b846
Manifest-Version: 1.0
DiSL-Classes: DiSLClass
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment