-
-
Notifications
You must be signed in to change notification settings - Fork 711
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore containers when checking compared fields existence in the recu…
- Loading branch information
Joel Costigliola
committed
Feb 3, 2024
1 parent
bad16ef
commit ae62aca
Showing
4 changed files
with
55 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
assertj-core/src/main/java/org/assertj/core/internal/RecursiveHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.assertj.core.internal; | ||
|
||
import java.util.Map; | ||
import java.util.Optional; | ||
import java.util.concurrent.atomic.AtomicBoolean; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
import java.util.concurrent.atomic.AtomicIntegerArray; | ||
import java.util.concurrent.atomic.AtomicLong; | ||
import java.util.concurrent.atomic.AtomicLongArray; | ||
import java.util.concurrent.atomic.AtomicReference; | ||
import java.util.concurrent.atomic.AtomicReferenceArray; | ||
|
||
import static org.assertj.core.util.Arrays.isArray; | ||
|
||
public class RecursiveHelper { | ||
public static boolean isContainer(Object o) { | ||
return o instanceof Iterable || | ||
o instanceof Map || | ||
o instanceof Optional || | ||
o instanceof AtomicReference || | ||
o instanceof AtomicReferenceArray || | ||
o instanceof AtomicBoolean || | ||
o instanceof AtomicInteger || | ||
o instanceof AtomicIntegerArray || | ||
o instanceof AtomicLong || | ||
o instanceof AtomicLongArray || | ||
isArray(o); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters