addError( value, "error.empty-string-not-allowed" );
return null;
}
if ( parentAnnotations.length < 2 ) return null; // invalid parents -- will be caught elsewhere
AnnotationInstance parentElement = parentAnnotations[ parentAnnotations.length - 2 ];
List memberGroup = CompilerUtils.getAnnotationArray( parentElement, _memberGroupName, true );
//
// If memberGroup is null, then this annotation was in the wrong place, and there will be other errors.
//
if ( memberGroup != null )
{
String valueName = valueDecl.getSimpleName();
AnnotationInstance parentAnnotation = parentAnnotations[ parentAnnotations.length - 1 ];
checkForDuplicates( value, valueName, parentAnnotation, classMember, memberGroup, false,
annotationArrayIndex );
//
// Get a list of additional annotations (presumably not from the this one's parent) to check.
//
List additionalAnnsToCheck = getAdditionalAnnotationsToCheck( classMember );
if ( additionalAnnsToCheck != null )
{
// Check this value against the list of additional annotations.
checkForDuplicates( value, valueName, parentAnnotation, classMember, additionalAnnsToCheck, true, -1 );
// Check for duplicates *within* within the list of additional annotations.
for ( int i = 0; i < additionalAnnsToCheck.size(); ++i )
{
AnnotationInstance ann = ( AnnotationInstance ) additionalAnnsToCheck.get( i );
AnnotationValue valueToCheck = CompilerUtils.getAnnotationValue( ann, valueName, true );
checkForDuplicates( valueToCheck, valueName, ann, classMember, additionalAnnsToCheck, true, -1 );
}
}
}