Ignore fields containing '$' in CustomMatchers
Although such field names are legal, they are not used in practice
in any driver code, but they are used as field names for classes that
are generated by lambdas.  These need to be ignored as well.  Otherwise,
infinite recursion can result.
@@ -141,7 +141,7 @@ class CustomMatchers {
return []
}
def fields = getFields(curClass.getSuperclass())
- fields.addAll(curClass.declaredFields.findAll { !it.synthetic && !Modifier.isStatic(it.modifiers) })
+ fields.addAll(curClass.declaredFields.findAll { !it.synthetic && !Modifier.isStatic(it.modifiers) && !it.name.contains('$') })
fields
}
