Skip to content

Commit

Permalink
Workaround for Scala bug: scala/bug#2034 that has ben causing sporadi…
Browse files Browse the repository at this point in the history
…c test failures.
  • Loading branch information
Gerard Murphy committed Mar 29, 2019
1 parent a9dd6db commit 49fb836
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ object ImmutableObjectStorage {
Set(classOf[StateAcquisition[_]], classOf[String], classOf[Class[_]])

def isNotToBeProxied(clazz: Class[_]): Boolean =
Modifier.isFinal(clazz.getModifiers) || clazzesThatShouldNotBeProxied
// Start with a workaround for: https://github.com/scala/bug/issues/2034 - if it throws,
// it's probably an inner class of some kind, so let's assume we don't want to proxy it.
Try { clazz.getSimpleName }.isFailure ||
clazz.isSynthetic || clazz.isAnonymousClass || clazz.isLocalClass ||
Modifier.isFinal(clazz.getModifiers) || clazzesThatShouldNotBeProxied
.exists(_.isAssignableFrom(clazz)) || clazz.getSimpleName.startsWith(
"Function") || clazz.getSimpleName.startsWith("Tuple")

Expand Down

0 comments on commit 49fb836

Please sign in to comment.