Skip to content

Commit eedd254

Browse files
committed
comments addressed
1 parent c6cef96 commit eedd254

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

.changes/next-release/bugfix-AWSQueryProtocol-1398d13.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"type": "bugfix",
33
"category": "AWS Query Protocol",
44
"contributor": "",
5-
"description": "Fixed the bug that EC2 DescribeInstances query uses locale-dependent formatting"
5+
"description": "Fixed EC2 DescribeInstances query failure in non-ASCII digit locales by using ROOT locale when formatting query paths to ensure ASCII digits are always used."
66
}

core/protocols/aws-query-protocol/src/main/java/software/amazon/awssdk/protocols/query/internal/marshall/ListQueryMarshaller.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@
3030
public class ListQueryMarshaller implements QueryMarshaller<List<?>> {
3131
private static final PathResolver AWS_QUERY_PATH_RESOLVER = (path, i, listTrait) ->
3232
listTrait.isFlattened() ?
33-
String.format("%s.%d", path, i + 1) :
34-
String.format("%s.%s.%d", path, listTrait.memberFieldInfo().locationName(), i + 1);
35-
private static final PathResolver EC2_QUERY_PATH_RESOLVER = (path, i, listTrait) -> String.format(Locale.ROOT, "%s.%d", path
36-
, i + 1);
33+
path + "." + (i + 1) :
34+
path + "." + listTrait.memberFieldInfo().locationName() + "." + (i + 1);
35+
private static final PathResolver EC2_QUERY_PATH_RESOLVER = (path, i, listTrait) -> path + "." + (i + 1);
3736

3837
private static final EmptyListMarshaller AWS_QUERY_EMPTY_LIST_MARSHALLER =
3938
(context, path) -> context.request().putRawQueryParameter(path, "");

core/protocols/aws-query-protocol/src/main/java/software/amazon/awssdk/protocols/query/internal/marshall/MapQueryMarshaller.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void marshall(QueryMarshallerContext context, String path, Map<String, ?>
4646

4747
private static String resolveMapPath(String path, MapTrait mapTrait, AtomicInteger entryNum, String s) {
4848
return mapTrait.isFlattened() ?
49-
String.format("%s.%d.%s", path, entryNum.get(), s) :
50-
String.format("%s.entry.%d.%s", path, entryNum.get(), s);
49+
path + "." + entryNum.get() + "." + s :
50+
path + ".entry." + entryNum.get() + "." + s;
5151
}
5252
}

0 commit comments

Comments
 (0)