From 61c6cc834707414054c89c9aba5cf4a94748a83b Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 17 Sep 2020 12:33:03 +0200 Subject: [PATCH] pleasure the linter --- .../android/lib/resources/status/StatusRequester.kt | 4 ++-- .../java/com/owncloud/android/lib/StatusRequestorTest.kt | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt index 14af1cee..358ec608 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt @@ -48,8 +48,8 @@ internal class StatusRequester { fun updateLocationWithRedirectPath(oldLocation: String, redirectedLocation: String): String { if (!redirectedLocation.startsWith("/")) return redirectedLocation - val oldLocation = URL(oldLocation) - return URL(oldLocation.protocol, oldLocation.host, oldLocation.port, redirectedLocation).toString() + val oldLocationURL = URL(oldLocation) + return URL(oldLocationURL.protocol, oldLocationURL.host, oldLocationURL.port, redirectedLocation).toString() } private fun getGetMethod(url: String): GetMethod { diff --git a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt index 107b5238..15988187 100644 --- a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt +++ b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt @@ -33,7 +33,7 @@ class StatusRequestorTest { @Test fun `update location with an absolute path`() { - val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, "$TEST_DOMAIN/subdir") + val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, "$TEST_DOMAIN$SUB_PATH") assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) } @@ -46,9 +46,7 @@ class StatusRequestorTest { @Test fun `update location with a relative path`() { - val newLocation = requestor.updateLocationWithRedirectPath( - TEST_DOMAIN, SUB_PATH - ) + val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, SUB_PATH) assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) }