final List<String> listNamedType = new ArrayList<String>();
int numOfSimpleType = 0;
for ( Field field : fields )
{
final Mock annoBy = field.getAnnotation( Mock.class );
if ( annoBy.annotatedWith() == Mock.NoAnnotation.class && "".equals( annoBy.namedWith() ) )
{
numOfSimpleType++;
}
if ( numOfSimpleType > 1 )
{
LOGGER.finer( "Found multiple simple type" );
return true;
}
if ( annoBy.annotatedWith() != Mock.NoAnnotation.class )
{
if ( !listAnnotatedType.contains( annoBy.annotatedWith() ) )
{
listAnnotatedType.add( annoBy.annotatedWith() );
}
else
{
// found two fields with same annotation
LOGGER.finer( "Found multiple annotatedBy type" );
return true;
}
}
if ( !"".equals( annoBy.namedWith() ) )
{
if ( !listNamedType.contains( annoBy.namedWith() ) )
{
listNamedType.add( annoBy.namedWith() );
}
else
{
// found two fields with same named annotation
LOGGER.finer( "Found multiple namedWith type" );