use of com.sun.btrace.annotations.Kind in project btrace by btraceio.
the class VerifierVisitor method checkSampling.
private boolean checkSampling(MethodTree node) {
TreePath mPath = verifier.getTreeUtils().getPath(verifier.getCompilationUnit(), node);
ExecutableElement ee = (ExecutableElement) verifier.getTreeUtils().getElement(mPath);
Sampled s = ee.getAnnotation(Sampled.class);
OnMethod om = ee.getAnnotation(OnMethod.class);
if (s != null && om != null) {
Kind k = om.location().value();
switch(k) {
case ENTRY:
case RETURN:
case ERROR:
case CALL:
{
return true;
}
default:
{
// noop
}
}
reportError("sampler.invalid.location", node);
return false;
}
return true;
}
Aggregations