Also flag deprecated properties in a @Deprecated class

Previously, any property defined in a @Deprecated class were not marked
as deprecated as only the getter or field was inspected for the
annotation.

An additional check on the class has been added to handle this case.

Fixes gh-2014
This commit is contained in:
Stephane Nicoll
2014-11-27 15:27:12 +01:00
parent 1a5916665c
commit 5b231e600b
3 changed files with 69 additions and 1 deletions

View File

@@ -186,7 +186,8 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
String description = this.typeUtils.getJavaDoc(field);
Object defaultValue = fieldValues.get(name);
boolean deprecated = hasDeprecateAnnotation(getter)
|| hasDeprecateAnnotation(setter);
|| hasDeprecateAnnotation(setter)
|| hasDeprecateAnnotation(element);
this.metadata.add(ItemMetadata.newProperty(prefix, name, dataType,
sourceType, null, description, defaultValue, deprecated));
}