Skip to content

Commit 2064f4c

Browse files
committed
Update ErasureHelper.scala
1 parent 7b038b9 commit 2064f4c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/main/scala-2/com/github/swagger/scala/converter/ErasureHelper.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ private[converter] object ErasureHelper {
1212

1313
def erasedOptionalPrimitives(cls: Class[_]): Map[String, Class[_]] = {
1414
try {
15-
val mirror = universe.runtimeMirror(cls.getClassLoader)
16-
val moduleSymbol = mirror.moduleSymbol(cls)
15+
val mirror = universe.runtimeMirror(Thread.currentThread().getContextClassLoader)
16+
val classSymbol = mirror.classSymbol(cls)
1717
val ConstructorName = "apply"
18-
val companion: universe.Symbol = moduleSymbol.typeSignature.member(universe.TermName(ConstructorName))
18+
val companion: universe.Symbol = classSymbol.typeSignature.member(universe.TermName(ConstructorName))
1919
val properties =
2020
Try(companion.asTerm.alternatives.head.asMethod.paramLists.flatten).getOrElse {
21-
val sym = mirror.classSymbol(cls)
22-
sym.selfType.members
21+
classSymbol.selfType.members
2322
.filterNot(_.isMethod)
2423
.filterNot(_.isClass)
2524
}

0 commit comments

Comments
 (0)