test_class.declarator: EXPIRATION = 80
test_class.modifier: private static final
test_class.original_string: private static final int EXPIRATION = 80;
test_class.type: int
test_class.var_name: EXPIRATION
test_class.declarator: reternValue
test_class.modifier: private final
test_class.original_string: private final Object reternValue;
test_class.type: Object
test_class.var_name: reternValue
test_class.declarator: expectedValue
test_class.modifier: private final
test_class.original_string: private final Object expectedValue;
test_class.type: Object
test_class.var_name: expectedValue
test_class.file: simple-spring-memcached/src/test/java/com/google/code/ssm/aop/counter/UpdateCounterInCacheAdviceTest.java
test_class.identifier: UpdateCounterInCacheAdviceTest
test_class.superclass: extends AbstractCounterTest<UpdateCounterInCacheAdvice>
test_case.body: @Test
      public void invalidUpdateCounterInCache() throws Throwable {
          Assume.assumeThat(isValid, CoreMatchers.is(false));
  
          advice.cacheCounterInCache(pjp, reternValue);
  
          verify(cache, never()).setCounter(anyString(), anyInt(), anyLong());
          verify(cache, never()).set(anyString(), anyInt(), anyLong(), any(SerializationType.class));
          verify(pjp, never()).proceed();
      }
test_case.class_method_signature: UpdateCounterInCacheAdviceTest.invalidUpdateCounterInCache()
test_case.full_signature: @Test public void invalidUpdateCounterInCache()
test_case.identifier: invalidUpdateCounterInCache
test_case.invocations: assumeThat is cacheCounterInCache setCounter verify never anyString anyInt anyLong set verify never anyString anyInt anyLong any proceed verify never
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void invalidUpdateCounterInCache()
focal_class.declarator: LOG = LoggerFactory.getLogger(UpdateCounterInCacheAdvice.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(UpdateCounterInCacheAdvice.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.file: simple-spring-memcached/src/main/java/com/google/code/ssm/aop/counter/UpdateCounterInCacheAdvice.java
focal_class.identifier: UpdateCounterInCacheAdvice
focal_class.class_method_signature: UpdateCounterInCacheAdvice.updateCounter()
focal_class.full_signature: @Pointcut("@annotation(com.google.code.ssm.api.counter.UpdateCounterInCache)") public void updateCounter()
focal_class.identifier: updateCounter
focal_class.modifiers: @Pointcut("@annotation(com.google.code.ssm.api.counter.UpdateCounterInCache)") public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void updateCounter()
focal_class.class_method_signature: UpdateCounterInCacheAdvice.cacheCounterInCache(final JoinPoint jp, final Object retVal)
focal_class.full_signature: @AfterReturning(pointcut = "updateCounter()", returning = "retVal") public void cacheCounterInCache(final JoinPoint jp, final Object retVal)
focal_class.identifier: cacheCounterInCache
focal_class.modifiers: @AfterReturning(pointcut = "updateCounter()", returning = "retVal") public
focal_class.parameters: (final JoinPoint jp, final Object retVal)
focal_class.return: void
focal_class.signature: void cacheCounterInCache(final JoinPoint jp, final Object retVal)
focal_class.class_method_signature: UpdateCounterInCacheAdvice.getLogger()
focal_class.full_signature: @Override protected Logger getLogger()
focal_class.identifier: getLogger
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: Logger
focal_class.signature: Logger getLogger()
focal_class.superclass: extends CounterInCacheBase
focal_method.body: @AfterReturning(pointcut = "updateCounter()", returning = "retVal")
      public void cacheCounterInCache(final JoinPoint jp, final Object retVal) throws Throwable {
          if (isDisabled()) {
              getLogger().info("Cache disabled");
              return;
          }
  
          // For Update*Cache, an AfterReturning aspect is fine. We will only
          // apply our caching after the underlying method completes successfully, and we will have
          // the same access to the method params.
          String cacheKey = null;
          UpdateCounterInCache annotation;
          try {
              Method methodToCache = getCacheBase().getMethodToCache(jp, UpdateCounterInCache.class);
              annotation = methodToCache.getAnnotation(UpdateCounterInCache.class);
              AnnotationData data = AnnotationDataBuilder.buildAnnotationData(annotation, UpdateCounterInCache.class, methodToCache);
              cacheKey = getCacheBase().getCacheKeyBuilder().getCacheKey(data, jp.getArgs(), methodToCache.toString());
  
              Object dataObject = getCacheBase().getUpdateData(data, methodToCache, jp.getArgs(), retVal);
              if (checkData(dataObject, jp)) {
                  long value = ((Number) dataObject).longValue();
                  getCacheBase().getCache(data).setCounter(cacheKey, annotation.expiration(), value);
              }
          } catch (Exception ex) {
              warn(ex, "Updating counter [%s] in cache via %s aborted due to an error.", cacheKey, jp.toShortString());
          }
      }
focal_method.class_method_signature: UpdateCounterInCacheAdvice.cacheCounterInCache(final JoinPoint jp, final Object retVal)
focal_method.full_signature: @AfterReturning(pointcut = "updateCounter()", returning = "retVal") public void cacheCounterInCache(final JoinPoint jp, final Object retVal)
focal_method.identifier: cacheCounterInCache
focal_method.invocations: isDisabled info getLogger getMethodToCache getCacheBase getAnnotation buildAnnotationData getCacheKey getCacheKeyBuilder getCacheBase getArgs toString getUpdateData getCacheBase getArgs checkData longValue setCounter getCache getCacheBase expiration warn toShortString
focal_method.modifiers: @AfterReturning(pointcut = "updateCounter()", returning = "retVal") public
focal_method.parameters: (final JoinPoint jp, final Object retVal)
focal_method.return: void
focal_method.signature: void cacheCounterInCache(final JoinPoint jp, final Object retVal)