Skip to content

Commit

Permalink
Java 11 JvmAutoHinter fix and gradle 4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksiyp committed Sep 27, 2018
1 parent e00c045 commit faf600a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
Expand Up @@ -44,11 +44,15 @@ class JvmAutoHinter : AutoHinter() {
}

private fun extractClassName(ex: ClassCastException): String? {
return exceptionMessage.find(ex.message!!)?.groups?.get(2)?.value
return exceptionMessage.find(ex.message!!)?.groups?.get(3)?.value
}

companion object {
val exceptionMessage = Regex("cannot be cast to (.+/)?(.+)$")
// JDK 8: net.bytebuddy.renamed.java.lang.Object$ByteBuddy$As29nsJf$ByteBuddy$877l7O7D cannot be cast to io.mockk.impl.recording.states.CallRecordingState
// JDK 9:
// JDK 10:
// JDK 11: class net.bytebuddy.renamed.java.lang.Object$ByteBuddy$rpycQEYo$ByteBuddy$bHEk1ADY cannot be cast to class java.lang.String (net.bytebuddy.renamed.java.lang.Object$ByteBuddy$rpycQEYo$ByteBuddy$bHEk1ADY is in unnamed module of loader net.bytebuddy.dynamic.loading.ByteArrayClassLoader @19569ebd; java.lang.String is in module java.base of loader 'bootstrap')
val exceptionMessage = Regex("cannot be cast to (class )?(.+/)?(.+)( \\((.+)\\))?$")

val log = Logger<JvmAutoHinter>()
}
Expand Down

0 comments on commit faf600a

Please sign in to comment.