Skip to content

Commit

Permalink
fix: enforce consistent plugin additional parameter ordering (#1355)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe authored Jul 31, 2024
1 parent 354d175 commit dbed2af
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.TreeMap;
import java.util.function.BiPredicate;
import software.amazon.smithy.codegen.core.Symbol;
import software.amazon.smithy.codegen.core.SymbolDependency;
Expand Down Expand Up @@ -798,7 +799,8 @@ public Builder servicePredicate(BiPredicate<Model, ServiceShape> servicePredicat
* Enables access to the writer for adding imports/dependencies.
*/
public Builder withAdditionalClientParams(Map<String, ClientWriterConsumer> writeAdditionalClientParams) {
this.writeAdditionalClientParams = writeAdditionalClientParams;
// enforce consistent sorting during codegen.
this.writeAdditionalClientParams = new TreeMap<>(writeAdditionalClientParams);
return this;
}

Expand All @@ -808,7 +810,8 @@ public Builder withAdditionalClientParams(Map<String, ClientWriterConsumer> writ
public Builder withAdditionalOperationParams(
Map<String, CommandWriterConsumer> writeAdditionalOperationParams
) {
this.writeAdditionalOperationParams = writeAdditionalOperationParams;
// enforce consistent sorting during codegen.
this.writeAdditionalOperationParams = new TreeMap<>(writeAdditionalOperationParams);
return this;
}

Expand Down

0 comments on commit dbed2af

Please sign in to comment.