Code cleanup: Fix probable bugs: Replace group delimiter literals with constant
@@ -75,6 +75,7 @@ public class ContactList extends JPanel implements ActionListener,
ContactGroupListener, Plugin, RosterListener, ConnectionListener, ReconnectionListener {
private static final long serialVersionUID = -4391111935248627078L;
+ private static final String GROUP_DELIMITER = "::";
private JPanel mainPanel = new JPanel();
private JScrollPane contactListScrollPane;
private final List<ContactGroup> groupList = new ArrayList<>();
@@ -984,7 +985,7 @@ public class ContactList extends JPanel implements ActionListener,
* @return the newly created ContactGroup.
*/
private ContactGroup addContactGroup(String groupName) {
- StringTokenizer tkn = new StringTokenizer(groupName, "::");
+ StringTokenizer tkn = new StringTokenizer(groupName, GROUP_DELIMITER);
ContactGroup rootGroup = null;
ContactGroup lastGroup = null;
@@ -1199,7 +1200,7 @@ public class ContactList extends JPanel implements ActionListener,
* @param visible true to show, otherwise false.
*/
public void toggleGroupVisibility(String groupName, boolean visible) {
- StringTokenizer tkn = new StringTokenizer(groupName, "::");
+ StringTokenizer tkn = new StringTokenizer(groupName, GROUP_DELIMITER);
while (tkn.hasMoreTokens()) {
String group = tkn.nextToken();
ContactGroup contactGroup = getContactGroup(group);
