From 6da2f0c737a6c980385aca84d71670b4b933fd70 Mon Sep 17 00:00:00 2001 From: Lyubomir Marinov Date: Sun, 24 Aug 2014 20:12:03 +0300 Subject: [PATCH] Fixes warnings. --- .../impl/msghistory/MessageSourceService.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/net/java/sip/communicator/impl/msghistory/MessageSourceService.java b/src/net/java/sip/communicator/impl/msghistory/MessageSourceService.java index 15d104bd1..62e2b8e47 100644 --- a/src/net/java/sip/communicator/impl/msghistory/MessageSourceService.java +++ b/src/net/java/sip/communicator/impl/msghistory/MessageSourceService.java @@ -10,7 +10,6 @@ import java.io.*; import java.text.*; import java.util.*; -import java.util.regex.*; import net.java.sip.communicator.service.contactlist.*; import net.java.sip.communicator.service.contactlist.event.*; @@ -25,8 +24,6 @@ import org.jitsi.service.configuration.*; import org.jitsi.util.*; -import static net.java.sip.communicator.service.history.HistoryService.DATE_FORMAT; - /** * The source contact service. The will show most recent messages. * @@ -47,8 +44,7 @@ public class MessageSourceService /** * The logger for this class. */ - private static Logger logger = Logger - .getLogger(MessageSourceService.class); + private static Logger logger = Logger.getLogger(MessageSourceService.class); /** * The display name of this contact source. @@ -631,7 +627,9 @@ List getRecentContactIDs(String provider, Date after) { Iterator recs = history.getReader().findLast(NUMBER_OF_MSGS_IN_HISTORY); - SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); + SimpleDateFormat sdf + = new SimpleDateFormat(HistoryService.DATE_FORMAT); + while(recs.hasNext()) { HistoryRecord hr = recs.next(); @@ -961,12 +959,13 @@ private void saveRecentMessageToHistory(ComparableEvtObj msc) try { History history = getHistory(); - HistoryWriter writer = history.getWriter(); synchronized(recentMessages) { - SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); + SimpleDateFormat sdf + = new SimpleDateFormat(HistoryService.DATE_FORMAT); + writer.addRecord( new String[] { @@ -1055,7 +1054,9 @@ public Map getUpdateChanges() HashMap map = new HashMap(); SimpleDateFormat sdf - = new SimpleDateFormat(DATE_FORMAT); + = new SimpleDateFormat( + HistoryService.DATE_FORMAT); + for(int i = 0; i < hr.getPropertyNames().length; i++)