1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-10 18:59:41 +02:00

1. Clean up code

2. Refactoring work
3. Optimization work. SMACK-153
4. Fixed roster test cases. SMACK-154
4. Fixed vCard issue. SMACK-152

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@4538 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2006-07-18 05:14:33 +00:00 committed by gato
parent 14b50d790a
commit f57ff10ad9
77 changed files with 995 additions and 932 deletions

View file

@ -20,12 +20,15 @@
package org.jivesoftware.smack;
import org.jivesoftware.smack.packet.RosterPacket;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.filter.PacketIDFilter;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.RosterPacket;
import org.jivesoftware.smack.util.StringUtils;
import java.util.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* A group of roster entries.
@ -37,7 +40,7 @@ public class RosterGroup {
private String name;
private XMPPConnection connection;
private List<RosterEntry> entries;
private final List<RosterEntry> entries;
/**
* Creates a new roster group instance.
@ -70,10 +73,9 @@ public class RosterGroup {
*/
public void setName(String name) {
synchronized (entries) {
for (int i=0; i<entries.size(); i++) {
for (RosterEntry entry : entries) {
RosterPacket packet = new RosterPacket();
packet.setType(IQ.Type.SET);
RosterEntry entry = (RosterEntry)entries.get(i);
RosterPacket.Item item = RosterEntry.toRosterItem(entry);
item.removeGroupName(this.name);
item.addGroupName(name);
@ -121,8 +123,7 @@ public class RosterGroup {
user = StringUtils.parseBareAddress(user);
String userLowerCase = user.toLowerCase();
synchronized (entries) {
for (Iterator i=entries.iterator(); i.hasNext(); ) {
RosterEntry entry = (RosterEntry)i.next();
for (RosterEntry entry : entries) {
if (entry.getUser().equals(userLowerCase)) {
return entry;
}