[PR #329] [CLOSED] Polish HttpClient API #503

Closed
opened 2025-12-30 01:24:59 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/329
Author: @odenix
Created: 3/17/2024
Status: Closed

Base: mainHead: polish-http


📝 Commits (1)

📊 Changes

10 files changed (+21 additions, -24 deletions)

View changed files

📝 pkl-commons-cli/src/main/kotlin/org/pkl/commons/cli/CliBaseOptions.kt (+1 -1)
📝 pkl-core/src/main/java/org/pkl/core/http/HttpClient.java (+7 -8)
📝 pkl-core/src/main/java/org/pkl/core/http/HttpClientBuilder.java (+4 -4)
📝 pkl-core/src/main/java/org/pkl/core/http/HttpClientInitException.java (+1 -3)
📝 pkl-core/src/main/java/org/pkl/core/service/ExecutorSpiImpl.java (+1 -1)
📝 pkl-core/src/test/kotlin/org/pkl/core/StackFrameTransformersTest.kt (+1 -1)
📝 pkl-core/src/test/kotlin/org/pkl/core/http/HttpClientTest.kt (+3 -3)
📝 pkl-core/src/test/kotlin/org/pkl/core/packages/PackageResolversTest.kt (+1 -1)
📝 pkl-core/src/test/kotlin/org/pkl/core/project/ProjectDependenciesResolverTest.kt (+1 -1)
📝 pkl-core/src/test/kotlin/org/pkl/core/project/ProjectTest.kt (+1 -1)

📄 Description

  • Rename builder methods from setFoo() to foo(). As of Java 17, the getFoo()/setFoo(value) naming convention has been effectively replaced with foo()/foo(value). Especially for a pre-1.0 project, it makes sense to align with this development.
  • Do not rename addFoo() builder methods to distinguish them from setters.
  • Change HttpClientInitException to extend RuntimeException instead of PklException. Except for PklBugException, no other exception class extends PklException.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/329 **Author:** [@odenix](https://github.com/odenix) **Created:** 3/17/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `polish-http` --- ### 📝 Commits (1) - [`6440fa3`](https://github.com/apple/pkl/commit/6440fa3a4121d9c2705183c7cdea208226536831) Polish HttpClient API ### 📊 Changes **10 files changed** (+21 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `pkl-commons-cli/src/main/kotlin/org/pkl/commons/cli/CliBaseOptions.kt` (+1 -1) 📝 `pkl-core/src/main/java/org/pkl/core/http/HttpClient.java` (+7 -8) 📝 `pkl-core/src/main/java/org/pkl/core/http/HttpClientBuilder.java` (+4 -4) 📝 `pkl-core/src/main/java/org/pkl/core/http/HttpClientInitException.java` (+1 -3) 📝 `pkl-core/src/main/java/org/pkl/core/service/ExecutorSpiImpl.java` (+1 -1) 📝 `pkl-core/src/test/kotlin/org/pkl/core/StackFrameTransformersTest.kt` (+1 -1) 📝 `pkl-core/src/test/kotlin/org/pkl/core/http/HttpClientTest.kt` (+3 -3) 📝 `pkl-core/src/test/kotlin/org/pkl/core/packages/PackageResolversTest.kt` (+1 -1) 📝 `pkl-core/src/test/kotlin/org/pkl/core/project/ProjectDependenciesResolverTest.kt` (+1 -1) 📝 `pkl-core/src/test/kotlin/org/pkl/core/project/ProjectTest.kt` (+1 -1) </details> ### 📄 Description - Rename builder methods from setFoo() to foo(). As of Java 17, the getFoo()/setFoo(value) naming convention has been effectively replaced with foo()/foo(value). Especially for a pre-1.0 project, it makes sense to align with this development. - Do not rename addFoo() builder methods to distinguish them from setters. - Change HttpClientInitException to extend RuntimeException instead of PklException. Except for PklBugException, no other exception class extends PklException. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:24:59 +01:00
adam closed this issue 2025-12-30 01:25:00 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#503