Skip to content

Commit 2d10fd1

Browse files
committed
Remove function that's not used
1 parent ab4f263 commit 2d10fd1

3 files changed

Lines changed: 6 additions & 25 deletions

File tree

tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/ServiceNameUtil.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44
*/
55
package com.amazonaws.util.awsclientsmithygenerator.generators;
66

7-
import software.amazon.smithy.model.Model;
87
import software.amazon.smithy.model.shapes.ServiceShape;
98
import software.amazon.smithy.aws.traits.ServiceTrait;
10-
import software.amazon.smithy.model.shapes.Shape;
11-
import software.amazon.smithy.model.transform.ModelTransformer;
129

1310
import java.util.Map;
1411

@@ -168,14 +165,6 @@ public static String getExportMacro(ServiceShape service, Map<String, String> se
168165
return "AWS_" + serviceName.toUpperCase() + "_API";
169166
}
170167

171-
/**
172-
* Returns the project name for file path construction (e.g., "kinesis", "s3-crt").
173-
* This is the lowercase hyphenated name used in: include/aws/{projectName}/model/
174-
*/
175-
public static String getProjectName(ServiceShape service, Map<String, String> serviceMap) {
176-
return getSmithyServiceName(service, serviceMap);
177-
}
178-
179168
public static boolean isS3CrtProjection(ServiceShape service) {
180169
String serviceId = service.getTrait(ServiceTrait.class)
181170
.map(ServiceTrait::getSdkId)

tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/ShapeUtil.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public class ShapeUtil {
7272
*/
7373
private static final Map<String, Map<String, String>> HARDCODED_COLLISION_RESOLUTIONS = Map.of(
7474
"s3", Map.of("CopyObjectResult", "CopyObjectResultDetails"),
75-
"medialive", Map.of("BatchUpdateScheduleResult", ""), // removed from model
7675
"accessanalyzer", Map.of("GeneratedPolicyResult", "GeneratedPolicyResults"),
7776
"cloudsearchdomain", Map.of("SearchResult", "SearchResultDetails")
7877
);
@@ -102,17 +101,11 @@ public static String getHardcodedResolution(String smithyServiceName, String sha
102101
}
103102

104103
/**
105-
* Returns the C++ class name for a shape, applying numeric prefix rules.
106-
* Shapes starting with a digit get "The" prepended (C2J behavior).
107-
* Empty strings returned from hardcoded resolutions indicate shapes that are removed from the model.
104+
* Returns the C++ class name for a shape, applying collision renames and numeric prefix rules.
108105
*/
109106
public static String getShapeCppName(String shapeName, String smithyServiceName) {
110-
// Check hardcoded resolutions first
111107
String resolved = getHardcodedResolution(smithyServiceName, shapeName);
112-
if (resolved != null && !resolved.isEmpty()) return resolved;
113-
// If resolved is an empty string, it indicates the shape is removed from the model
114-
if (resolved != null && resolved.isEmpty()) return "";
115-
// Numeric prefix: shapes starting with a digit get "The" prepended
108+
if (resolved != null) return resolved;
116109
if (!shapeName.isEmpty() && Character.isDigit(shapeName.charAt(0))) {
117110
return "The" + shapeName;
118111
}

tools/code-generation/smithy/cpp-codegen/smithy-cpp-codegen/src/test/java/com/amazonaws/util/awsclientsmithygenerator/generators/model/ShapeUtilExtensionsTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ void hardcodedCollisionResolution_noMatch_returnsNull() {
3434
}
3535

3636
@Test
37-
void hardcodedCollisionResolution_medialiveBatchUpdateScheduleResult_emptyString() {
38-
assertEquals("",
39-
ShapeUtil.getHardcodedResolution("medialive", "BatchUpdateScheduleResult"));
37+
void hardcodedCollisionResolution_medialive_noEntry() {
38+
assertNull(ShapeUtil.getHardcodedResolution("medialive", "BatchUpdateScheduleResult"));
4039
}
4140

4241
@Test
@@ -50,8 +49,8 @@ void shapeCppName_normalName_unchanged() {
5049
}
5150

5251
@Test
53-
void shapeCppName_medialiveBatchUpdateScheduleResult_removedShape_returnsEmpty() {
54-
assertEquals("",
52+
void shapeCppName_medialive_noOverride_returnsUnchanged() {
53+
assertEquals("BatchUpdateScheduleResult",
5554
ShapeUtil.getShapeCppName("BatchUpdateScheduleResult", "medialive"));
5655
}
5756

0 commit comments

Comments
 (0)