Merge pull request #235 from DevFactory/release/utility-classes-should-not-have-public-constructors-fix-1

Code quality fix - Utility classes should not have public constructors.
This commit is contained in:
Christian Schabesberger 2016-03-11 14:12:45 +01:00
commit 8259872e2d
6 changed files with 21 additions and 0 deletions

View File

@ -34,6 +34,9 @@ import java.util.Locale;
public class Localization {
private Localization() {
}
public static Locale getPreferredLocale(Context context) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);

View File

@ -33,6 +33,10 @@ import java.io.File;
* Helper for global settings
*/
public class NewPipeSettings {
private NewPipeSettings() {
}
public static void initSettings(Context context) {
PreferenceManager.setDefaultValues(context, R.xml.settings, false);
getVideoDownloadFolder(context);

View File

@ -31,6 +31,9 @@ import java.util.Vector;
public class DashMpdParser {
private DashMpdParser() {
}
static class DashMpdParsingException extends ParsingException {
DashMpdParsingException(String message, Exception e) {
super(message, e);

View File

@ -32,6 +32,9 @@ import java.util.regex.Pattern;
/** avoid using regex !!! */
public class Parser {
private Parser() {
}
public static class RegexException extends ParsingException {
public RegexException(String message) {
super(message);

View File

@ -29,6 +29,10 @@ import org.schabi.newpipe.extractor.services.youtube.YoutubeService;
@SuppressWarnings("ALL")
public class ServiceList {
private ServiceList() {
}
private static final String TAG = ServiceList.class.toString();
private static final StreamingService[] services = {
new YoutubeService(0)

View File

@ -23,6 +23,10 @@ import org.schabi.newpipe.extractor.ParsingException;
*/
public class YoutubeParsingHelper {
private YoutubeParsingHelper() {
}
public static int parseDurationString(String input)
throws ParsingException, NumberFormatException {
String[] splitInput = input.split(":");