picketbox/picketbox — pull request #18 by marschall (2014-09-30 17:29:38+00:00)
Title: SECURITY-787 Speed up SimpleRole#equals

We did some profiling of our JBoss AS instance and `SimpleRole#equals`
showed up as a hot method. A lot of time seems to be spent in
`java.lang.Class.cast(Object)`. Switching to a normal Java cast should
fix this since we're inside an `instanceof` and it always succeeds.

* use normal cast in `SimpleRole#equals` instead of
`java.lang.Class.cast`
* add short circuit case for `this`

Issue: SECURITY-787
https://issues.jboss.org/browse/SECURITY-787