Skip to content

Instantly share code, notes, and snippets.

@jedws
Created August 5, 2011 01:42
Show Gist options
  • Save jedws/1126762 to your computer and use it in GitHub Desktop.
Save jedws/1126762 to your computer and use it in GitHub Desktop.
val nonIgnoredFields = {
@annotation.tailrec
def loop(k: Class[_], fields: List[Array[Field]]): List[Array[Field]] = {
if (k == null) fields
else
loop(k.getSuperclass, k.getDeclaredFields.filterNot(ignoreField _).reverse :: fields)
}
loop(klass, Nil).flatten
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment