From 971b0cd0229e491fad91bf4ff7cc8fbd6405fc94 Mon Sep 17 00:00:00 2001 From: Anthony Restaino Date: Mon, 9 Feb 2015 15:46:10 -0500 Subject: [PATCH] Change Reading mode package name to lower case --- .../lightning/Reading/ArticleTextExtractor.java | 2 +- src/acr/browser/lightning/Reading/Converter.java | 2 +- src/acr/browser/lightning/Reading/HtmlFetcher.java | 2 +- src/acr/browser/lightning/Reading/ImageResult.java | 2 +- src/acr/browser/lightning/Reading/JResult.java | 2 +- src/acr/browser/lightning/Reading/MapEntry.java | 7 +++---- .../browser/lightning/Reading/OutputFormatter.java | 13 +++++-------- src/acr/browser/lightning/Reading/SCache.java | 2 +- src/acr/browser/lightning/Reading/SHelper.java | 2 +- src/acr/browser/lightning/ReadingActivity.java | 6 +++--- 10 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/acr/browser/lightning/Reading/ArticleTextExtractor.java b/src/acr/browser/lightning/Reading/ArticleTextExtractor.java index 3a9188a..ec810d7 100644 --- a/src/acr/browser/lightning/Reading/ArticleTextExtractor.java +++ b/src/acr/browser/lightning/Reading/ArticleTextExtractor.java @@ -1,4 +1,4 @@ -package acr.browser.lightning.Reading; +package acr.browser.lightning.reading; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/acr/browser/lightning/Reading/Converter.java b/src/acr/browser/lightning/Reading/Converter.java index 4ed3178..6178d00 100644 --- a/src/acr/browser/lightning/Reading/Converter.java +++ b/src/acr/browser/lightning/Reading/Converter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package acr.browser.lightning.Reading; +package acr.browser.lightning.reading; import java.io.*; import java.net.SocketTimeoutException; diff --git a/src/acr/browser/lightning/Reading/HtmlFetcher.java b/src/acr/browser/lightning/Reading/HtmlFetcher.java index c597193..e1032ea 100644 --- a/src/acr/browser/lightning/Reading/HtmlFetcher.java +++ b/src/acr/browser/lightning/Reading/HtmlFetcher.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package acr.browser.lightning.Reading; +package acr.browser.lightning.reading; import java.io.BufferedReader; import java.io.BufferedWriter; diff --git a/src/acr/browser/lightning/Reading/ImageResult.java b/src/acr/browser/lightning/Reading/ImageResult.java index 2a8321e..fbdf461 100644 --- a/src/acr/browser/lightning/Reading/ImageResult.java +++ b/src/acr/browser/lightning/Reading/ImageResult.java @@ -1,4 +1,4 @@ -package acr.browser.lightning.Reading; +package acr.browser.lightning.reading; import org.jsoup.nodes.Element; diff --git a/src/acr/browser/lightning/Reading/JResult.java b/src/acr/browser/lightning/Reading/JResult.java index 50ae5ea..b094e3d 100644 --- a/src/acr/browser/lightning/Reading/JResult.java +++ b/src/acr/browser/lightning/Reading/JResult.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package acr.browser.lightning.Reading; +package acr.browser.lightning.reading; import java.io.Serializable; import java.util.ArrayList; diff --git a/src/acr/browser/lightning/Reading/MapEntry.java b/src/acr/browser/lightning/Reading/MapEntry.java index 31e7c36..6cf24a9 100644 --- a/src/acr/browser/lightning/Reading/MapEntry.java +++ b/src/acr/browser/lightning/Reading/MapEntry.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package acr.browser.lightning.Reading; +package acr.browser.lightning.reading; import java.io.Serializable; import java.util.Map; @@ -65,9 +65,8 @@ public class MapEntry implements Map.Entry, Serializable { final MapEntry other = (MapEntry) obj; if (this.key != other.key && (this.key == null || !this.key.equals(other.key))) return false; - if (this.value != other.value && (this.value == null || !this.value.equals(other.value))) - return false; - return true; + return !(this.value != other.value && (this.value == null || !this.value + .equals(other.value))); } @Override diff --git a/src/acr/browser/lightning/Reading/OutputFormatter.java b/src/acr/browser/lightning/Reading/OutputFormatter.java index c456b1a..2afd0a9 100644 --- a/src/acr/browser/lightning/Reading/OutputFormatter.java +++ b/src/acr/browser/lightning/Reading/OutputFormatter.java @@ -1,4 +1,4 @@ -package acr.browser.lightning.Reading; +package acr.browser.lightning.reading; import org.jsoup.Jsoup; import org.jsoup.nodes.Element; @@ -118,14 +118,13 @@ public class OutputFormatter { } boolean unlikely(Node e) { - if (e.attr("class") != null && e.attr("class").toLowerCase(Locale.getDefault()).contains("caption")) + if (e.attr("class") != null + && e.attr("class").toLowerCase(Locale.getDefault()).contains("caption")) return true; String style = e.attr("style"); String clazz = e.attr("class"); - if (unlikelyPattern.matcher(style).find() || unlikelyPattern.matcher(clazz).find()) - return true; - return false; + return unlikelyPattern.matcher(style).find() || unlikelyPattern.matcher(clazz).find(); } void appendTextSkipHidden(Element e, StringBuilder accum) { @@ -148,9 +147,7 @@ public class OutputFormatter { } boolean lastCharIsWhitespace(StringBuilder accum) { - if (accum.length() == 0) - return false; - return Character.isWhitespace(accum.charAt(accum.length() - 1)); + return (accum.length() != 0) && Character.isWhitespace(accum.charAt(accum.length() - 1)); } protected String node2TextOld(Element el) { diff --git a/src/acr/browser/lightning/Reading/SCache.java b/src/acr/browser/lightning/Reading/SCache.java index ace929c..36753d4 100644 --- a/src/acr/browser/lightning/Reading/SCache.java +++ b/src/acr/browser/lightning/Reading/SCache.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package acr.browser.lightning.Reading; +package acr.browser.lightning.reading; /** * diff --git a/src/acr/browser/lightning/Reading/SHelper.java b/src/acr/browser/lightning/Reading/SHelper.java index ab58c5f..7be2ec9 100644 --- a/src/acr/browser/lightning/Reading/SHelper.java +++ b/src/acr/browser/lightning/Reading/SHelper.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package acr.browser.lightning.Reading; +package acr.browser.lightning.reading; import java.io.UnsupportedEncodingException; import java.net.CookieHandler; diff --git a/src/acr/browser/lightning/ReadingActivity.java b/src/acr/browser/lightning/ReadingActivity.java index ada7513..0ac5340 100644 --- a/src/acr/browser/lightning/ReadingActivity.java +++ b/src/acr/browser/lightning/ReadingActivity.java @@ -3,8 +3,8 @@ package acr.browser.lightning; import java.util.ArrayList; import java.util.List; -import acr.browser.lightning.Reading.HtmlFetcher; -import acr.browser.lightning.Reading.JResult; +import acr.browser.lightning.reading.HtmlFetcher; +import acr.browser.lightning.reading.JResult; import android.animation.ObjectAnimator; import android.app.ProgressDialog; import android.content.Context; @@ -111,7 +111,7 @@ public class ReadingActivity extends ActionBarActivity { } else { StringBuilder builder = new StringBuilder(); for (String text : mBodyText) { - builder.append(text + "\n\n"); + builder.append(text).append("\n\n"); } setText(mTitleText, builder.toString()); }