From b56ac6da78ba0dbfd282114b5d998d1ccbf10da6 Mon Sep 17 00:00:00 2001 From: HarshvardhanR <123012249+HarshvardhanR@users.noreply.github.com> Date: Sat, 14 Oct 2023 20:27:27 -0400 Subject: [PATCH] Replaced the instanceOf check and cast with instanceof Id id --- .../opentracks/ui/markers/MarkerDetailActivity.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/dennisguse/opentracks/ui/markers/MarkerDetailActivity.java b/src/main/java/de/dennisguse/opentracks/ui/markers/MarkerDetailActivity.java index f504511ee..154ddffa3 100644 --- a/src/main/java/de/dennisguse/opentracks/ui/markers/MarkerDetailActivity.java +++ b/src/main/java/de/dennisguse/opentracks/ui/markers/MarkerDetailActivity.java @@ -60,10 +60,13 @@ protected void onCreate(Bundle bundle) { super.onCreate(bundle); Object bundleMarkerId = getIntent().getExtras().get(EXTRA_MARKER_ID); - Marker.Id markerId = (bundleMarkerId instanceof Marker.Id markerId) ? (Marker.Id) bundleMarkerId : null; + Id markerId = null; + if(bundleMarkerId instanceof Id){ + markerId = (Id) bundleMarkerId + } if (bundleMarkerId instanceof Long) { //Incoming Intent via Dashboard API. - markerId = new Marker.Id((Long) bundleMarkerId); + markerId = new Id((Long) bundleMarkerId); } if (markerId == null) { Log.d(TAG, "invalid marker id");