@Test public void testNormal() { TimerNameCache timerNameCache = new TimerNameCache(); TimerName timerName = timerNameCache.getTimerName(C.class); assertThat(((TimerNameImpl) timerName).name()).isEqualTo("z"); }
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()); } }
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()); } } }
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()); } }  }
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()); } }  TimerName getTimerName(Class<?> adviceClass); }
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()); } }  TimerName getTimerName(Class<?> adviceClass);  }