MCPcopy Create free account
hub / github.com/jOOQ/jOOQ / deepEqual

Method deepEqual

jOOQ/src/main/java/org/jooq/impl/AbstractStore.java:154–183  ·  view source on GitHub ↗
(Object thisValue, Object thatValue)

Source from the content-addressed store, hash-verified

152 }
153
154 static final boolean deepEqual(Object thisValue, Object thatValue) {
155
156 // [#1850] Only return false early. In all other cases,
157 // continue checking the remaining fields
158 if (thisValue == null && thatValue == null)
159 return true;
160
161 else if (thisValue == null || thatValue == null)
162 return false;
163
164 // [#985] Compare arrays too.
165 else if (thisValue.getClass().isArray() && thatValue.getClass().isArray()) {
166
167 // Might be byte[]
168 if (thisValue.getClass() == byte[].class && thatValue.getClass() == byte[].class) {
169 return Arrays.equals((byte[]) thisValue, (byte[]) thatValue);
170 }
171
172 // Other primitive types are not expected
173 else if (!thisValue.getClass().getComponentType().isPrimitive() &&
174 !thatValue.getClass().getComponentType().isPrimitive()) {
175 return Arrays.deepEquals((Object[]) thisValue, (Object[]) thatValue);
176 }
177
178 else
179 return false;
180 }
181 else
182 return thisValue.equals(thatValue);
183 }
184}

Callers 2

equalsMethod · 0.95
modifiedMethod · 0.80

Calls 2

isArrayMethod · 0.65
equalsMethod · 0.65

Tested by

no test coverage detected