GutoVeronezi commented on PR #849:
URL: https://github.com/apache/commons-lang/pull/849#issuecomment-1175422840

   @garydgregory, when the `ReflectionToStringBuilder` is instantiated, the 
object is added to the `ToStringStyle#REGISTRY` and is removed from it when 
calling `ToStringBuilder#toString()`. As we have both include and exclude 
fields now, we are validating if there is intersection between them. Previous 
these last changes, if there was intersection, an exception was being thrown 
and the object was not being removed from the `REGISTRY`. If the tests 
expecting the exception were being executed firstly, and as 
`ToStringStyle#REGISTRY` is static, it would never be empty, broking the other 
tests.
   
   To fix this situation, I made the validation code block unregister the 
object before throwing the exception, to honor the current workflow. I also 
moved the block that validates the intersection to a more convenient flow. 
   
   I extended `AbstractLangBuilderTest` in the test class, as you requested.


-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to