Skip to content

Commit fa6a9cd

Browse files
Add DiffEvaluator method that accepts ClassLoader
This adds a new, defaulted method to DiffEvaluator that additionally takes a ClassLoader. This may be used for a number of reasons, but was added particularly to allow running ModelDiff on synthetic changes from an evaluator.
1 parent 9713a61 commit fa6a9cd

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
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": "Updated `DiffEvaluator` interface to include an optional method that additionally accepts a `ClassLoader`. This ensures that the loader the evaluation is configured with can be used in any evaluators that may need it.",
4+
"pull_requests": [
5+
"[#2796](https://github.com/smithy-lang/smithy/pull/2796)"
6+
]
7+
}

smithy-diff/src/main/java/software/amazon/smithy/diff/DiffEvaluator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,8 @@ public interface DiffEvaluator {
2929
* @return Returns validation events that are relative to the new model.
3030
*/
3131
List<ValidationEvent> evaluate(Differences differences);
32+
33+
default List<ValidationEvent> evaluate(ClassLoader classLoader, Differences differences) {
34+
return evaluate(differences);
35+
}
3236
}

0 commit comments

Comments
 (0)