Replaced deprecated methods

This commit is contained in:
dankito 2024-08-24 17:33:00 +02:00
parent 5d7ea48a46
commit 34e40aeee1
5 changed files with 11 additions and 9 deletions

View File

@ -184,7 +184,7 @@ open class ModelMapper(
val methodName = parameters.methodName
// we filter out iTAN and Einschritt-Verfahren as they are not permitted anymore according to PSD2
if (methodName.toLowerCase() == "itan") {
if (methodName.lowercase() == "itan") {
return null
}
@ -196,7 +196,7 @@ open class ModelMapper(
}
protected open fun mapToTanMethodType(parameters: TanMethodParameters): TanMethodType? {
val name = parameters.methodName.toLowerCase()
val name = parameters.methodName.lowercase()
return when {
// names are like 'chipTAN (comfort) manuell', 'Smart(-)TAN plus (manuell)' and
@ -254,7 +254,7 @@ open class ModelMapper(
protected open fun tanMethodNameContains(name: String, vararg namesToTest: String): Boolean {
namesToTest.forEach { nameToTest ->
if (name.contains(nameToTest.toLowerCase())) {
if (name.contains(nameToTest.lowercase())) {
return true
}
}

View File

@ -1,3 +1,5 @@
@file:Suppress("UNCHECKED_CAST")
package net.codinux.banking.fints.response
import net.codinux.banking.fints.messages.MessageBuilderResult

View File

@ -498,7 +498,7 @@ open class ResponseParser(
}
try {
val lowerCaseMayDkTanMethod = mayDkTanMethod.toLowerCase()
val lowerCaseMayDkTanMethod = mayDkTanMethod.lowercase()
if (lowerCaseMayDkTanMethod == "mobiletan" || lowerCaseMayDkTanMethod == "mtan") {
return DkTanMethod.mobileTAN

View File

@ -84,7 +84,7 @@ open class FlickerCodeDecoder {
}
if (encoding == FlickerCodeEncoding.ASCII) {
data = data.map { toHex(it.toInt(), 2) }.joinToString("")
data = data.map { toHex(it.code, 2) }.joinToString("")
}
if (encoding == FlickerCodeEncoding.BCD && data.length % 2 != 0) {
@ -193,7 +193,7 @@ open class FlickerCodeDecoder {
protected open fun toHex(number: Int, minLength: Int): String {
var result = number.toString (16).toUpperCase()
var result = number.toString (16).uppercase()
while (result.length < minLength) {
result = '0' + result

View File

@ -37,9 +37,9 @@ open class Base64 {
(string.indices step 3).forEach { index ->
val number: Int =
(0xFF.and(string[index ].toInt()) shl 16) +
(0xFF.and(string[index + 1].toInt()) shl 8) +
0xFF.and(string[index + 2].toInt())
(0xFF.and(string[index ].code) shl 16) +
(0xFF.and(string[index + 1].code) shl 8) +
0xFF.and(string[index + 2].code)
encoded.append(Base64Chars[(number shr 18) and 0x3F])
encoded.append(Base64Chars[(number shr 12) and 0x3F])