@Test(expected = RuntimeException.class) public void testNoMappingsAnnotation() { store.getTargetParamsTypes(SubGeneric2.class, "set", new Class<?>[] { Object.class, Object.class }); }
@Override public Class<?>[] getTargetParamsTypes(final Class<?> clazz, final String methodName, final Class<?>[] erasedParamTypes) { if (!map.containsKey(clazz)) { processBridgeMethodMappingsAnnotation(clazz); } Map<String, Map<String, Class<?>[]>> methodNameMap = map.get(clazz); Map<String, Class<?>[]> erasedParamTypesMap = null; Class<?>[] targetParamTypes = null; if (methodNameMap != null) { erasedParamTypesMap = methodNameMap.get(methodName); } String key = Arrays.toString(erasedParamTypes); if (erasedParamTypesMap != null) { targetParamTypes = erasedParamTypesMap.get(key); } if (targetParamTypes == null) { throw new RuntimeException(String.format( "Annotation [%s] must be defined on [%s] for bridge method [%s] with erased param types [%s]", BridgeMethodMappings.class.getName(), clazz.getName(), methodName, key)); } return targetParamTypes; }
BridgeMethodMappingStoreImpl implements BridgeMethodMappingStore { @Override public Class<?>[] getTargetParamsTypes(final Class<?> clazz, final String methodName, final Class<?>[] erasedParamTypes) { if (!map.containsKey(clazz)) { processBridgeMethodMappingsAnnotation(clazz); } Map<String, Map<String, Class<?>[]>> methodNameMap = map.get(clazz); Map<String, Class<?>[]> erasedParamTypesMap = null; Class<?>[] targetParamTypes = null; if (methodNameMap != null) { erasedParamTypesMap = methodNameMap.get(methodName); } String key = Arrays.toString(erasedParamTypes); if (erasedParamTypesMap != null) { targetParamTypes = erasedParamTypesMap.get(key); } if (targetParamTypes == null) { throw new RuntimeException(String.format( "Annotation [%s] must be defined on [%s] for bridge method [%s] with erased param types [%s]", BridgeMethodMappings.class.getName(), clazz.getName(), methodName, key)); } return targetParamTypes; } }
BridgeMethodMappingStoreImpl implements BridgeMethodMappingStore { @Override public Class<?>[] getTargetParamsTypes(final Class<?> clazz, final String methodName, final Class<?>[] erasedParamTypes) { if (!map.containsKey(clazz)) { processBridgeMethodMappingsAnnotation(clazz); } Map<String, Map<String, Class<?>[]>> methodNameMap = map.get(clazz); Map<String, Class<?>[]> erasedParamTypesMap = null; Class<?>[] targetParamTypes = null; if (methodNameMap != null) { erasedParamTypesMap = methodNameMap.get(methodName); } String key = Arrays.toString(erasedParamTypes); if (erasedParamTypesMap != null) { targetParamTypes = erasedParamTypesMap.get(key); } if (targetParamTypes == null) { throw new RuntimeException(String.format( "Annotation [%s] must be defined on [%s] for bridge method [%s] with erased param types [%s]", BridgeMethodMappings.class.getName(), clazz.getName(), methodName, key)); } return targetParamTypes; }  }
BridgeMethodMappingStoreImpl implements BridgeMethodMappingStore { @Override public Class<?>[] getTargetParamsTypes(final Class<?> clazz, final String methodName, final Class<?>[] erasedParamTypes) { if (!map.containsKey(clazz)) { processBridgeMethodMappingsAnnotation(clazz); } Map<String, Map<String, Class<?>[]>> methodNameMap = map.get(clazz); Map<String, Class<?>[]> erasedParamTypesMap = null; Class<?>[] targetParamTypes = null; if (methodNameMap != null) { erasedParamTypesMap = methodNameMap.get(methodName); } String key = Arrays.toString(erasedParamTypes); if (erasedParamTypesMap != null) { targetParamTypes = erasedParamTypesMap.get(key); } if (targetParamTypes == null) { throw new RuntimeException(String.format( "Annotation [%s] must be defined on [%s] for bridge method [%s] with erased param types [%s]", BridgeMethodMappings.class.getName(), clazz.getName(), methodName, key)); } return targetParamTypes; }  @Override Class<?>[] getTargetParamsTypes(final Class<?> clazz, final String methodName, final Class<?>[] erasedParamTypes); }
BridgeMethodMappingStoreImpl implements BridgeMethodMappingStore { @Override public Class<?>[] getTargetParamsTypes(final Class<?> clazz, final String methodName, final Class<?>[] erasedParamTypes) { if (!map.containsKey(clazz)) { processBridgeMethodMappingsAnnotation(clazz); } Map<String, Map<String, Class<?>[]>> methodNameMap = map.get(clazz); Map<String, Class<?>[]> erasedParamTypesMap = null; Class<?>[] targetParamTypes = null; if (methodNameMap != null) { erasedParamTypesMap = methodNameMap.get(methodName); } String key = Arrays.toString(erasedParamTypes); if (erasedParamTypesMap != null) { targetParamTypes = erasedParamTypesMap.get(key); } if (targetParamTypes == null) { throw new RuntimeException(String.format( "Annotation [%s] must be defined on [%s] for bridge method [%s] with erased param types [%s]", BridgeMethodMappings.class.getName(), clazz.getName(), methodName, key)); } return targetParamTypes; }  @Override Class<?>[] getTargetParamsTypes(final Class<?> clazz, final String methodName, final Class<?>[] erasedParamTypes);  }