From 43acc933bfc5997ba409d85e64666a6f1a77be8d Mon Sep 17 00:00:00 2001 From: Christine Emrich Date: Mon, 16 Nov 2015 14:05:18 +0100 Subject: [PATCH] Fixed control flow issues. --- .../src/androidTest/java/RecyclerViewAssertions.java | 5 ++--- .../owncloudnewsreader/database/DatabaseConnectionOrm.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/News-Android-App/src/androidTest/java/RecyclerViewAssertions.java b/News-Android-App/src/androidTest/java/RecyclerViewAssertions.java index 151f1632..d4d54993 100644 --- a/News-Android-App/src/androidTest/java/RecyclerViewAssertions.java +++ b/News-Android-App/src/androidTest/java/RecyclerViewAssertions.java @@ -20,9 +20,8 @@ public class RecyclerViewAssertions implements ViewAssertion { RecyclerView recyclerView = (RecyclerView) view; LinearLayoutManager layoutManager = ((LinearLayoutManager)recyclerView.getLayoutManager()); int firstVisiblePosition = layoutManager.findFirstVisibleItemPosition(); - if(firstVisiblePosition == mExpectedPos) - return; - else + + if(firstVisiblePosition != mExpectedPos) throw new RuntimeException("Wrong position! Expected: " + mExpectedPos + " but was: " + firstVisiblePosition); } } diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/database/DatabaseConnectionOrm.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/database/DatabaseConnectionOrm.java index aed6a24f..e65bc0f2 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/database/DatabaseConnectionOrm.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/database/DatabaseConnectionOrm.java @@ -334,7 +334,7 @@ public class DatabaseConnectionOrm { public boolean doesRssItemAlreadyExsists (long feedId) { List feeds = daoSession.getRssItemDao().queryBuilder().where(RssItemDao.Properties.Id.eq(feedId)).list(); - return (feeds.size() <= 0) ? false : true; + return feeds.size() > 0; }