Skip to content

Commit

Permalink
Update scala/src/main/scala/com/xebia/functional/xef/scala/auto/getAn…
Browse files Browse the repository at this point in the history
…notations.scala

Co-authored-by: Diego E. Alonso <diesalbla@gmail.com>
  • Loading branch information
2 people authored and jackcviers-contractor committed Aug 10, 2023
1 parent 9e7eb7e commit fa758db
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,14 @@ inline def getAnnotations[A](using

val classAnnotations = List((klass.getName(), klass.getAnnotations().toList))

val constructorAnnotations = klass
.getConstructors()
.toList
.headOption
.map { constructor =>
constructor.getParameters().toList.map { param =>
val constructorAnnotations = {
val constructors = klass.getConstructors()
if (constructors.length == 0) List.empty
else
constructors(0).getParameters().toList.map { param =>
(param.getName(), param.getAnnotations().toList)
}
}
.getOrElse(List.empty)

}
val fieldsAnnotations = klass
.getDeclaredFields()
.toList
Expand Down

0 comments on commit fa758db

Please sign in to comment.