I'm a student at CMU in CS and for one of our courses, we need to bring (my teammate and I) some contribution to an open source project.
We've followed the tutorial about how to retrieve the source code and configure Eclipse.
We just go through the code for the moment and try to understand the general architecture.
By doing so we found two pieces of code that we had difficulties to understand :
The first was in the class package net.java.sip.communicator.impl.gui.main.contactlist.AddContactDialog:
This class implements the ExportedWindow interface, and in some of its methods there seems to be an apparent infinite recursive loop (the method maximise() for example unconditionally calls itself, which would cause a stack overflow).
Is it possible to have a bit more explanations about this, I think we may be missing something important?
The second issue we ran into is situated in the class net.java.sip.communicator.impl.contactlist.MetaContactImpl :
There are a few boolean statements in if statement that seem more complicated that they should, for example
public Contact getContact(String contactAddress,
for (Contact contact : protoContacts)
if(contact.getProtocolProvider() == ownerProvider
>> contact.equals(contactAddress))) <=======================
Because the interface Contact does not define any equals(String) method, this equals will be resolved as a call to equal(Object), which is not defined for most of Contact's implementations. It will therefore be resolved to the equals method defined in java.lang.Object and always return false because contact and contactAddress or not the same type.
It doesn't bring any error here, but the code could be reduced to improve understanding.
Any feedback would be greatly appreciated
Damien and Adrien