Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Remove dependency on commons-lang3 #204

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion amazon-kendra-intelligent-ranking/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ repositories {

dependencies {
implementation 'com.ibm.icu:icu4j:57.2'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
implementation 'org.apache.httpcomponents:httpcore:4.4.16'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@

import java.io.ByteArrayInputStream;
import java.io.Closeable;
import java.io.IOException;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.security.AccessController;
import java.security.PrivilegedAction;

import org.apache.commons.lang3.StringUtils;
import org.opensearch.core.common.Strings;
import org.opensearch.search.relevance.transformer.kendraintelligentranking.model.dto.RescoreRequest;
import org.opensearch.search.relevance.transformer.kendraintelligentranking.model.dto.RescoreResult;

Expand Down Expand Up @@ -132,11 +131,11 @@ public URI buildRescoreURI() {
}

public boolean isValid() {
return StringUtils.isNotEmpty(serviceEndpoint) && StringUtils.isNotEmpty(executionPlanId);
return !Strings.isNullOrEmpty(serviceEndpoint) && !Strings.isNullOrEmpty(executionPlanId);
}

@Override
public void close() throws IOException {
public void close() {
if (amazonHttpClient != null) {
amazonHttpClient.shutdown();
}
Expand Down
Loading