From 48a1e8f74c43474f72fe8a279177c10edf222843 Mon Sep 17 00:00:00 2001 From: Mohamed Ezzat Date: Tue, 17 May 2016 21:49:13 +0200 Subject: [PATCH] pmd:UseIndexOfChar - Use Index Of Char (#300) --- .../tachiyomi/data/source/online/english/Batoto.java | 8 ++++---- .../tachiyomi/data/source/online/russian/Mangachan.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Batoto.java b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Batoto.java index ae094dacfb..bf7ac21a36 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Batoto.java +++ b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Batoto.java @@ -106,21 +106,21 @@ public class Batoto extends LoginSource { @Override protected Request mangaDetailsRequest(String mangaUrl) { - String mangaId = mangaUrl.substring(mangaUrl.lastIndexOf("r") + 1); + String mangaId = mangaUrl.substring(mangaUrl.lastIndexOf('r') + 1); return ReqKt.get(String.format(MANGA_URL, mangaId), getRequestHeaders()); } @Override protected Request pageListRequest(String pageUrl) { - String id = pageUrl.substring(pageUrl.indexOf("#") + 1); + String id = pageUrl.substring(pageUrl.indexOf('#') + 1); return ReqKt.get(String.format(CHAPTER_URL, id), getRequestHeaders()); } @Override protected Request imageUrlRequest(Page page) { String pageUrl = page.getUrl(); - int start = pageUrl.indexOf("#") + 1; - int end = pageUrl.indexOf("_", start); + int start = pageUrl.indexOf('#') + 1; + int end = pageUrl.indexOf('_', start); String id = pageUrl.substring(start, end); return ReqKt.get(String.format(PAGE_URL, id, pageUrl.substring(end+1)), getRequestHeaders()); } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/russian/Mangachan.java b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/russian/Mangachan.java index 015d90361e..4fa8c8c96c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/russian/Mangachan.java +++ b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/russian/Mangachan.java @@ -204,7 +204,7 @@ public class Mangachan extends Source { ArrayList pages = new ArrayList<>(); int beginIndex = unparsedHtml.indexOf("fullimg\":["); - int endIndex = unparsedHtml.indexOf("]", beginIndex); + int endIndex = unparsedHtml.indexOf(']', beginIndex); String trimmedHtml = unparsedHtml.substring(beginIndex + 10, endIndex); trimmedHtml = trimmedHtml.replaceAll("\"", ""); @@ -220,7 +220,7 @@ public class Mangachan extends Source { @Override protected List parseFirstPage(List pages, String unparsedHtml) { int beginIndex = unparsedHtml.indexOf("fullimg\":["); - int endIndex = unparsedHtml.indexOf("]", beginIndex); + int endIndex = unparsedHtml.indexOf(']', beginIndex); String trimmedHtml = unparsedHtml.substring(beginIndex + 10, endIndex); trimmedHtml = trimmedHtml.replaceAll("\"", "");