Skip to content

Commit

Permalink
Search tests annotations also on inherited public methods
Browse files Browse the repository at this point in the history
Fixes #553
  • Loading branch information
lefou committed Feb 22, 2019
1 parent f7e75d0 commit d306956
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scalalib/src/Lib.scala
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,11 @@ object Lib{
case f: AnnotatedFingerprint =>
val annotationCls = cl.loadClass(f.annotationName()).asInstanceOf[Class[Annotation]]
f.isModule == isModule &&
(
cls.isAnnotationPresent(annotationCls) ||
cls.getDeclaredMethods.exists(_.isAnnotationPresent(annotationCls))
)
(
cls.isAnnotationPresent(annotationCls) ||
cls.getDeclaredMethods.exists(_.isAnnotationPresent(annotationCls)) ||
cls.getMethods.exists(m => m.isAnnotationPresent(annotationCls) && Modifier.isPublic(m.getModifiers()))
)

}.map { f => (cls, f) }
}
Expand Down

0 comments on commit d306956

Please sign in to comment.