INT-3700: Fix FeedEntryMS for correct lastTime

JIRA: https://jira.spring.io/browse/INT-3700

Change to calculate proper syndicate entry date for comparison when
adding feeds for processing.

I have signed and agree to the terms of the SpringSource Individual
Contributor License Agreement.

unit test for recent changes to FeedEntryMessageSourceTests to verify
proper last seen date calculation.

updates for comments from code review

* newline at EOF on atom.xml
* removed question from code
* fetch files via classpath instead of file system
* 'else' on newline
* authorship on class

Polishing
This commit is contained in:
Aaron Loes
2015-04-17 19:00:27 +03:00
committed by Artem Bilan
parent aa43109009
commit a0fdf6f0dc
6 changed files with 101 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,6 +52,7 @@ import com.rometools.rome.feed.synd.SyndFeed;
* @author Mario Gray
* @author Oleg Zhurakousky
* @author Artem Bilan
* @author Aaron Loes
* @since 2.0
*/
public class FeedEntryMessageSource extends IntegrationObjectSupport implements MessageSource<SyndEntry> {
@@ -165,8 +166,10 @@ public class FeedEntryMessageSource extends IntegrationObjectSupport implements
if (next == null) {
return null;
}
if (next.getPublishedDate() != null) {
this.lastTime = next.getPublishedDate().getTime();
Date lastModifiedDate = FeedEntryMessageSource.getLastModifiedDate(next);
if (lastModifiedDate != null) {
this.lastTime = lastModifiedDate.getTime();
}
else {
this.lastTime += 1;//NOSONAR - single poller thread