Fix invalid contruction of exception message

clang-tidy reported following problem:

zxing/zxing/oned/rss/expanded/decoders/GeneralAppIdDecoder.cpp:397:77: warning: adding 'int' to a string does not append to the string [clang-diagnostic-string-plus-int]
        throw IllegalStateException("Decoding invalid alphanumeric value: " + sixBitValue);
                                                                            ^
zxing/zxing/oned/rss/expanded/decoders/GeneralAppIdDecoder.cpp:397:77: note: use array indexing to silence this warning
        throw IllegalStateException("Decoding invalid alphanumeric value: " + sixBitValue);
                                                                            ^
                                    &                                       [            ]
This commit is contained in:
Dmitry Gerasimov 2020-02-14 15:24:03 +03:00
parent ee50acba1f
commit 2356e5b3e5
1 changed files with 4 additions and 1 deletions

View File

@ -394,7 +394,10 @@ DecodedChar GeneralAppIdDecoder::decodeAlphanumeric(int pos)
c = '/';
break;
default:
throw IllegalStateException("Decoding invalid alphanumeric value: " + sixBitValue);
{
auto msg = "Decoding invalid alphanumeric value: " + std::to_string(sixBitValue);
throw IllegalStateException(msg.c_str());
}
}
return DecodedChar(pos + 6, c);
}