Skip to content

Commit

Permalink
Catch Malformed class name exception on JDK8-only, for classes in d…
Browse files Browse the repository at this point in the history
…eeply-nested objects (related: scala/bug#2034)
  • Loading branch information
neko-kai committed Jan 12, 2020
1 parent 19a6ba6 commit 2c7d27f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ final case class SafeType private(
}

final def hasPreciseClass: Boolean = {
tag.shortName == cls.getSimpleName
try tag.shortName == cls.getSimpleName catch {
case i: InternalError if i.getMessage == "Malformed class name" => false
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ object Tags {
def closestClass: Class[_]

final def hasPreciseClass: Boolean = {
tag.shortName == closestClass.getSimpleName
try tag.shortName == closestClass.getSimpleName catch {
case i: InternalError if i.getMessage == "Malformed class name" => false
}
}
}

Expand Down

0 comments on commit 2c7d27f

Please sign in to comment.