-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
NPE in StdDateFormat
hashCode and equals
#1130
Milestone
Comments
I would like to see more of stack trace to know why these methods are invoked. |
cowtowncoder
changed the title
NPE in hashCode and equals
NPE in Feb 16, 2016
StdDateFormat
hashCode and equals
It is a small sample for repro. For example, NPE is occurred when add the public class FooTest {
@Test
public void testHashCode() {
Set<DateFormat> set = new HashSet<>();
set.add(StdDateFormat.instance);
}
}
I tried same operation using the @Test
public void testHashCode2() {
Set<DateFormat> set = new HashSet<>();
set.add(new SimpleDateFormat("yyyyMMdd"));
} This code is no problem. |
1 task
Ok, went ahead and added minimal code to avoid NPE. |
Thanks for fix !! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Occur
NullPointerException
inhashCode()
andequals(Object)
method.Please implements these methods correctly.
Thanks.
Test Cases
Stack Traces
The text was updated successfully, but these errors were encountered: