test_class.declarator: NS = "ABC_SOME_NS"
test_class.modifier: private static final
test_class.original_string: private static final String NS = "ABC_SOME_NS";
test_class.type: String
test_class.var_name: NS
test_class.declarator: expectedValue
test_class.modifier: private
test_class.original_string: private Object expectedValue;
test_class.type: Object
test_class.var_name: expectedValue
test_class.declarator: cacheKeys
test_class.modifier: private
test_class.original_string: private String[] cacheKeys;
test_class.type: String[]
test_class.var_name: cacheKeys
test_class.file: simple-spring-memcached/src/test/java/com/google/code/ssm/aop/InvalidateMultiCacheAdviceTest.java
test_class.identifier: InvalidateMultiCacheAdviceTest
test_class.superclass: extends AbstractCacheTest<InvalidateMultiCacheAdvice>
test_case.body: @Test
      public void valid() throws Throwable {
          Assume.assumeTrue(isValid);
  
          when(pjp.proceed()).thenReturn(expectedValue);
  
          assertEquals(expectedValue, advice.cacheInvalidateMulti(pjp));
  
          verify(pjp).proceed();
          verify(cache).delete(argThat(new ArgumentMatcher<Collection<String>>() {
  
              @Override
              public boolean matches(Collection<String> set) {
                  Set<String> target = new HashSet<String>(Arrays.asList(cacheKeys));
                  return set.containsAll(target) && target.containsAll(set);
              }
  
          }));
      }
test_case.class_method_signature: InvalidateMultiCacheAdviceTest.valid()
test_case.full_signature: @Test public void valid()
test_case.identifier: valid
test_case.invocations: assumeTrue thenReturn when proceed assertEquals cacheInvalidateMulti proceed verify delete verify argThat asList containsAll containsAll
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void valid()
focal_class.declarator: LOG = LoggerFactory.getLogger(InvalidateMultiCacheAdvice.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(InvalidateMultiCacheAdvice.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.file: simple-spring-memcached/src/main/java/com/google/code/ssm/aop/InvalidateMultiCacheAdvice.java
focal_class.identifier: InvalidateMultiCacheAdvice
focal_class.class_method_signature: InvalidateMultiCacheAdvice.invalidateMulti()
focal_class.full_signature: @Pointcut("@annotation(com.google.code.ssm.api.InvalidateMultiCache)") public void invalidateMulti()
focal_class.identifier: invalidateMulti
focal_class.modifiers: @Pointcut("@annotation(com.google.code.ssm.api.InvalidateMultiCache)") public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void invalidateMulti()
focal_class.class_method_signature: InvalidateMultiCacheAdvice.cacheInvalidateMulti(final ProceedingJoinPoint pjp)
focal_class.full_signature: @Around("invalidateMulti()") public Object cacheInvalidateMulti(final ProceedingJoinPoint pjp)
focal_class.identifier: cacheInvalidateMulti
focal_class.modifiers: @Around("invalidateMulti()") public
focal_class.parameters: (final ProceedingJoinPoint pjp)
focal_class.return: Object
focal_class.signature: Object cacheInvalidateMulti(final ProceedingJoinPoint pjp)
focal_class.class_method_signature: InvalidateMultiCacheAdvice.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 CacheAdvice
focal_method.body: @Around("invalidateMulti()")
      public Object cacheInvalidateMulti(final ProceedingJoinPoint pjp) throws Throwable {
          if (isDisabled()) {
              getLogger().info("Cache disabled");
              return pjp.proceed();
          }
  
          // This is injected caching. If anything goes wrong in the caching, LOG
          // the crap outta it, but do not let it surface up past the AOP injection itself.
          Collection<String> cacheKeys = null;
          final AnnotationData data;
          final Method methodToCache;
          try {
              methodToCache = getCacheBase().getMethodToCache(pjp, InvalidateMultiCache.class);
              final InvalidateMultiCache annotation = methodToCache.getAnnotation(InvalidateMultiCache.class);
              data = AnnotationDataBuilder.buildAnnotationData(annotation, InvalidateMultiCache.class, methodToCache);
              if (!data.isReturnKeyIndex()) {
                  cacheKeys = getCacheBase().getCacheKeyBuilder().getCacheKeys(data, pjp.getArgs(), methodToCache.toString());
              }
          } catch (Exception ex) {
              warn(ex, "Caching on method %s aborted due to an error.", pjp.toShortString());
              return pjp.proceed();
          }
  
          final Object result = pjp.proceed();
  
          // This is injected caching. If anything goes wrong in the caching, LOG
          // the crap outta it, but do not let it surface up past the AOP injection itself.
          try {
              // If we have a -1 key index, then build the cacheKeys now.
              if (data.isReturnKeyIndex()) {
                  if (!getCacheBase().verifyTypeIsList(result.getClass())) {
                      throw new InvalidAnnotationException(String.format("The return type is not a [%s]. "
                              + "The method [%s] does not fulfill the requirements.", List.class.getName(), methodToCache.toString()));
                  }
  
                  @SuppressWarnings("unchecked")
                  final List<Object> keyObjects = (List<Object>) result;
                  cacheKeys = getCacheBase().getCacheKeyBuilder().getCacheKeys(keyObjects, data.getNamespace());
              }
              getCacheBase().getCache(data).delete(cacheKeys);
          } catch (Exception ex) {
              warn(ex, "Caching on method %s aborted due to an error.", pjp.toShortString());
          }
          return result;
  
      }
focal_method.class_method_signature: InvalidateMultiCacheAdvice.cacheInvalidateMulti(final ProceedingJoinPoint pjp)
focal_method.full_signature: @Around("invalidateMulti()") public Object cacheInvalidateMulti(final ProceedingJoinPoint pjp)
focal_method.identifier: cacheInvalidateMulti
focal_method.invocations: isDisabled info getLogger proceed getMethodToCache getCacheBase getAnnotation buildAnnotationData isReturnKeyIndex getCacheKeys getCacheKeyBuilder getCacheBase getArgs toString warn toShortString proceed proceed isReturnKeyIndex verifyTypeIsList getCacheBase getClass format getName toString getCacheKeys getCacheKeyBuilder getCacheBase getNamespace delete getCache getCacheBase warn toShortString
focal_method.modifiers: @Around("invalidateMulti()") public
focal_method.parameters: (final ProceedingJoinPoint pjp)
focal_method.return: Object
focal_method.signature: Object cacheInvalidateMulti(final ProceedingJoinPoint pjp)