Bug 1411654 - Part 5b: Work through WrongConstant lint issues. r=mcomella

MozReview-Commit-ID: 6zJ7EMu9rgO

--HG--
extra : rebase_source : d3a228caa4c21ce17184302559f3a8e233fb00b7
extra : source : c5bf85d56fedf600363dda3b077fdf950ba60688
This commit is contained in:
Nick Alexander 2017-11-14 15:36:49 -08:00
Родитель 6ee03c9306
Коммит c4499269d8
5 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -38,7 +38,6 @@
<issue id="ResourceAsColor" severity="warning" />
<issue id="ResourceType" severity="warning" />
<issue id="ValidFragment" severity="warning" />
<issue id="WrongConstant" severity="warning" />
<!-- New Android-Gradle lint integration regressed this check. -->
<issue id="MissingRegistered" severity="warning" />

Просмотреть файл

@ -5,6 +5,7 @@
package org.mozilla.gecko.activitystream;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
@ -216,8 +217,7 @@ public class ActivityStreamTelemetry {
break;
// While we also have a "blank" type, it is not used by Activity Stream.
case BrowserContract.TopSites.TYPE_BLANK:
default:
throw new IllegalStateException("Unknown top site type: " + topSite.getType());
throw new IllegalStateException("Unknown top site type :" + (int) topSite.getType());
}
return this;

Просмотреть файл

@ -5,6 +5,7 @@
package org.mozilla.gecko.dlc;
import android.annotation.SuppressLint;
import android.content.Context;
import android.support.annotation.IntDef;
import android.util.Log;
@ -100,7 +101,7 @@ public abstract class BaseAction {
} else if (content.isHyphenationDictionary()) {
destinationDirectory = new File(context.getApplicationInfo().dataDir, "hyphenation");
} else {
throw new UnrecoverableDownloadContentException("Can't determine destination for kind: " + content.getKind());
throw new UnrecoverableDownloadContentException("Can't determine destination for kind: " + (String) content.getKind());
}
if (!destinationDirectory.exists() && !destinationDirectory.mkdirs()) {

Просмотреть файл

@ -5,6 +5,7 @@
package org.mozilla.gecko.dlc;
import android.annotation.SuppressLint;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
@ -106,7 +107,7 @@ public class DownloadAction extends BaseAction {
}
if (!content.isAssetArchive()) {
Log.e(LOGTAG, "Downloaded content is not of type 'asset-archive': " + content.getType());
Log.e(LOGTAG, "Downloaded content is not of type 'asset-archive': " + (String) content.getType());
temporaryFile.delete();
DownloadContentTelemetry.eventDownloadFailure(content, DownloadContentTelemetry.ERROR_LOGIC);
continue;

Просмотреть файл

@ -1160,7 +1160,7 @@ gbjar.extra_jars += [CONFIG['ANDROID_DESIGN_AAR_LIB']]
gbjar.extra_jars += [CONFIG['ANDROID_RECYCLERVIEW_V7_AAR_LIB']]
gbjar.extra_jars += [CONFIG['ANDROID_CUSTOMTABS_AAR_LIB']]
gbjar.javac_flags += ['-Xlint:all,-deprecation,-fallthrough', '-J-Xmx512m', '-J-Xms128m']
gbjar.javac_flags += ['-Xlint:all,-deprecation,-fallthrough,-cast', '-J-Xmx512m', '-J-Xms128m']
# gecko-thirdparty is a good place to put small independent libraries
gtjar = add_java_jar('gecko-thirdparty')