Skip to content

Commit fa50562

Browse files
authored
Bump static code analyzes and fix its issues (getsentry/sentry-android#465)
1 parent 0f6b35f commit fa50562

27 files changed

Lines changed: 52 additions & 32 deletions

build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ plugins {
88
jacoco
99
}
1010

11-
configure<JavaPluginConvention> {
12-
sourceCompatibility = JavaVersion.VERSION_1_8
13-
targetCompatibility = JavaVersion.VERSION_1_8
14-
}
15-
1611
buildscript {
1712
repositories {
1813
google()

buildSrc/src/main/java/Config.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ object Config {
4747
object QualityPlugins {
4848
val jacocoVersion = "0.8.5"
4949
val spotless = "com.diffplug.gradle.spotless"
50-
val spotlessVersion = "3.27.0"
50+
val spotlessVersion = "4.4.0"
5151
val errorProne = "net.ltgt.errorprone"
52-
val errorpronePlugin = "net.ltgt.gradle:gradle-errorprone-plugin:1.1.1"
52+
val errorpronePlugin = "net.ltgt.gradle:gradle-errorprone-plugin:1.2.1"
5353
val gradleVersionsPlugin = "com.github.ben-manes:gradle-versions-plugin:0.28.0"
5454
val gradleVersions = "com.github.ben-manes.versions"
5555
}
@@ -80,7 +80,7 @@ object Config {
8080
val jetbrainsAnnotations = "org.jetbrains:annotations:19.0.0"
8181
val nopen = "com.jakewharton.nopen:nopen-annotations:$nopenVersion"
8282
val nopenChecker = "com.jakewharton.nopen:nopen-checker:$nopenVersion"
83-
val errorprone = "com.google.errorprone:error_prone_core:2.3.4"
83+
val errorprone = "com.google.errorprone:error_prone_core:2.4.0"
8484
val errorProneJavac8 = "com.google.errorprone:javac:9+181-r4173-1"
8585
}
8686

@@ -91,7 +91,7 @@ object Config {
9191
}
9292

9393
object NativePlugins {
94-
val nativeBundlePlugin = "com.ydq.android.gradle.build.tool:nativeBundle:1.0.4"
94+
val nativeBundlePlugin = "com.ydq.android.gradle.build.tool:nativeBundle:1.0.6"
9595
val nativeBundleExport = "com.ydq.android.gradle.native-aar.export"
9696
}
9797
}

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ android.defaults.buildfeatures.shaders=false
2020
# disable aidl files, it's enabled by default
2121
android.defaults.buildfeatures.aidl=false
2222

23+
# disable Resource Values generation
24+
android.defaults.buildfeatures.resvalues=false
25+
2326
# TODO: Enable Prefab https://android-developers.googleblog.com/2020/02/native-dependencies-in-android-studio-40.html
2427
# android.enablePrefab=true
2528
# android.prefabVersion=1.0.0

sentry-android-core/build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ android {
3333
}
3434
}
3535

36-
buildFeatures {
37-
// Determines whether to support injecting custom variables into the module's R class.
38-
resValues = false
39-
}
40-
4136
compileOptions {
4237
sourceCompatibility = JavaVersion.VERSION_1_8
4338
targetCompatibility = JavaVersion.VERSION_1_8

sentry-android-core/src/main/java/io/sentry/android/core/AndroidSerializer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Device.DeviceOrientation.class, new OrientationDeserializerAdapter(logger))
151151
*
152152
* @param event the SentryEvent
153153
* @param writer the Writer
154-
* @throws IOException
154+
* @throws IOException an IOException
155155
*/
156156
@Override
157157
public void serialize(final @NotNull SentryEvent event, final @NotNull Writer writer)
@@ -168,7 +168,7 @@ public void serialize(final @NotNull SentryEvent event, final @NotNull Writer wr
168168
*
169169
* @param session the Session
170170
* @param writer the Writer
171-
* @throws IOException
171+
* @throws IOException an IOException
172172
*/
173173
@Override
174174
public void serialize(final @NotNull Session session, final @NotNull Writer writer)
@@ -185,7 +185,7 @@ public void serialize(final @NotNull Session session, final @NotNull Writer writ
185185
*
186186
* @param envelope the SentryEnvelope
187187
* @param writer the Writer
188-
* @throws IOException
188+
* @throws IOException an IOException
189189
*/
190190
@Override
191191
public void serialize(final @NotNull SentryEnvelope envelope, final @NotNull Writer writer)

sentry-android-core/src/main/java/io/sentry/android/core/AppComponentsBreadcrumbsIntegration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public void close() throws IOException {
6464
// if its a ContextImpl, unregisterComponentCallbacks can't be used
6565
context.unregisterComponentCallbacks(this);
6666
} catch (Exception ignored) {
67+
// fine, might throw on older versions
6768
}
6869

6970
if (options != null) {

sentry-android-core/src/main/java/io/sentry/android/core/DefaultAndroidEventProcessor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ private TimeZone getTimeZone() {
412412
return Calendar.getInstance().getTimeZone();
413413
}
414414

415+
@SuppressWarnings("JdkObsolete")
415416
private @NotNull Date getBootTime() {
416417
// if user changes time, will give a wrong answer, consider ACTION_TIME_CHANGED
417418
return DateUtils.getDateTime(

sentry-android-core/src/main/java/io/sentry/android/core/util/RootChecker.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ private boolean checkRootPackages() {
163163
pm.getPackageInfo(pkg, 0);
164164
return true;
165165
} catch (PackageManager.NameNotFoundException ignored) {
166+
// fine, package doesn't exist.
166167
}
167168
}
168169
}

sentry-android-ndk/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ android {
4545
buildFeatures {
4646
// Determines whether to generate a BuildConfig class.
4747
buildConfig = false
48-
// Determines whether to support injecting custom variables into the module's R class.
49-
resValues = false
5048
}
5149

5250
externalNativeBuild {

sentry-android/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ android {
2727
buildFeatures {
2828
// Determines whether to generate a BuildConfig class.
2929
buildConfig = false
30-
// Determines whether to support injecting custom variables into the module's R class.
31-
resValues = false
3230
}
3331
}
3432

0 commit comments

Comments
 (0)