From e7a3816f5f3c301c979a38da4964b400507be2d2 Mon Sep 17 00:00:00 2001 From: mmobbu <145586759+mmobbu@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:00:22 -0500 Subject: [PATCH 1/2] Exception is removed from StartRecording file #11 Classes that throw exceptions in their constructors are vulnerable to finalizer attacks and thus the exception is removed from StartRecording file #11 --- .../java/de/dennisguse/opentracks/publicapi/StartRecording.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/dennisguse/opentracks/publicapi/StartRecording.java b/src/main/java/de/dennisguse/opentracks/publicapi/StartRecording.java index ff778a94a..4d90c83c6 100644 --- a/src/main/java/de/dennisguse/opentracks/publicapi/StartRecording.java +++ b/src/main/java/de/dennisguse/opentracks/publicapi/StartRecording.java @@ -12,7 +12,7 @@ import de.dennisguse.opentracks.util.IntentDashboardUtils; import de.dennisguse.opentracks.util.TrackUtils; -public class StartRecording extends AbstractAPIActivity { +public final class StartRecording extends AbstractAPIActivity { public static final String EXTRA_TRACK_NAME = "TRACK_NAME"; public static final String EXTRA_TRACK_ACTIVITY_TYPE_LOCALIZED = "TRACK_CATEGORY"; //TODO Update constant From 14fb731e45cd34c983fc368d0bdb28fd8cfc779c Mon Sep 17 00:00:00 2001 From: mmobbu <145586759+mmobbu@users.noreply.github.com> Date: Thu, 15 Feb 2024 20:24:47 -0500 Subject: [PATCH 2/2] Removed unused field #10 Removed unused field TAG from the file as it affects the performance --- .../java/de/dennisguse/opentracks/publicapi/StartRecording.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/dennisguse/opentracks/publicapi/StartRecording.java b/src/main/java/de/dennisguse/opentracks/publicapi/StartRecording.java index 4d90c83c6..ff9cc6c13 100644 --- a/src/main/java/de/dennisguse/opentracks/publicapi/StartRecording.java +++ b/src/main/java/de/dennisguse/opentracks/publicapi/StartRecording.java @@ -22,7 +22,7 @@ public final class StartRecording extends AbstractAPIActivity { public static final String EXTRA_STATS_TARGET_PACKAGE = "STATS_TARGET_PACKAGE"; public static final String EXTRA_STATS_TARGET_CLASS = "STATS_TARGET_CLASS"; - private static final String TAG = StartRecording.class.getSimpleName(); + protected void execute(TrackRecordingService service) { Track.Id trackId = service.startNewTrack();