Skip to content

Commit

Permalink
Merge pull request #6 from Micalhl/master
Browse files Browse the repository at this point in the history
1.1.6 修复 JDK 22 兼容
  • Loading branch information
Bkm016 authored Sep 15, 2024
2 parents c2f8874 + 7070557 commit a627c84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ object UnsafeAccess {
} catch (ignored: Throwable) {
// Fix JDK22 compatibility
// MethodHandles.lookup().ensureInitialized(MethodHandles.Lookup::class.java)
MethodHandles.Lookup::class.java.getDeclaredMethod("ensureInitialized").invoke(MethodHandles.Lookup::class.java)
MethodHandles.Lookup::class.java.getDeclaredMethod("ensureInitialized", Class::class.java).invoke(MethodHandles.lookup(), MethodHandles.Lookup::class.java)
}
val lookupField = MethodHandles.Lookup::class.java.getDeclaredField("IMPL_LOOKUP")
val lookupBase = unsafe.staticFieldBase(lookupField)
val lookupOffset = unsafe.staticFieldOffset(lookupField)
lookup = unsafe.getObject(lookupBase, lookupOffset) as MethodHandles.Lookup
} catch (t: Throwable) {
throw IllegalStateException("Unsafe not found")
throw IllegalStateException("Unsafe not found", t)
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=org.tabooproject.reflex
version=1.1.5
version=1.1.6
kotlin.incremental=true
kotlin.incremental.java=true
kotlin.caching.enabled=true
Expand Down

0 comments on commit a627c84

Please sign in to comment.