@@ -273,13 +273,12 @@ private String findRequestUri(Shape parentShape, Map<String, Shape> allC2jShapes
273
273
private String deriveUnmarshallerLocationName (Shape memberShape , String memberName , Member member ) {
274
274
String locationName ;
275
275
if (memberShape .getListMember () != null && memberShape .isFlattened ()) {
276
- locationName = memberShape .getListMember ().getLocationName () == null ?
277
- member .getLocationName () : memberShape .getListMember ().getLocationName ();
276
+ locationName = deriveLocationNameForListMember (memberShape , member );
278
277
} else {
279
278
locationName = member .getLocationName ();
280
279
}
281
280
282
- if (locationName != null && ! locationName . trim (). isEmpty ( )) {
281
+ if (StringUtils . isNotBlank ( locationName )) {
283
282
return locationName ;
284
283
}
285
284
@@ -288,21 +287,47 @@ private String deriveUnmarshallerLocationName(Shape memberShape, String memberNa
288
287
289
288
private String deriveMarshallerLocationName (Shape memberShape , String memberName , Member member , String protocol ) {
290
289
String queryName = member .getQueryName ();
291
- if (queryName != null && !queryName .trim ().isEmpty ()) {
290
+
291
+ if (StringUtils .isNotBlank (queryName )) {
292
292
return queryName ;
293
+ }
294
+
295
+ String locationName ;
296
+
297
+ if (Protocol .EC2 .getValue ().equalsIgnoreCase (protocol )) {
298
+ locationName = deriveLocationNameForEc2 (member );
299
+ } else if (memberShape .getListMember () != null && memberShape .isFlattened ()) {
300
+ locationName = deriveLocationNameForListMember (memberShape , member );
293
301
} else {
294
- String locationName = memberShape .getListMember () != null && memberShape .isFlattened () && !protocol .equals ("ec2" ) ?
295
- memberShape .getListMember ().getLocationName () : member .getLocationName ();
296
- if (locationName != null && !locationName .trim ().isEmpty ()) {
297
- if (protocol .equals (Protocol .EC2 .getValue ())) {
298
- return StringUtils .upperCase (locationName .substring (0 , 1 )) +
299
- locationName .substring (1 );
300
- }
301
- return locationName ;
302
- } else {
303
- return memberName ;
304
- }
302
+ locationName = member .getLocationName ();
303
+ }
304
+
305
+ if (StringUtils .isNotBlank (locationName )) {
306
+ return locationName ;
307
+ }
308
+
309
+ return memberName ;
310
+ }
311
+
312
+ private String deriveLocationNameForEc2 (Member member ) {
313
+ String locationName = member .getLocationName ();
314
+
315
+ if (StringUtils .isNotBlank (locationName )) {
316
+ return StringUtils .upperCase (locationName .substring (0 , 1 )) +
317
+ locationName .substring (1 );
318
+ }
319
+
320
+ return null ;
321
+ }
322
+
323
+ private String deriveLocationNameForListMember (Shape memberShape , Member member ) {
324
+ String locationName = memberShape .getListMember ().getLocationName ();
325
+
326
+ if (StringUtils .isNotBlank (locationName )) {
327
+ return locationName ;
305
328
}
329
+
330
+ return member .getLocationName ();
306
331
}
307
332
308
333
private void fillContainerTypeMemberMetadata (Map <String , Shape > c2jShapes ,
0 commit comments