Skip to content

Conversation

atos-mohamed-b
Copy link
Contributor

This update satisfies SONAR's report about rule S3011.

@atos-mohamed-b
Copy link
Contributor Author

What would be the context for setting every boolean / Boolean's values to false here ?

for ( Field field : bean.getClass( ).getDeclaredFields( ) )
{
   try
   {
       // for all boolean field, init to false
       if ( Boolean.class.isAssignableFrom( field.getType( ) ) || boolean.class.isAssignableFrom( field.getType( ) ) )
       {
           field.setAccessible( true );
           field.set( bean, false );
        }
     }
     catch( Exception e )
     {
        String error = "La valeur du champ " + field.getName( ) + " de la classe " + bean.getClass( ).getName( ) + " n'a pas pu être récupéré ";
        AppLogService.error( error, e );
        throw new AppException( error, e );
     }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant