Skip to content

Commit 3ee4f13

Browse files
committed
1050: * Changed the indentation from spaces to tab.
* Included private no-args constructors. * refactoring. Signed-off-by: Vikas Adyar <[email protected]>
1 parent bac084d commit 3ee4f13

File tree

5 files changed

+18
-24
lines changed

5 files changed

+18
-24
lines changed

formatter/formatting.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ allprojects {
66
target '**/*.java'
77

88
removeUnusedImports()
9-
importOrder(
10-
'de.thetaphi',
9+
importOrder('de.thetaphi',
1110
'com.carrotsearch',
1211
'com.fasterxml',
1312
'com.avast',
@@ -19,11 +18,10 @@ allprojects {
1918
'javax',
2019
'java',
2120
'',
22-
'\\#java|\\#org.opensearch|\\#org.hamcrest|\\#'
23-
)
21+
'\\#java|\\#org.opensearch|\\#org.hamcrest|\\#')
2422
eclipse().configFile rootProject.file('formatter/formatterConfig.xml')
2523
trimTrailingWhitespace()
26-
endWithNewline();
24+
endWithNewline()
2725

2826
// See DEVELOPER_GUIDE.md for details of when to enable this.
2927
if (System.getProperty('spotless.paddedcell') != null) {
@@ -38,7 +36,7 @@ allprojects {
3836
indentWithSpaces()
3937
}
4038
format("license", {
41-
licenseHeaderFile("${rootProject.file("formatter/license-header.txt")}", "package ");
39+
licenseHeaderFile("${rootProject.file("formatter/license-header.txt")}", "package ")
4240
target("src/*/java/**/*.java")
4341
})
4442
}

src/main/java/org/opensearch/flowframework/util/ApiSpecFetcher.java

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public class ApiSpecFetcher {
4040
PARSE_OPTIONS.setResolveFully(true);
4141
}
4242

43+
private ApiSpecFetcher() {}
44+
4345
/**
4446
* Parses the OpenAPI specification directly from the URI.
4547
*
@@ -87,23 +89,13 @@ public static boolean compareRequiredFields(List<String> requiredEnumParams, Str
8789
}
8890

8991
private static Content getContent(RestRequest.Method method, PathItem pathItem) throws IllegalArgumentException, ApiSpecParseException {
90-
Operation operation;
91-
switch (method) {
92-
case POST:
93-
operation = pathItem.getPost();
94-
break;
95-
case GET:
96-
operation = pathItem.getGet();
97-
break;
98-
case PUT:
99-
operation = pathItem.getPut();
100-
break;
101-
case DELETE:
102-
operation = pathItem.getDelete();
103-
break;
104-
default:
105-
throw new IllegalArgumentException("Unsupported HTTP method: " + method);
106-
}
92+
Operation operation = switch (method) {
93+
case POST -> pathItem.getPost();
94+
case GET -> pathItem.getGet();
95+
case PUT -> pathItem.getPut();
96+
case DELETE -> pathItem.getDelete();
97+
default -> throw new IllegalArgumentException("Unsupported HTTP method: " + method);
98+
};
10799

108100
if (operation == null) {
109101
throw new IllegalArgumentException("No operation found for the specified method: " + method);

src/main/java/org/opensearch/flowframework/util/EncryptorUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public class EncryptorUtils {
7676
private static final String WRAPPING_ALGORITHM = "AES/GCM/NOPADDING";
7777

7878
// concurrent map can't have null as a key. This key is to support single tenancy
79-
public static final String DEFAULT_TENANT_ID = "";
79+
private static final String DEFAULT_TENANT_ID = "";
8080

8181
private final ClusterService clusterService;
8282
private final Client client;

src/main/java/org/opensearch/flowframework/util/TenantAwareHelper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*/
2424
public class TenantAwareHelper {
2525

26+
private TenantAwareHelper() {}
27+
2628
/**
2729
* Validates the tenant ID based on the multi-tenancy feature setting.
2830
*

src/main/java/org/opensearch/flowframework/util/WorkflowTimeoutUtility.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public class WorkflowTimeoutUtility {
3434

3535
private static final Logger logger = LogManager.getLogger(WorkflowTimeoutUtility.class);
3636

37+
private WorkflowTimeoutUtility() {}
38+
3739
/**
3840
* Schedules a timeout task for a workflow execution.
3941
*

0 commit comments

Comments
 (0)