*Hi everyone !
We ( Adrien Ghosn and Damien Engels) think we've found a bug and a way to fix it in the code.
General description :
When you try to register a new account, but make an error (forgot to fill a field or try to register an account that already exists) the window load an error message which causes its size and location to change in a strange way (big size and relocated at the top of the screen).
Explanation of the bug:
The bug is in the class net.java.sip.communicator.impl.gui.main.account.NewAccountDialog, more specifically in the method "loadErrorMessage(String errorMessage)". The adding of the errorPanel and the display of the error message caused the size to change too much, and the pack() call in the method did not seem to fix this. After some investigations we found that the size changing was due to this line:
so we moved the call to pack() after this line which fixed the problem with the size of the frame.
This brought up another issue; there was an uncaught NullPointerException that was launched by one the awt-EventQueue Thread, this is because the "loadErrorMessage" method was called by the run method of a Thread that was not the awt-Thread which caused some concurrency problems (repaint of an only partially initialized component object). We fixed this by encapsulating the repaint (and others) call in a Runnable for the awt-Thread to be called.
This is the resulting code that fixes the bug:
private void loadErrorMessage(final String errorMessage)
if (errorMessagePane == null)
errorMessagePane = new JTextArea();
public void run()
We ran the tests and everything works (get same results with and without the modifications).
Should we create a new issue and attach the modified java class to it ?*
kF3VpApcMVdp-qaUm0GJRt5o_6IoU_5jHakxSYGe6zae24ur4lZ42VFdq5tjzGcLCJn7Cxvc6RZmccG2qvbPuC6eUzoYTXqKCJCXLzNBqlUm5tx9Z_BR (20.5 KB)
rDjFPrbkY76tTT73tlT2d6dilRKk7ytUJyFDUNKqjOs6rP0b3DFvME_2twhVxA9mOtiuES_uJH4CJ8x3GPbbNR1iaW43i3UsUZJPPKqR2iMJqvuV5q7o (28.7 KB)
NewAccountDialog.java (21.1 KB)