Created By: demo
Created At: Thu, 20 Jun 2013 17:22:39 -0500
Input Dataset: 2013 May/SF
Last Submitted At: Thu, 20 Jun 2013 17:22:39 -0500
Last Finished At: Thu, 20 Jun 2013 17:28:40 -0500 (6m 1s)
Source Code
# How is transient keyword used in Java?
p: Project = input;
TransientTotal: output sum of int;
TransientMax: output maximum(1) of string weight int;
TransientMin: output minimum(1) of string weight int;
TransientMean: output mean of int;
count := 0;
s: stack of int;
visit(p, visitor {
before node: CodeRepository -> {
# only look at the latest snapshot
# and only include Java files
snapshot := getsnapshot(node, "SOURCE_JAVA_JLS");
foreach (i: int; def(snapshot[i]))
visit(snapshot[i]);
stop;
}
before node: Declaration -> {
# only interested in fields, which only occur inside (anonymous) classes
if (node.kind == TypeKind.CLASS || node.kind == TypeKind.ANONYMOUS) {
# store old value
push(s, count);
count = 0;
# find uses and increment counter
foreach (i: int; def(node.fields[i]))
foreach (j: int; node.fields[i].modifiers[j].kind == ModifierKind.OTHER
&& node.fields[i].modifiers[j].other == "transient")
count++;
} else
stop;
}
after node: Declaration -> {
# output result
TransientTotal << count;
TransientMax << p.id weight count;
TransientMin << p.id weight count;
TransientMean << count;
# restore previous value
count = pop(s);
}
});
Output
Job Output Size: 124 bytes
TransientMax[] = 219562, 96.0
TransientMean[] = 0.019492333616820987
TransientMin[] = 100007, 0.0
TransientTotal[] = 199447
Compilation
Status: Finished
Started: Thu, 20 Jun 2013 17:22:40 -0500
Finished: Thu, 20 Jun 2013 17:22:44 -0500 (4s)
Execution
Status: Finished
Started: Thu, 20 Jun 2013 17:22:50 -0500
Finished: Thu, 20 Jun 2013 17:28:40 -0500 (5m 50s)