Skip to content

Commit 4ac8f7e

Browse files
Dprecate TopologicalShapeSort
This deprecates TopologicalShapeSort in favor of DependencyGraph. The internal implementation is left alone because it does not inherently enqueue dependencies like DependencyGraph does. This results in TopologicalShapeSort throwing a cycle exception when dependencies are missing, which is a behavior that some may rely on.
1 parent f96eb94 commit 4ac8f7e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "feature",
3+
"description": "Deprecated `TopologicalShapeSort` in favor of `DependencyGraph`.",
4+
"pull_requests": [
5+
"[#2774](https://github.com/smithy-lang/smithy/pull/2774)"
6+
]
7+
}

smithy-model/src/main/java/software/amazon/smithy/model/loader/TopologicalShapeSort.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
/**
2222
* Topologically sorts shapes based on their dependencies (i.e., mixins).
2323
*
24-
* <p>While this class is reusable, it is also stateful; shapes and edges
25-
* are enqueued, and when sorted, all shapes and edges are dequeued.
24+
* <p>Deprecated in favor of {@link software.amazon.smithy.utils.DependencyGraph},
25+
* which is more generic and less stateful.
2626
*/
27+
@Deprecated
2728
public final class TopologicalShapeSort {
2829

2930
private final Map<ShapeId, Set<ShapeId>> forwardDependencies = new HashMap<>();

0 commit comments

Comments
 (0)