Skip to content

Commit 5c085a4

Browse files
Merge pull request #316 from OneBusAway/release-please--branches--main--changes--next
release: 0.1.0-alpha.75
2 parents 9d3b14e + 6d283ed commit 5c085a4

File tree

7 files changed

+69
-15
lines changed

7 files changed

+69
-15
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
timeout-minutes: 10
1818
name: lint
1919
runs-on: ${{ github.repository == 'stainless-sdks/open-transit-kotlin' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
2021

2122
steps:
2223
- uses: actions/checkout@v4
@@ -39,6 +40,7 @@ jobs:
3940
timeout-minutes: 10
4041
name: test
4142
runs-on: ${{ github.repository == 'stainless-sdks/open-transit-kotlin' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
43+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
4244
steps:
4345
- uses: actions/checkout@v4
4446

.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.1.0-alpha.74"
2+
".": "0.1.0-alpha.75"
33
}

CHANGELOG.md

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

3+
## 0.1.0-alpha.75 (2025-07-01)
4+
5+
Full Changelog: [v0.1.0-alpha.74...v0.1.0-alpha.75](https://github.com/OneBusAway/kotlin-sdk/compare/v0.1.0-alpha.74...v0.1.0-alpha.75)
6+
7+
### Bug Fixes
8+
9+
* **client:** don't close client on `withOptions` usage when original is gc'd ([0265af6](https://github.com/OneBusAway/kotlin-sdk/commit/0265af6c25213278c66a6f9efb5fc2b1b5173293))
10+
11+
12+
### Chores
13+
14+
* **ci:** only run for pushes and fork pull requests ([24abc88](https://github.com/OneBusAway/kotlin-sdk/commit/24abc88adc64f2601d0da87b4a96efdca6501ac7))
15+
16+
17+
### Refactors
18+
19+
* **internal:** minor `ClientOptionsTest` change ([409443d](https://github.com/OneBusAway/kotlin-sdk/commit/409443d56416677160f77799b2cce329da135972))
20+
321
## 0.1.0-alpha.74 (2025-06-27)
422

523
Full Changelog: [v0.1.0-alpha.73...v0.1.0-alpha.74](https://github.com/OneBusAway/kotlin-sdk/compare/v0.1.0-alpha.73...v0.1.0-alpha.74)

README.md

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

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

5-
[![Maven Central](https://img.shields.io/maven-central/v/org.onebusaway/onebusaway-sdk-kotlin)](https://central.sonatype.com/artifact/org.onebusaway/onebusaway-sdk-kotlin/0.1.0-alpha.74)
6-
[![javadoc](https://javadoc.io/badge2/org.onebusaway/onebusaway-sdk-kotlin/0.1.0-alpha.74/javadoc.svg)](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-kotlin/0.1.0-alpha.74)
5+
[![Maven Central](https://img.shields.io/maven-central/v/org.onebusaway/onebusaway-sdk-kotlin)](https://central.sonatype.com/artifact/org.onebusaway/onebusaway-sdk-kotlin/0.1.0-alpha.75)
6+
[![javadoc](https://javadoc.io/badge2/org.onebusaway/onebusaway-sdk-kotlin/0.1.0-alpha.75/javadoc.svg)](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-kotlin/0.1.0-alpha.75)
77

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

@@ -15,7 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/).
1515

1616
<!-- x-release-please-start-version -->
1717

18-
The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org). KDocs are available on [javadoc.io](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-kotlin/0.1.0-alpha.74).
18+
The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org). KDocs are available on [javadoc.io](https://javadoc.io/doc/org.onebusaway/onebusaway-sdk-kotlin/0.1.0-alpha.75).
1919

2020
<!-- x-release-please-end -->
2121

@@ -26,7 +26,7 @@ The REST API documentation can be found on [developer.onebusaway.org](https://de
2626
### Gradle
2727

2828
```kotlin
29-
implementation("org.onebusaway:onebusaway-sdk-kotlin:0.1.0-alpha.74")
29+
implementation("org.onebusaway:onebusaway-sdk-kotlin:0.1.0-alpha.75")
3030
```
3131

3232
### Maven
@@ -35,7 +35,7 @@ implementation("org.onebusaway:onebusaway-sdk-kotlin:0.1.0-alpha.74")
3535
<dependency>
3636
<groupId>org.onebusaway</groupId>
3737
<artifactId>onebusaway-sdk-kotlin</artifactId>
38-
<version>0.1.0-alpha.74</version>
38+
<version>0.1.0-alpha.75</version>
3939
</dependency>
4040
```
4141

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repositories {
88

99
allprojects {
1010
group = "org.onebusaway"
11-
version = "0.1.0-alpha.74" // x-release-please-version
11+
version = "0.1.0-alpha.75" // x-release-please-version
1212
}
1313

1414
subprojects {

onebusaway-sdk-kotlin-core/src/main/kotlin/org/onebusaway/core/ClientOptions.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ private constructor(
8383
apiKey = clientOptions.apiKey
8484
}
8585

86-
fun httpClient(httpClient: HttpClient) = apply { this.httpClient = httpClient }
86+
fun httpClient(httpClient: HttpClient) = apply {
87+
this.httpClient = PhantomReachableClosingHttpClient(httpClient)
88+
}
8789

8890
fun checkJacksonVersionCompatibility(checkJacksonVersionCompatibility: Boolean) = apply {
8991
this.checkJacksonVersionCompatibility = checkJacksonVersionCompatibility
@@ -226,13 +228,11 @@ private constructor(
226228

227229
return ClientOptions(
228230
httpClient,
229-
PhantomReachableClosingHttpClient(
230-
RetryingHttpClient.builder()
231-
.httpClient(httpClient)
232-
.clock(clock)
233-
.maxRetries(maxRetries)
234-
.build()
235-
),
231+
RetryingHttpClient.builder()
232+
.httpClient(httpClient)
233+
.clock(clock)
234+
.maxRetries(maxRetries)
235+
.build(),
236236
checkJacksonVersionCompatibility,
237237
jsonMapper,
238238
clock,
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// File generated from our OpenAPI spec by Stainless.
2+
3+
package org.onebusaway.core
4+
5+
import org.assertj.core.api.Assertions.assertThat
6+
import org.junit.jupiter.api.Test
7+
import org.junit.jupiter.api.extension.ExtendWith
8+
import org.mockito.junit.jupiter.MockitoExtension
9+
import org.mockito.kotlin.mock
10+
import org.mockito.kotlin.never
11+
import org.mockito.kotlin.verify
12+
import org.onebusaway.core.http.HttpClient
13+
14+
@ExtendWith(MockitoExtension::class)
15+
internal class ClientOptionsTest {
16+
17+
private val httpClient = mock<HttpClient>()
18+
19+
@Test
20+
fun toBuilder_whenOriginalClientOptionsGarbageCollected_doesNotCloseOriginalClient() {
21+
var clientOptions =
22+
ClientOptions.builder().httpClient(httpClient).apiKey("My API Key").build()
23+
verify(httpClient, never()).close()
24+
25+
// Overwrite the `clientOptions` variable so that the original `ClientOptions` is GC'd.
26+
clientOptions = clientOptions.toBuilder().build()
27+
System.gc()
28+
Thread.sleep(100)
29+
30+
verify(httpClient, never()).close()
31+
// This exists so that `clientOptions` is still reachable.
32+
assertThat(clientOptions).isEqualTo(clientOptions)
33+
}
34+
}

0 commit comments

Comments
 (0)