Skip to content

Commit b8f3adb

Browse files
authored
changing terminology to more inclusive terms (#4115)
1 parent a64f896 commit b8f3adb

File tree

85 files changed

+115
-222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+115
-222
lines changed

codegen/src/main/java/software/amazon/awssdk/codegen/IntermediateModelBuilder.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,16 @@ private void setSimpleMethods(IntermediateModel model) {
253253
} else {
254254
inputShape.setSimpleMethod(false);
255255

256-
boolean methodIsNotBlacklisted = !config.getBlacklistedSimpleMethods().contains(methodName) ||
257-
config.getBlacklistedSimpleMethods().stream().noneMatch(m -> m.equals("*"));
256+
boolean methodIsNotExcluded = !config.getExcludedSimpleMethods().contains(methodName) ||
257+
config.getExcludedSimpleMethods().stream().noneMatch(m -> m.equals("*")) ||
258+
!config.getBlacklistedSimpleMethods().contains(methodName) ||
259+
config.getBlacklistedSimpleMethods().stream().noneMatch(m -> m.equals("*"));
258260
boolean methodHasNoRequiredMembers = !CollectionUtils.isNullOrEmpty(inputShape.getRequired());
259261
boolean methodIsNotStreaming = !operation.isStreaming();
260262
boolean methodHasSimpleMethodVerb = methodName.matches(Constant.APPROVED_SIMPLE_METHOD_VERBS);
261263

262-
if (methodIsNotBlacklisted && methodHasNoRequiredMembers && methodIsNotStreaming && methodHasSimpleMethodVerb) {
263-
log.warn("A potential simple method exists that isn't whitelisted or blacklisted: " + methodName);
264+
if (methodIsNotExcluded && methodHasNoRequiredMembers && methodIsNotStreaming && methodHasSimpleMethodVerb) {
265+
log.warn("A potential simple method exists that isn't explicitly excluded or included: " + methodName);
264266
}
265267
}
266268
});

codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/CustomizationConfig.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ public class CustomizationConfig {
103103
/**
104104
* APIs that have no required arguments in their model but can't be called via a simple method
105105
*/
106+
private List<String> excludedSimpleMethods = new ArrayList<>();
107+
108+
/**
109+
* APIs that have no required arguments in their model but can't be called via a simple method.
110+
* Superseded by {@link #excludedSimpleMethods}
111+
*/
112+
@Deprecated
106113
private List<String> blacklistedSimpleMethods = new ArrayList<>();
107114

108115
/**
@@ -373,10 +380,26 @@ public void setServiceSpecificHttpConfig(String serviceSpecificHttpConfig) {
373380
this.serviceSpecificHttpConfig = serviceSpecificHttpConfig;
374381
}
375382

383+
public List<String> getExcludedSimpleMethods() {
384+
return excludedSimpleMethods;
385+
}
386+
387+
public void setExcludedSimpleMethods(List<String> excludedSimpleMethods) {
388+
this.excludedSimpleMethods = excludedSimpleMethods;
389+
}
390+
391+
/**
392+
* Use {@link #getExcludedSimpleMethods()}
393+
*/
394+
@Deprecated
376395
public List<String> getBlacklistedSimpleMethods() {
377396
return blacklistedSimpleMethods;
378397
}
379398

399+
/**
400+
* Use {@link #setExcludedSimpleMethods(List)}
401+
*/
402+
@Deprecated
380403
public void setBlacklistedSimpleMethods(List<String> blackListedSimpleMethods) {
381404
this.blacklistedSimpleMethods = blackListedSimpleMethods;
382405
}

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/json/customization.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"customRetryPolicy": "software.amazon.MyServiceRetryPolicy",
1313
"verifiedSimpleMethods" : ["paginatedOperationWithResultKey"],
14-
"blacklistedSimpleMethods" : [
14+
"excludedSimpleMethods" : [
1515
"eventStreamOperation"
1616
],
1717
"utilitiesMethod": {

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/rest-json/customization.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"customRetryPolicy": "software.amazon.MyServiceRetryPolicy",
1717
"verifiedSimpleMethods" : ["paginatedOperationWithResultKey"],
18-
"blacklistedSimpleMethods" : [
18+
"excludedSimpleMethods" : [
1919
"eventStreamOperation"
2020
],
2121
"utilitiesMethod": {

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/customization.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"blacklistedSimpleMethods" : [
2+
"excludedSimpleMethods" : [
33
"allTypes",
44
"nestedContainers",
55
"operationWithNoInputOrOutput",

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/customresponsemetadata/customization.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"blacklistedSimpleMethods" : [
2+
"excludedSimpleMethods" : [
33
"allTypes",
44
"nestedContainers",
55
"operationWithNoInputOrOutput",

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/xmlnamespace/customization.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"blacklistedSimpleMethods": [
2+
"excludedSimpleMethods": [
33
"allTypes",
44
"nestedContainers",
55
"operationWithNoInputOrOutput",

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/paginators/customization.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"blacklistedSimpleMethods" : [
2+
"excludedSimpleMethods" : [
33
"allTypes",
44
"nestedContainers",
55
"operationWithNoInputOrOutput"

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/transform/customization.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"blacklistedSimpleMethods" : [
2+
"excludedSimpleMethods" : [
33
"allTypes",
44
"nestedContainers",
55
"operationWithNoInputOrOutput",

core/sdk-core/src/main/java/software/amazon/awssdk/core/retry/conditions/RetryOnExceptionsCondition.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ private RetryOnExceptionsCondition(Set<Class<? extends Exception>> exceptionsToR
4242

4343
/**
4444
* @param context Context about the state of the last request and information about the number of requests made.
45-
* @return True if the exception class matches one of the whitelisted exceptions or if the cause of the exception matches the
46-
* whitelisted exception.
45+
* @return True if the exception class or the cause of the exception matches one of the exceptions supplied at
46+
* initialization time.
4747
*/
4848
@Override
4949
public boolean shouldRetry(RetryPolicyContext context) {
@@ -56,10 +56,10 @@ public boolean shouldRetry(RetryPolicyContext context) {
5656
Predicate<Class<? extends Exception>> isRetryableException =
5757
ex -> ex.isAssignableFrom(exception.getClass());
5858

59-
Predicate<Class<? extends Exception>> hasRetrableCause =
59+
Predicate<Class<? extends Exception>> hasRetryableCause =
6060
ex -> exception.getCause() != null && ex.isAssignableFrom(exception.getCause().getClass());
6161

62-
return exceptionsToRetryOn.stream().anyMatch(isRetryableException.or(hasRetrableCause));
62+
return exceptionsToRetryOn.stream().anyMatch(isRetryableException.or(hasRetryableCause));
6363
}
6464

6565
/**

0 commit comments

Comments
 (0)