Skip to content

Commit

Permalink
improve getRecentDate(List)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyrio committed Apr 11, 2021
1 parent fb723e3 commit 6d01d30
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
19 changes: 8 additions & 11 deletions org.rssowl.core/src/org/rssowl/core/util/DateUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

package org.rssowl.core.util;

import org.eclipse.core.runtime.Assert;
import org.rssowl.core.internal.persist.News;
import org.rssowl.core.persist.INews;

Expand Down Expand Up @@ -91,7 +90,7 @@ public static boolean isAfterIncludingToday(Date date, long todayMidnightInMilli
* are NULL.
*/
public static Date getRecentDate(INews news) {
return ((News)news).fastGetRecentDate();
return ((News) news).fastGetRecentDate();
}

/**
Expand All @@ -100,18 +99,16 @@ public static Date getRecentDate(INews news) {
*
* @param news A List of News to get the most recent Date from.
* @return Either Modified-Date, Publish-Date or Received-Date from the most
* recent News.
* recent News or null.
*/
public static Date getRecentDate(List<INews> news) {
Assert.isTrue(!news.isEmpty());

Date mostRecentDate = null;
for (INews newsitem : news) {
Date date = getRecentDate(newsitem);
if (mostRecentDate == null || date.after(mostRecentDate))
mostRecentDate = date;
}

if (news != null)
for (INews newsitem : news) {
Date date = getRecentDate(newsitem);
if (mostRecentDate == null || date.after(mostRecentDate))
mostRecentDate = date;
}
return mostRecentDate;
}

Expand Down
2 changes: 1 addition & 1 deletion org.rssowl.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@
value="icons/product/16x16.png,icons/product/32x32.png,icons/product/48x48.png,icons/product/64x64.png,icons/product/128x128.png,icons/product/256x256.png"/>
<property
name="aboutText"
value="RSSOwlnix fork of RSSOwl&#x0A;&#x0A;Version: 2.9.0-beta&#x0A;Build Id: 2021-04-10&#x0A;&#x0A;RSSOwlnix and RSSOwl is licensed under the terms of the Eclipse Public License version 1.0.&#x0A;http://www.rssowl.org/legal/epl-v10.html&#x0A;&#x0A;(c) Copyright RSSOwl contributors and others 2005-2011. All rights reserved."/>
value="RSSOwlnix fork of RSSOwl&#x0A;&#x0A;Version: 2.9.0-beta&#x0A;Build Id: 2021-04-11&#x0A;&#x0A;RSSOwlnix and RSSOwl is licensed under the terms of the Eclipse Public License version 1.0.&#x0A;http://www.rssowl.org/legal/epl-v10.html&#x0A;&#x0A;(c) Copyright RSSOwl contributors and others 2005-2011. All rights reserved."/>
<property
name="appName"
value="%product.name">
Expand Down
3 changes: 2 additions & 1 deletion releng/product/rssowlnix.product
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
RSSOwlnix fork of RSSOwl

Version: 2.9.0-beta
Build Id: 2021-04-10
Build Id: 2021-04-11

RSSOwlnix and RSSOwl is licensed under the terms of the Eclipse Public License version 1.0.
http://www.rssowl.org/legal/epl-v10.html
Expand All @@ -31,6 +31,7 @@ http://www.rssowl.org/legal/epl-v10.html

<windowImages i16="/org.rssowl.ui/icons/product/16x16.png" i32="/org.rssowl.ui/icons/product/32x32.png" i48="/org.rssowl.ui/icons/product/48x48.png" i64="/org.rssowl.ui/icons/product/64x64.png" i128="/org.rssowl.ui/icons/product/128x128.png" i256="/org.rssowl.ui/icons/product/256x256.png"/>


<launcher name="RSSOwlnix">
<linux icon="../../org.rssowl.ui/icons/product/rssowl.xpm"/>
<macosx icon="../../org.rssowl.ui/icons/product/rssowl.icns"/>
Expand Down
2 changes: 1 addition & 1 deletion releng/product_manual_export/rssowlnix.product
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
RSSOwlnix fork of RSSOwl

Version: 2.9.0-beta
Build Id: 2021-04-10
Build Id: 2021-04-11

RSSOwlnix and RSSOwl is licensed under the terms of the Eclipse Public License version 1.0.
http://www.rssowl.org/legal/epl-v10.html
Expand Down

0 comments on commit 6d01d30

Please sign in to comment.