From 3e237ffb7d71dcafa2844277ba383656e101fc5f Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 12 May 2021 09:21:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 3 +++ .../java/io/legado/app/model/analyzeRule/QueryTTF.java | 7 ++++--- build.gradle | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 01b29ff29..29aa9966e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -97,6 +97,9 @@ android { jvmTarget = "1.8" } buildToolsVersion '30.0.3' + tasks.withType(JavaCompile) { + options.compilerArgs << "-Xlint:unchecked" + } } resourcePlaceholders { diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.java b/app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.java index 041a6539b..7fb875627 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.java +++ b/app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.java @@ -11,7 +11,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -@SuppressWarnings({"FieldCanBeLocal", "rawtypes", "StatementWithEmptyBody", "unused"}) +@SuppressWarnings({"FieldCanBeLocal", "StatementWithEmptyBody", "unused"}) public class QueryTTF { private static class Header { public int majorVersion; @@ -223,7 +223,8 @@ public class QueryTTF { private final List loca = new LinkedList<>(); private final CmapLayout Cmap = new CmapLayout(); private final List glyf = new LinkedList<>(); - private final Pair[] pps = new Pair[]{ + @SuppressWarnings("unchecked") + private final Pair[] pps = new Pair[]{ Pair.of(3, 10), Pair.of(0, 4), Pair.of(3, 1), @@ -515,7 +516,7 @@ public class QueryTTF { private int getGlyfIndex(int code) { if (code == 0) return 0; int fmtKey = 0; - for (@SuppressWarnings("unchecked") Pair item : pps) { + for (Pair item : pps) { for (CmapRecord record : Cmap.records) { if ((item.getLeft() == record.platformID) && (item.getRight() == record.encodingID)) { fmtKey = record.offset; diff --git a/build.gradle b/build.gradle index 33cfb14a1..e9650f9c8 100644 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:4.2.0' + //noinspection DifferentKotlinGradleVersion classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "de.timfreiheit.resourceplaceholders:placeholders:0.3" } @@ -19,7 +20,7 @@ buildscript { allprojects { repositories { google() - maven { url 'https://maven.aliyun.com/repository/public/'} + maven { url 'https://maven.aliyun.com/repository/public/' } maven { url "https://jitpack.io" } maven { url "https://maven.google.com/" } }