I am a developer with only a couple of years of experience, working in a small company of eight developers, on a Java project. Our team leader, also one of the managers, is older, and very productive, and says he has about fifteen years of experience in Java.
Last month, while we were discussing some source code modules he wrote, I noticed in the source code that one the classes overrode method
equals(), but not method
hashCode() - I am referring to the two methods declared in the very basic Java class
Object. When I pointed this out to the team leader, in a very calm and polite manner, he denied that a class should override both methods. The issue would finish there, but I found it immoral to let such a flaw (bug) to hurt the product later.
A few days later, I approached him in person and in private and I quietly, without being disrespectful, explained to him about the issue, and used external references (such as Joshua Bloch's book 'Effective Java'). Well, he said he would look at it, and eventually he did. However, ever since, he gives me the cold shoulder.
Even worse, I recently saw a serious issue in the source code. Some classes he has written implement the
Serializable interface, but the field
serialVersionUID is not a fixed (constant) number. Instead it varies. I mean, we get a different number each time we run the application.
Again with the motivation of delivering a sane product, I would like to communicate this properly. But I do not know how to properly do so, without him taking it personally. You see, my previous approaches failed. How could I do so?
Any advice would be welcome.
Edit: The purpose of this question is to find effective, productive, polite, respectful, collaborative ways to communicate improvements over serious code issues, and not to question the authority or management decisions, made by peers, or even superiors.