-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KTOR-7846 Fix running tests against JDK 8 #4502
Conversation
0cf9e9c
to
d146768
Compare
* On Java 8 PropertyResourceBundle requires properties to be encoded in ISO-8859-1, | ||
* while starting from Java 9 the default encoding is UTF-8. | ||
*/ | ||
private fun String.fixJava8Encoding(): String = this.toByteArray(Charsets.ISO_8859_1).toString(Charsets.UTF_8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this "fix" be applied inside i18n
implementation? Or we assume that users know that bundles should be in a different encoding on Java 8?
d146768
to
3537e41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
// so we have to check the path is not empty to not get an `ArrayIndexOutOfBoundsException` | ||
if (this.nameCount == 0) return normalized | ||
|
||
return this.resolve(normalized) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like we can drop this
* while starting from Java 9 the default encoding is UTF-8. | ||
*/ | ||
private fun String.fixJava8Encoding(): String { | ||
return if (System.getProperty("java.version").startsWith("1.8")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please consider extracting to the top level field
3537e41
to
dc57d34
Compare
dc57d34
to
67b7968
Compare
Subsystem
Test Infrastructure
Motivation
KTOR-7846 Fix running tests against Java 8 on CI
Solution
Fix problems making tests incompatible with Java 8 and remove
testJdk.coerceAtLeast(11)
from tests toolchain configuration.It is better to review commit-by-commit