Skip to content

Commit

Permalink
Ignore removed entries in CHANGED_FROM_STATIC
Browse files Browse the repository at this point in the history
The check fails if the `after` state is null. This cases only happens
when the entry has been removed entirely, instead of only changed from
static to non-static.

There are other tests that look for those changes, so it's safe to
ignore it from the CHANGED_FROM_STATIC check.
  • Loading branch information
rlazo committed Sep 9, 2024
1 parent 2eb7cd7 commit f5c8156
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,10 @@ enum class DeltaType {
},
CHANGED_FROM_STATIC {
override fun getViolations(before: ClassInfo?, after: ClassInfo?): List<Delta> {
// Safe to ignore: if `after` is null, then it has been removed and another check will
// report this.
if (after == null) return emptyList()

val allBeforeMethods = getAllMethods(before)
val allAfterMethods = getAllMethods(after)
val afterStaticMethods =
Expand Down

0 comments on commit f5c8156

Please sign in to comment.