-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] [Java] Genrated equals doesn't honor nested primitive-array #3182
Labels
Comments
Have you tried the following option?
|
thanks @wing328, i tried the following snippet and it's working! Map<String, byte[]> m1 = new HashMap<String, byte[]>();
m1.put("foo", new byte[]{0, 1});;;;
Map<String, byte[]> m2 = new HashMap<String, byte[]>();
m2.put("foo", new byte[]{0, 1});;;;
System.out.println(EqualsBuilder.reflectionEquals(m1, m2));
// true |
/reopen |
@wing328 ah oversight.. it doesnt actually solve the issue. we will have to enable the Map<String, byte[]> data1 = new HashMap<>();
data1.put("foo", new byte[]{1});
Map<String, byte[]> data2 = new HashMap<>();
data2.put("foo", new byte[]{1});
V1Secret secret1 = new V1Secret().data(data1);
V1Secret secret2 = new V1Secret().data(data2);
System.out.println(secret1.equals(secret2)); // false
}
} |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
xref: kubernetes-client/java#431
the generated equals call for
Map<String, byte[]>
is broken b/c we didn't apply deep-equal check for nested value entries in the map. the makes equals call permanently returning false..The text was updated successfully, but these errors were encountered: