@SuppressWarnings("unchecked")
public AnnotationSource<O> removeValue(final String name)
{
if (annotation.isNormalAnnotation())
{
NormalAnnotation na = (NormalAnnotation) annotation;
List<MemberValuePair> toBeRemoved = new ArrayList<MemberValuePair>();
for (Object v : na.values())
{
if (v instanceof MemberValuePair)
{
MemberValuePair pair = (MemberValuePair) v;
if (pair.getName().toString().equals(name))
{
toBeRemoved.add(pair);
}
}
}
na.values().removeAll(toBeRemoved);
if ((getLiteralValue() != null) && (getValues().size() == 1))
{
convertTo(AnnotationType.SINGLE);
}