Skip to content

Commit 2d127f0

Browse files
authored
Merge pull request #117 from orbcorp/release-please--branches--main--changes--next
release: 0.6.1
2 parents 89dd244 + 0ca98be commit 2d127f0

File tree

6 files changed

+30
-9
lines changed

6 files changed

+30
-9
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.6.0"
2+
".": "0.6.1"
33
}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.6.1 (2024-11-19)
4+
5+
Full Changelog: [v0.6.0...v0.6.1](https://github.com/orbcorp/orb-java/compare/v0.6.0...v0.6.1)
6+
7+
### Chores
8+
9+
* rebuild project due to codegen change ([#116](https://github.com/orbcorp/orb-java/issues/116)) ([94d7006](https://github.com/orbcorp/orb-java/commit/94d700697d44adede203c1f7d3dda1e67f37eae2))
10+
311
## 0.6.0 (2024-11-18)
412

513
Full Changelog: [v0.5.0...v0.6.0](https://github.com/orbcorp/orb-java/compare/v0.5.0...v0.6.0)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!-- x-release-please-start-version -->
44

5-
[![Maven Central](https://img.shields.io/maven-central/v/com.withorb.api/orb-java)](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.6.0)
5+
[![Maven Central](https://img.shields.io/maven-central/v/com.withorb.api/orb-java)](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.6.1)
66

77
<!-- x-release-please-end -->
88

@@ -25,7 +25,7 @@ The REST API documentation can be found on [docs.withorb.com](https://docs.with
2525
<!-- x-release-please-start-version -->
2626

2727
```kotlin
28-
implementation("com.withorb.api:orb-java:0.6.0")
28+
implementation("com.withorb.api:orb-java:0.6.1")
2929
```
3030

3131
#### Maven
@@ -34,7 +34,7 @@ implementation("com.withorb.api:orb-java:0.6.0")
3434
<dependency>
3535
<groupId>com.withorb.api</groupId>
3636
<artifactId>orb-java</artifactId>
37-
<version>0.6.0</version>
37+
<version>0.6.1</version>
3838
</dependency>
3939
```
4040

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
allprojects {
66
group = "com.withorb.api"
7-
version = "0.6.0" // x-release-please-version
7+
version = "0.6.1" // x-release-please-version
88
}
99

1010

orb-java-core/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ dependencies {
2020
testImplementation("org.assertj:assertj-core:3.25.3")
2121
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
2222
testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.3")
23+
testImplementation("org.mockito:mockito-core:5.14.2")
24+
testImplementation("org.mockito:mockito-junit-jupiter:5.14.2")
25+
testImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0")
2326
}

orb-java-core/src/main/kotlin/com/withorb/api/core/PhantomReachable.kt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,30 @@ internal fun closeWhenPhantomReachable(observed: Any, closeable: AutoCloseable)
1515
check(observed !== closeable) {
1616
"`observed` cannot be the same object as `closeable` because it would never become phantom reachable"
1717
}
18-
closeWhenPhantomReachable?.let { it(observed, closeable::close) }
18+
closeWhenPhantomReachable(observed, closeable::close)
1919
}
2020

21-
private val closeWhenPhantomReachable: ((Any, AutoCloseable) -> Unit)? by lazy {
21+
/**
22+
* Calls [close] when [observed] becomes only phantom reachable.
23+
*
24+
* This is a wrapper around a Java 9+ [java.lang.ref.Cleaner], or a no-op in older Java versions.
25+
*/
26+
@JvmSynthetic
27+
internal fun closeWhenPhantomReachable(observed: Any, close: () -> Unit) {
28+
closeWhenPhantomReachable?.let { it(observed, close) }
29+
}
30+
31+
private val closeWhenPhantomReachable: ((Any, () -> Unit) -> Unit)? by lazy {
2232
try {
2333
val cleanerClass = Class.forName("java.lang.ref.Cleaner")
2434
val cleanerCreate = cleanerClass.getMethod("create")
2535
val cleanerRegister =
2636
cleanerClass.getMethod("register", Any::class.java, Runnable::class.java)
2737
val cleanerObject = cleanerCreate.invoke(null);
2838

29-
{ observed, closeable ->
39+
{ observed, close ->
3040
try {
31-
cleanerRegister.invoke(cleanerObject, observed, Runnable { closeable.close() })
41+
cleanerRegister.invoke(cleanerObject, observed, Runnable { close() })
3242
} catch (e: ReflectiveOperationException) {
3343
if (e is InvocationTargetException) {
3444
when (val cause = e.cause) {

0 commit comments

Comments
 (0)