Skip to content

Commit cf557a7

Browse files
committed
fixes igniterealtime#139: Removing unused code
Removing code that is not referenced / used anywhere. This reduces complexity, and improves maintainability.
1 parent 93ec9a4 commit cf557a7

16 files changed

+21
-448
lines changed

src/java/com/reucon/openfire/plugin/archive/impl/PaginatedMucMessageDatabaseQuery.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ private String getStatementForSQLServer(final Long after, final Long before, fin
211211
{
212212
String sql = "SELECT sender, nickname, logTime, subject, body, stanza, messageId ";
213213
sql += " FROM ( ";
214-
sql += " SELECT TOP("+String.valueOf(maxResults)+") sender, nickname, logTime, subject, body, stanza, messageId FROM ofMucConversationLog ";
214+
sql += " SELECT TOP("+ maxResults +") sender, nickname, logTime, subject, body, stanza, messageId FROM ofMucConversationLog ";
215215
sql += " WHERE messageId IS NOT NULL AND logTime > ? AND logTime <= ? AND roomID = ? AND (nickname IS NOT NULL OR subject IS NOT NULL) ";
216216
if ( with != null ) {
217217
// XEP-0313 specifies: If (and only if) the supplied JID is a bare JID (i.e. no resource is present), then the server

src/java/com/reucon/openfire/plugin/archive/model/Preferences.java

-22
This file was deleted.

src/java/com/reucon/openfire/plugin/archive/util/EscapeUtil.java

-50
This file was deleted.

src/java/com/reucon/openfire/plugin/archive/xep0136/RemoveRequest.java

-78
This file was deleted.

src/java/org/jivesoftware/openfire/archive/ArchiveSearch.java

-13
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,6 @@ public class ArchiveSearch {
6363
private SortOrder sortOrder;
6464
private boolean externalWildcardMode;
6565

66-
/**
67-
* Creates a new search on a query string.
68-
*
69-
* @param queryString the query string to use for the search.
70-
* @return an ArchiveSearch instance to search using the specified query string.
71-
*/
72-
public static ArchiveSearch createKeywordSearch(String queryString) {
73-
ArchiveSearch search = new ArchiveSearch();
74-
search.setQueryString(queryString);
75-
search.setSortField(SortField.relevance);
76-
return search;
77-
}
78-
7966
/**
8067
* Constructs a new archive search, sorted on date descending.
8168
*/

src/java/org/jivesoftware/openfire/archive/ArchiveSearcher.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,7 @@ public Iterator<Conversation> iterator() {
430430
public boolean hasNext() {
431431
if (nextElement == null) {
432432
nextElement = getNextElement();
433-
if (nextElement == null) {
434-
return false;
435-
}
433+
return nextElement != null;
436434
}
437435
return true;
438436
}
@@ -518,9 +516,7 @@ public Iterator<Conversation> iterator() {
518516
public boolean hasNext() {
519517
if (nextElement == null) {
520518
nextElement = getNextElement();
521-
if (nextElement == null) {
522-
return false;
523-
}
519+
return nextElement != null;
524520
}
525521
return true;
526522
}

src/java/org/jivesoftware/openfire/archive/ConversationEvent.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public static ConversationEvent roomMessageReceived(JID roomJID, JID user, Strin
201201
return event;
202202
}
203203

204-
private static enum Type {
204+
private enum Type {
205205
/**
206206
* Event triggered when a room was destroyed.
207207
*/

src/java/org/jivesoftware/openfire/archive/ConversationListener.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public interface ConversationListener {
3232
*
3333
* @param conversation the conversation.
3434
*/
35-
public void conversationCreated(Conversation conversation);
35+
void conversationCreated(Conversation conversation);
3636

3737
/**
3838
* A conversation was updated, which means that a new message was sent between
@@ -41,14 +41,13 @@ public interface ConversationListener {
4141
* @param conversation the conversation.
4242
* @param date the date the conversation was updated.
4343
*/
44-
public void conversationUpdated(Conversation conversation, Date date);
44+
void conversationUpdated(Conversation conversation, Date date);
4545

4646
/**
4747
* A conversation ended due to inactivity or because the maximum conversation time
4848
* was hit.
4949
*
5050
* @param conversation the conversation.
5151
*/
52-
public void conversationEnded(Conversation conversation);
53-
52+
void conversationEnded(Conversation conversation);
5453
}

0 commit comments

Comments
 (0)