Skip to content

Commit

Permalink
fix concurrent-change exception and operation predicate behavior for …
Browse files Browse the repository at this point in the history
…runtime plugin
  • Loading branch information
skotambkar committed Nov 9, 2020
1 parent 5f6dc7f commit 7bed165
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class S3UpdateEndpoint implements GoIntegration {
private static final String USE_ARNREGION_OPTION = "UseARNRegion";

// list of runtime-client plugins
private static final List<RuntimeClientPlugin> runtimeClientPlugins = new ArrayList<>();
private final List<RuntimeClientPlugin> runtimeClientPlugins = new ArrayList<>();

private static boolean isS3Service(Model model, ServiceShape service) {
return service.expectTrait(ServiceTrait.class).getSdkId().equalsIgnoreCase("S3");
Expand Down Expand Up @@ -145,7 +145,12 @@ public void processFinalizedModel(GoSettings settings, Model model) {
);

runtimeClientPlugins.add(RuntimeClientPlugin.builder()
.servicePredicate(S3UpdateEndpoint::isS3SharedService)
.operationPredicate((m,s,o)-> {
if (!isS3SharedService(m, s)) {
return false;
}
return o.equals(operation);
})
.registerMiddleware(MiddlewareRegistrar.builder()
.resolvedFunction(SymbolUtils.createValueSymbolBuilder(helperFuncName)
.build())
Expand Down

0 comments on commit 7bed165

Please sign in to comment.