Skip to content

Commit

Permalink
Restore support for Java 8
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Redko <[email protected]>
  • Loading branch information
reta committed Dec 12, 2023
1 parent 1725fc9 commit 8e48ef6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ This section is for maintaining a changelog for all breaking changes for the cli
### Dependencies

### Changed
- Restore support for Java 8 ([#767](https://github.com/opensearch-project/opensearch-java/pull/767))

### Deprecated
- Deprecated "_toQuery()" in Query and QueryVariant ([#760](https://github.com/opensearch-project/opensearch-java/pull/760)
Expand Down
10 changes: 8 additions & 2 deletions java-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,15 @@ configurations {
}
}

// The tests are using OpenSearch core test framework, that has JDK-11 baseline
tasks.named<JavaCompile>("compileTestJava") {
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
}

java {
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8

withJavadocJar()
withSourcesJar()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ private <RequestT> SdkHttpFullRequest prepareRequest(
Map<String, String> params = endpoint.queryParameters(request);
if (params != null && !params.isEmpty()) {
char sep = '?';
for (var ent : params.entrySet()) {
for (Map.Entry<String, String> ent : params.entrySet()) {
url.append(sep).append(ent.getKey()).append('=');
url.append(URLEncoder.encode(ent.getValue(), StandardCharsets.UTF_8));
sep = '&';
Expand Down

0 comments on commit 8e48ef6

Please sign in to comment.