test_class.declarator: builder = new KeyIndexesBuilder()
test_class.modifier: private final
test_class.original_string: private final KeyIndexesBuilder builder = new KeyIndexesBuilder();
test_class.type: KeyIndexesBuilder
test_class.var_name: builder
test_class.declarator: data
test_class.modifier: private
test_class.original_string: private AnnotationData data;
test_class.type: AnnotationData
test_class.var_name: data
test_class.file: simple-spring-memcached/src/test/java/com/google/code/ssm/aop/support/builder/KeyIndexesBuilderTest.java
test_class.identifier: KeyIndexesBuilderTest
test_case.body: @Test
      public void shouldPopulateReturnKeyAnnotation() throws Exception {
          final Class<? extends Annotation> expected = InvalidateSingleCache.class;
          final Method targetMethod = new Mirror().on(AnnotationDataDummy.class).reflect().method("populateKeyProvider02")
                  .withArgs(String.class);
  
          builder.populate(data, null, expected, targetMethod);
  
          assertTrue(data.getKeyIndexes().isEmpty());
          assertTrue(data.isReturnKeyIndex());
      }
test_case.class_method_signature: KeyIndexesBuilderTest.shouldPopulateReturnKeyAnnotation()
test_case.full_signature: @Test public void shouldPopulateReturnKeyAnnotation()
test_case.identifier: shouldPopulateReturnKeyAnnotation
test_case.invocations: withArgs method reflect on populate assertTrue isEmpty getKeyIndexes assertTrue isReturnKeyIndex
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldPopulateReturnKeyAnnotation()
focal_class.declarator: LOG = LoggerFactory.getLogger(KeyIndexesBuilder.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(KeyIndexesBuilder.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: COMPARATOR = new ParameterValueKeyProviderComparator()
focal_class.modifier: private static final
focal_class.original_string: private static final Comparator<ParameterValueKeyProvider> COMPARATOR = new ParameterValueKeyProviderComparator();
focal_class.type: Comparator<ParameterValueKeyProvider>
focal_class.var_name: COMPARATOR
focal_class.file: simple-spring-memcached/src/main/java/com/google/code/ssm/aop/support/builder/KeyIndexesBuilder.java
focal_class.identifier: KeyIndexesBuilder
focal_class.class_method_signature: KeyIndexesBuilder.build(final AnnotationData data, final Annotation annotation, final Class<? extends Annotation> expectedAnnotationClass,
              final Method targetMethod)
focal_class.full_signature: @Override protected void build(final AnnotationData data, final Annotation annotation, final Class<? extends Annotation> expectedAnnotationClass,
              final Method targetMethod)
focal_class.identifier: build
focal_class.modifiers: @Override protected
focal_class.parameters: (final AnnotationData data, final Annotation annotation, final Class<? extends Annotation> expectedAnnotationClass,
              final Method targetMethod)
focal_class.return: void
focal_class.signature: void build(final AnnotationData data, final Annotation annotation, final Class<? extends Annotation> expectedAnnotationClass,
              final Method targetMethod)
focal_class.class_method_signature: KeyIndexesBuilder.support(Class<? extends Annotation> expectedAnnotationClass)
focal_class.full_signature: @Override protected boolean support(Class<? extends Annotation> expectedAnnotationClass)
focal_class.identifier: support
focal_class.modifiers: @Override protected
focal_class.parameters: (Class<? extends Annotation> expectedAnnotationClass)
focal_class.return: boolean
focal_class.signature: boolean support(Class<? extends Annotation> expectedAnnotationClass)
focal_class.class_method_signature: KeyIndexesBuilder.getKeyIndexes(final Method targetMethod, final boolean isMulti)
focal_class.full_signature: private Collection<Integer> getKeyIndexes(final Method targetMethod, final boolean isMulti)
focal_class.identifier: getKeyIndexes
focal_class.modifiers: private
focal_class.parameters: (final Method targetMethod, final boolean isMulti)
focal_class.return: Collection<Integer>
focal_class.signature: Collection<Integer> getKeyIndexes(final Method targetMethod, final boolean isMulti)
focal_class.superclass: extends AbstractDataBuilder
focal_method.body: private Collection<Integer> getKeyIndexes(final Method targetMethod, final boolean isMulti) {
          final Annotation[][] paramAnnotationArrays = targetMethod.getParameterAnnotations();
          final SortedMap<ParameterValueKeyProvider, Integer> keyProviders = new TreeMap<ParameterValueKeyProvider, Integer>(COMPARATOR);
          final Set<Integer> order = new HashSet<Integer>();
  
          if (paramAnnotationArrays == null || paramAnnotationArrays.length < 1) {
              return Collections.emptyList();
          }
  
          for (int ix = 0; ix < paramAnnotationArrays.length; ix++) {
              final ParameterValueKeyProvider keyProviderAnnotation = getAnnotation(ParameterValueKeyProvider.class,
                      paramAnnotationArrays[ix]);
              if (keyProviderAnnotation == null) {
                  continue;
              }
  
              // throw if order below 0
              if (keyProviderAnnotation.order() < 0) {
                  throw new InvalidParameterException(String.format(
                          "No valid order [%d] defined in annotation [%s] on method [%s], only no negative integers are allowed.",
                          keyProviderAnnotation.order(), ParameterValueKeyProvider.class.getName(), targetMethod.getName()));
              }
              // throw exception if there are two annotations with the same value of order
              if (!order.add(keyProviderAnnotation.order())) {
                  throwException(
                          "No valid order defined in annotation [%s] on method [%s]. There are two annotations with the same order.",
                          ParameterValueKeyProvider.class, targetMethod);
              }
              // log warn if for non multi annotation one of Collection parameter is annotated as a ParameterValueKeyProvider
              if (!isMulti && Collection.class.isAssignableFrom(targetMethod.getParameterTypes()[ix])) {
                  LOG.warn("ParameterValueKeyProvider is used on a list parameter {} in method {} with non multi cache annotation."
                          + "Consider changing to *MultiCache annotation or use another parameter for key. Using collections in such case "
                          + "may lead to unexpected consequences: key can exceed allowed memcached key length, key will be varied "
                          + "when order or size are changed." , targetMethod.getParameterTypes()[ix], targetMethod.getName());
              }
  
              keyProviders.put(keyProviderAnnotation, ix);
          }
  
          return keyProviders.values();
      }
focal_method.class_method_signature: KeyIndexesBuilder.getKeyIndexes(final Method targetMethod, final boolean isMulti)
focal_method.full_signature: private Collection<Integer> getKeyIndexes(final Method targetMethod, final boolean isMulti)
focal_method.identifier: getKeyIndexes
focal_method.invocations: getParameterAnnotations emptyList getAnnotation order format order getName getName add order throwException isAssignableFrom getParameterTypes warn getParameterTypes getName put values
focal_method.modifiers: private
focal_method.parameters: (final Method targetMethod, final boolean isMulti)
focal_method.return: Collection<Integer>
focal_method.signature: Collection<Integer> getKeyIndexes(final Method targetMethod, final boolean isMulti)