Skip to content

Commit

Permalink
Merge pull request #938 from SergKhram/feature/resolved-some-style-is…
Browse files Browse the repository at this point in the history
…sues

Resolved some build warnings
  • Loading branch information
Malinskiy authored May 24, 2024
2 parents fbb4958 + 2eca788 commit 8af0974
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ enum class RecorderType {
@JsonCreator
fun fromString(key: String?): RecorderType? {
return key?.let {
RecorderType.valueOf(it.toUpperCase())
RecorderType.valueOf(it.uppercase())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineExceptionHandler
import mu.KLogger

fun newCoroutineExceptionHandler(logger: KLogger) = CoroutineExceptionHandler { context, exception ->
fun newCoroutineExceptionHandler(logger: KLogger) = CoroutineExceptionHandler { _, exception ->
when (exception) {
null -> logger.debug { "CoroutineContext finished" }
is CancellationException -> logger.debug(exception) { "CoroutineContext cancelled" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ abstract class BaseAndroidDevice(
override var manufacturer: String = "Unknown"
override var deviceFeatures: Collection<DeviceFeature> = emptyList()
override var apiLevel: Int = version.apiLevel
override var operatingSystem: OperatingSystem = OperatingSystem(version.apiString)
override var operatingSystem: OperatingSystem = OperatingSystem(version.apiStringWithoutExtension)
override var initialRotation: Rotation = Rotation.ROTATION_0
var realSerialNumber: String = "Unknown"
var booted: Boolean = false
Expand Down Expand Up @@ -92,7 +92,7 @@ abstract class BaseAndroidDevice(
AndroidVersion(sdk.toInt(), codename)
} else AndroidVersion.DEFAULT
apiLevel = version.apiLevel
operatingSystem = OperatingSystem(version.apiString)
operatingSystem = OperatingSystem(version.apiStringWithoutExtension)
model = getProperty("ro.product.model") ?: "Unknown"
manufacturer = getProperty("ro.product.manufacturer") ?: "Unknown"
initialRotation = fetchRotation()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ open class AppleApplicationInstaller<in T : AppleDevice>(
val bundle = AppleTestBundle(app, testApp, xctest, device.sdk)
val relativeTestBinaryPath = bundle.relativeBinaryPath
val testBinary = bundle.testBinary
var remoteXctest = ""
val remoteXctest: String

if (testApp != null) {
logger.debug { "Moving xctest runner application to ${device.serialNumber}" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ class RemoteFileManager(private val device: AppleDevice) {
private suspend fun safeExecuteCommand(command: List<String>) {
try {
device.executeWorkerCommand(command)
} catch (e: Exception) {
null
}
} catch (_: Exception) {}
}

private suspend fun executeCommand(command: List<String>, errorMessage: String): String? {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.malinskiy.marathon.apple.plist

import com.dd.plist.BinaryPropertyListWriter
import com.dd.plist.NSObject
import com.dd.plist.PropertyListParser
import com.dd.plist.XMLPropertyListWriter
import java.io.File
import java.io.InputStream
import java.io.OutputStream
Expand All @@ -20,22 +22,20 @@ abstract class PropertyList<T: NSObject>(val delegate: T) {
}
}



fun saveAsBinary(file: File) {
PropertyListParser.saveAsBinary(delegate, file)
BinaryPropertyListWriter.write(delegate, file)
}

fun saveAsBinary(outputStream: OutputStream) {
PropertyListParser.saveAsBinary(delegate, outputStream)
BinaryPropertyListWriter.write(delegate, outputStream)
}

fun saveAsXML(file: File) {
PropertyListParser.saveAsXML(delegate, file)
XMLPropertyListWriter.write(delegate, file)
}

fun saveAsXML(outputStream: OutputStream) {
PropertyListParser.saveAsXML(delegate, outputStream)
XMLPropertyListWriter.write(delegate, outputStream)
}

override fun equals(other: Any?): Boolean {
Expand Down

0 comments on commit 8af0974

Please sign in to comment.