groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Lowery <jef...@mavericklabel.com>
Subject Strange behavior with regex array and any()
Date Mon, 10 Aug 2015 23:39:11 GMT
Something odd is happening here that I’m not able to reproduce reliably.  Here’s a summary:
	
if (it.classes().disjoint(tooltippedClasses)) {	
	def src = it.@src
	def skipIt = /* some condition equalling */ false 
	skipIt = skipIt || [/.*adroll.*/, /.*facebook.*/, /.*googleads.*/, /.*adnxs.*/].any{src ==~
it}

	if (skipIt) println "skipped $src"

	if (!skipIt) {
		missing.push(src);
	}
}

skipIt is returning false for a src = "http://ib.adnxs.com/seg?add=3xxxxx8&t=2 <http://ib.adnxs.com/seg?add=8888888&t=2>”,
but only sometimes:

> skipped http://ib.adnxs.com/seg?add=3xxxxx8&t=2

Is there some side-effect I’m overlooking?  

JRE 1.8.0_25, groovy 2.4.3

— Jeff




Mime
View raw message