Skip to content

Commit 204781a

Browse files
author
niess
committed
Fixed smack sample for updated API
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@11233 b35dd754-fafc-0310-a699-88a17e54d16e
1 parent 07bd510 commit 204781a

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

sample/web/moveContact.jsp

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@
193193
<%
194194
RosterEntry entry = roster.getEntry(user);
195195
RosterGroup group;
196-
for (Iterator it=entry.getGroups(); it.hasNext();) {
197-
group = (RosterGroup) it.next();%>
196+
for (Iterator<RosterGroup> it=entry.getGroups().iterator(); it.hasNext();) {
197+
group = it.next();%>
198198
<tr>
199199
<td align="center" width="80%" class=text height=16><%=group.getName()%></td>
200200
<td valign="middle" align="center" width="20%"><a href="moveContact.jsp?action=delete&user=<%=user%>&fromGroup=<%=group.getName()%>"><img src="images/garbage.png" alt="Remove contact from the group" border="0"></a></td>

sample/web/viewRoster.jsp

+9-9
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
8686
// Close the connection to the XMPP server
8787
if ("close".equals(action)) {
88-
conn.close();
88+
conn.disconnect();
8989
session.invalidate();
9090
response.sendRedirect("login.jsp");
9191
return;
@@ -118,8 +118,8 @@
118118
</tr>
119119
<tr>
120120
<td> <TABLE cellSpacing=0 borderColorDark=#E0E0E0 cellPadding=0 width=100% align=center borderColorLight=#000000 border=1>
121-
<% for (Iterator groups = roster.getGroups(); groups.hasNext();) {
122-
RosterGroup group = (RosterGroup)groups.next();%>
121+
<% for (Iterator<RosterGroup> groups = roster.getGroups().iterator(); groups.hasNext();) {
122+
RosterGroup group = groups.next();%>
123123
<tr>
124124
<td bgcolor="#AAAAAA" colspan="6" class=text id=white height=16>Group:
125125
<%= group.getName()%></td>
@@ -130,8 +130,8 @@
130130
<TD class=text id=white height=16>Subscription</TD>
131131
<TD colspan="3" class=text id=white height=16><a href="addContact.jsp?group1=<%=group.getName()%>"><img src="images/businessman_add.png" alt="Add contact to group" border="0"></a></TD>
132132
</TR>
133-
<% for (Iterator it = group.getEntries(); it.hasNext();) {
134-
RosterEntry entry = (RosterEntry)it.next();%>
133+
<% for (Iterator<RosterEntry> it = group.getEntries().iterator(); it.hasNext();) {
134+
RosterEntry entry = it.next();%>
135135
<TR vAlign=center align=middle bgColor=#ffffff>
136136
<TD class=text height=16><%= entry.getUser()%></TD>
137137
<TD class=text height=16><%= entry.getName()%></TD>
@@ -152,8 +152,8 @@
152152
<TD class=text id=white height=16>Subscription</TD>
153153
<TD colspan="3" class=text id=white height=16><a href="addContact.jsp"><img src="images/businessman_add.png" alt="Add contact" border="0"></a></TD>
154154
</TR>
155-
<% for (Iterator it = roster.getUnfiledEntries(); it.hasNext();) {
156-
RosterEntry entry = (RosterEntry)it.next();%>
155+
<% for (Iterator<RosterEntry> it = roster.getUnfiledEntries().iterator(); it.hasNext();) {
156+
RosterEntry entry = it.next();%>
157157
<tr vAlign=center align=middle bgColor=#ffffff>
158158
<td class=text height=16><%= entry.getUser()%></td>
159159
<td class=text height=16><%= entry.getName()%></td>
@@ -183,8 +183,8 @@
183183
<TD class=text id=white height=16>Type</TD>
184184
<TD class=text id=white height=16>&nbsp;</TD>
185185
</TR>
186-
<% for (Iterator entries = roster.getEntries(); entries.hasNext();) {
187-
RosterEntry entry = (RosterEntry)entries.next();
186+
<% for (Iterator<RosterEntry> entries = roster.getEntries().iterator(); entries.hasNext();) {
187+
RosterEntry entry = entries.next();
188188
Iterator presences = roster.getPresences(entry.getUser());
189189
if (presences != null) {
190190
while (presences.hasNext()) {

0 commit comments

Comments
 (0)