You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2019/11/14 08:54:56 UTC

[GitHub] [groovy] wololock commented on issue #815: GROOVY-8855: Matcher.asBoolean() does not rely on matchers internal search index anymore

wololock commented on issue #815: GROOVY-8855: Matcher.asBoolean() does not rely on matchers internal search index anymore
URL: https://github.com/apache/groovy/pull/815#issuecomment-553789109
 
 
   @eric-milles, I wouldn't say that's the same use case. The JIRA issue focuses on a side effect that is caused by calling:
   
   ```
   matcher as Boolean
   ```
   
   Usually you don't expect that casting an object to some other type causes internal changes in the casting object. I agree that using `==~` operator is easier and safer to use, and this is what the guy who asked question on Stack Overflow eventually did. However, the question is still open - should `Matcher.asBoolean()` change the internal state of the object? It shouldn't in my opinion, and that is why this pull request was created. But it's up to you to decide if this makes sense or not. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services