From: Mailing l. f. S. c. m. <jtc...@li...> - 2007-07-19 06:52:53
|
Revision: 2738 http://jtcfrost.svn.sourceforge.net/jtcfrost/?rev=2738&view=rev Author: bback Date: 2007-07-18 23:52:36 -0700 (Wed, 18 Jul 2007) Log Message: ----------- - merged changes from trunk until rev. 2736 Modified Paths: -------------- branches/bayesianfilter/frost-wot/source/frost/fcp/fcp07/messagetransfer/MessageTransferHandler.java branches/bayesianfilter/frost-wot/source/frost/gui/sentmessages/SentMessagesTableModel.java branches/bayesianfilter/frost-wot/source/frost/messages/SentMessagesManager.java branches/bayesianfilter/frost-wot/source/frost/storage/database/applayer/SentMessageDatabaseTable.java Modified: branches/bayesianfilter/frost-wot/source/frost/fcp/fcp07/messagetransfer/MessageTransferHandler.java =================================================================== --- branches/bayesianfilter/frost-wot/source/frost/fcp/fcp07/messagetransfer/MessageTransferHandler.java 2007-07-19 06:47:16 UTC (rev 2737) +++ branches/bayesianfilter/frost-wot/source/frost/fcp/fcp07/messagetransfer/MessageTransferHandler.java 2007-07-19 06:52:36 UTC (rev 2738) @@ -58,14 +58,14 @@ return; } + taskMap.put(task.getIdentifier(), task); + // send task to socket if( task.isModeDownload() ) { fcpTools.startDirectGet(task.getIdentifier(), task.getKey(), task.getPriority(), task.getMaxSize()); } else { fcpTools.startDirectPut(task.getIdentifier(), task.getKey(), task.getPriority(), task.getFile()); } - - taskMap.put(task.getIdentifier(), task); } protected synchronized void setTaskFinished(MessageTransferTask task) { Modified: branches/bayesianfilter/frost-wot/source/frost/gui/sentmessages/SentMessagesTableModel.java =================================================================== --- branches/bayesianfilter/frost-wot/source/frost/gui/sentmessages/SentMessagesTableModel.java 2007-07-19 06:47:16 UTC (rev 2737) +++ branches/bayesianfilter/frost-wot/source/frost/gui/sentmessages/SentMessagesTableModel.java 2007-07-19 06:52:36 UTC (rev 2738) @@ -30,8 +30,8 @@ } public void loadTableModel() { - List msgs = SentMessagesManager.retrieveSentMessages(); - for( Iterator i = msgs.iterator(); i.hasNext(); ) { + List<FrostMessageObject> msgs = SentMessagesManager.retrieveSentMessages(); + for( Iterator<FrostMessageObject> i = msgs.iterator(); i.hasNext(); ) { FrostMessageObject mo = (FrostMessageObject) i.next(); SentMessagesTableItem item = new SentMessagesTableItem(mo); addSendMessageItem(item); Modified: branches/bayesianfilter/frost-wot/source/frost/messages/SentMessagesManager.java =================================================================== --- branches/bayesianfilter/frost-wot/source/frost/messages/SentMessagesManager.java 2007-07-19 06:47:16 UTC (rev 2737) +++ branches/bayesianfilter/frost-wot/source/frost/messages/SentMessagesManager.java 2007-07-19 06:52:36 UTC (rev 2738) @@ -28,14 +28,14 @@ private static final Logger logger = Logger.getLogger(SentMessagesManager.class.getName()); - public static List retrieveSentMessages() { + public static List<FrostMessageObject> retrieveSentMessages() { try { return AppLayerDatabase.getSentMessageTable().retrieveAllMessages(); } catch(Throwable t) { logger.log(Level.SEVERE, "Error retrieving sent messages", t); } - return new LinkedList(); + return new LinkedList<FrostMessageObject>(); } public static boolean addSentMessage(FrostMessageObject sentMo) { @@ -49,7 +49,7 @@ return true; // if we return false the msg is resent ! } - public static int deleteSentMessages(List msgObjects) { + public static int deleteSentMessages(List<FrostMessageObject> msgObjects) { int deleted = 0; try { deleted = AppLayerDatabase.getSentMessageTable().deleteMessages(msgObjects); Modified: branches/bayesianfilter/frost-wot/source/frost/storage/database/applayer/SentMessageDatabaseTable.java =================================================================== --- branches/bayesianfilter/frost-wot/source/frost/storage/database/applayer/SentMessageDatabaseTable.java 2007-07-19 06:47:16 UTC (rev 2737) +++ branches/bayesianfilter/frost-wot/source/frost/storage/database/applayer/SentMessageDatabaseTable.java 2007-07-19 06:52:36 UTC (rev 2738) @@ -86,13 +86,13 @@ return "sentmsgcont_index"; } - public int deleteMessages(List messages) throws SQLException { + public int deleteMessages(List<FrostMessageObject> messages) throws SQLException { AppLayerDatabase db = AppLayerDatabase.getInstance(); PreparedStatement ps = db.prepareStatement("DELETE FROM "+getMessageTableName()+" WHERE primkey=?"); int deletedCount = 0; - for(Iterator i=messages.iterator(); i.hasNext(); ) { + for(Iterator<FrostMessageObject> i=messages.iterator(); i.hasNext(); ) { FrostMessageObject mo = (FrostMessageObject) i.next(); ps.setLong(1, mo.getMsgIdentity()); deletedCount += ps.executeUpdate(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |