if (method.getName().equals(setterName) && method.isAnnotationPresent(LegacyConfig.class)) { if (validateSetter(method)) { for (String property : method.getAnnotation(LegacyConfig.class).value()) { if (defunctConfig.contains(property)) { && method.getAnnotation(LegacyConfig.class).replacedBy().equals(propertyName)) { if (validateSetter(method)) { for (String property : method.getAnnotation(LegacyConfig.class).value()) { if (defunctConfig.contains(property)) {
if (method.getName().equals(setterName) && method.isAnnotationPresent(LegacyConfig.class)) { if (validateSetter(method)) { for (String property : method.getAnnotation(LegacyConfig.class).value()) { if (defunctConfig.contains(property)) { && method.getAnnotation(LegacyConfig.class).replacedBy().equals(propertyName)) { if (validateSetter(method)) { for (String property : method.getAnnotation(LegacyConfig.class).value()) { if (defunctConfig.contains(property)) {
if (method.getName().equals(setterName) && method.isAnnotationPresent(LegacyConfig.class)) { if (validateSetter(method)) { for (String property : method.getAnnotation(LegacyConfig.class).value()) { if (defunctConfig.contains(property)) { && method.getAnnotation(LegacyConfig.class).replacedBy().equals(propertyName)) { if (validateSetter(method)) { for (String property : method.getAnnotation(LegacyConfig.class).value()) { if (defunctConfig.contains(property)) {
private Map<String, AttributeMetadata> buildAttributeMetadata(Class<T> configClass) { Map<String, AttributeMetadata> attributes = Maps.newHashMap(); for (Method configMethod : findConfigMethods(configClass)) { AttributeMetadata attribute = buildAttributeMetadata(configClass, configMethod); if (attribute != null) { if (attributes.containsKey(attribute.getName())) { problems.addError("Configuration class [%s] Multiple methods are annotated for @Config attribute [%s]", configClass.getName(), attribute.getName()); } attributes.put(attribute.getName(), attribute); } } // Find orphan @LegacyConfig methods, in order to report errors Collection<Method> legacyMethods = findLegacyConfigMethods(configClass); for (AttributeMetadata attribute : attributes.values()) { for (InjectionPointMetaData injectionPoint : attribute.getLegacyInjectionPoints()) { if (legacyMethods.contains(injectionPoint.getSetter())) { // Don't care about legacy methods which are related to current attributes legacyMethods.remove(injectionPoint.getSetter()); } } } for (Method method : legacyMethods) { if (!method.isAnnotationPresent(Config.class)) { validateSetter(method); problems.addError("@LegacyConfig method [%s] is not associated with any valid @Config attribute.", method.toGenericString()); } } return attributes; }
validateSetter(method); problems.addError("@LegacyConfig method [%s] is not associated with any valid @Config attribute.", method.toGenericString());
validateSetter(method); problems.addError("@LegacyConfig method [%s] is not associated with any valid @Config attribute.", method.toGenericString());
if (!validateSetter(configMethod)) { return null;
if (!validateSetter(configMethod)) { return null;
if (!validateSetter(configMethod)) { return null;