class TimerNameCache {

    public TimerName getTimerName(Class<?> adviceClass) {
        if (adviceClass == null) {
            logger.error("getTimerName(): argument 'adviceClass' must be non-null");
            return unknownTimerName;
        }
        Pointcut pointcut = adviceClass.getAnnotation(Pointcut.class);
        if (pointcut == null) {
            logger.warn("advice has no @Pointcut: {}", adviceClass.getName());
            return unknownTimerName;
        } else if (pointcut.timerName().isEmpty()) {
            logger.warn("advice @Pointcut has no timerName() attribute: {}", adviceClass.getName());
            return unknownTimerName;
        } else {
            return getName(pointcut.timerName());
        }
    }

}