From 805f0466960e892e4c2761dc28f9332241fabf29 Mon Sep 17 00:00:00 2001 From: Faisal Hameed Date: Thu, 10 Mar 2016 14:41:12 +0500 Subject: [PATCH] Fixing squid:UselessParenthesesCheck - Useless parentheses around expressions should be removed to prevent any misunderstanding. --- .../services/youtube/YoutubeStreamExtractor.java | 8 ++++---- .../java/org/schabi/newpipe/player/BackgroundPlayer.java | 2 +- .../java/org/schabi/newpipe/player/PlayVideoActivity.java | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java index 8574b71b4..599a00141 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java @@ -564,9 +564,9 @@ public class YoutubeStreamExtractor extends StreamExtractor { } } - int seconds = (secondsString.isEmpty() ? 0 : Integer.parseInt(secondsString)); - int minutes = (minutesString.isEmpty() ? 0 : Integer.parseInt(minutesString)); - int hours = (hoursString.isEmpty() ? 0 : Integer.parseInt(hoursString)); + int seconds = secondsString.isEmpty() ? 0 : Integer.parseInt(secondsString); + int minutes = minutesString.isEmpty() ? 0 : Integer.parseInt(minutesString); + int hours = hoursString.isEmpty() ? 0 : Integer.parseInt(hoursString); //don't trust BODMAS! int ret = seconds + (60 * minutes) + (3600 * hours); @@ -794,7 +794,7 @@ public class YoutubeStreamExtractor extends StreamExtractor { } finally { Context.exit(); } - return (result == null ? "" : result.toString()); + return result == null ? "" : result.toString(); } private String findErrorReason(Document doc) { diff --git a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java index 21d3d6e0d..792a35704 100644 --- a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java @@ -157,7 +157,7 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare e.printStackTrace(); } - WifiManager wifiMgr = ((WifiManager)getSystemService(Context.WIFI_SERVICE)); + WifiManager wifiMgr = (WifiManager)getSystemService(Context.WIFI_SERVICE); wifiLock = wifiMgr.createWifiLock(WifiManager.WIFI_MODE_FULL, TAG); //listen for end of video diff --git a/app/src/main/java/org/schabi/newpipe/player/PlayVideoActivity.java b/app/src/main/java/org/schabi/newpipe/player/PlayVideoActivity.java index ad840302f..c00381d32 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PlayVideoActivity.java +++ b/app/src/main/java/org/schabi/newpipe/player/PlayVideoActivity.java @@ -327,7 +327,7 @@ public class PlayVideoActivity extends AppCompatActivity { int realHeight = realDisplayMetrics.heightPixels; int displayHeight = displayMetrics.heightPixels; - return (realHeight - displayHeight); + return realHeight - displayHeight; } else { return 50; } @@ -344,7 +344,7 @@ public class PlayVideoActivity extends AppCompatActivity { int realWidth = realDisplayMetrics.widthPixels; int displayWidth = displayMetrics.widthPixels; - return (realWidth - displayWidth); + return realWidth - displayWidth; } else { return 50; }