Tibor17 commented on pull request #349:
URL: https://github.com/apache/maven-surefire/pull/349#issuecomment-828643297


   IMO this method is illogical:
   ```
       private boolean getEffectiveFailIfNoTests()
       {
           if ( isSpecificTestSpecified() )
           {
               if ( getFailIfNoSpecifiedTests() != null )
               {
                   return getFailIfNoSpecifiedTests();
               }
               else if ( getFailIfNoTests() != null )
               {
                   return getFailIfNoTests();
               }
               else
               {
                   return true;
               }
           }
           else
           {
               return getFailIfNoTests() != null && getFailIfNoTests();
           }
       }
   ```
   and should be changed to something like this
   ```
       private boolean getEffectiveFailIfNoTests()
       {
           if ( isSpecificTestSpecified() )
           {
               if ( getFailIfNoTests() != null )
               {
                   return getFailIfNoTests();
               }
               else
               {
                   return true;
               }
           }
           else
           {
               if ( getFailIfNoSpecifiedTests() != null )
               {
                   return getFailIfNoSpecifiedTests();
               }
               return getFailIfNoTests() != null && getFailIfNoTests();
           }
       }
   ```
   WDYT?
   The methods `getFailIfNoSpecifiedTests` and `getFailIfNoTests` are also 
wrong and they should never return NULL, see the Javadoc about default values.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to