if (!ports.containsKey(reply))
if (reply.trim().length()==0) { message = "Empty name! Enter valid name:"; type = JOptionPane.WARNING_MESSAGE; continue; } else if (reply.indexOf(' ')!=-1) { message = "No spaces allowed! Enter valid name:"; type = JOptionPane.WARNING_MESSAGE; continue; } else if (!ports.containsKey(reply))
public void renameProperty(InspectableProperty property){	String message = "Enter new port name of '"+property.getName()+"':";	int type = JOptionPane.QUESTION_MESSAGE;	while (true)	{		String reply = JOptionPane.showInputDialog( null,			                           message,			                           "Rename port...",			                            type);		if (reply!=null)		{			if (!ports.containsKey(reply))			{				renamePort((VDBPort)property, reply);			}			else			{				message = "Port '"+reply+"' already exists. Enter other name:";				type = JOptionPane.WARNING_MESSAGE;				continue;			}		}				break;	}}