Skip to content

Commit 5ec4439

Browse files
committed
Build: Update kotlin to 1.6.10
This update is necessary because otherwise, with newer versions of Java (see Java 17), this project cannot be compiled due to the fact that with JDK17 it is no longer possible to make a field accessible using reflection. It seems that Kotlin 1.4.20 is doing it, rightfully so, as that point of time this 1.4.20 version of Kotlin wasn't ready for Java 17. FYI: The code fails to compile with the below exception: ------------------------------------------------------------------------ > Task :aztec:compileDebugKotlin FAILED Could not perform incremental compilation: Could not connect to Kotlin compile daemon Could not connect to kotlin daemon. Using fallback strategy. exception: java.lang.ExceptionInInitializerError at org.jetbrains.kotlin.com.intellij.pom.java.LanguageLevel. <clinit>(LanguageLevel.java:25) ... Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.util.ResourceBundle.setParent (java.util.ResourceBundle) accessible: module java.base does not "opens java.util" to unnamed module @41e77c24 at java.base/java.lang.reflect.AccessibleObject. checkCanSetAccessible(AccessibleObject.java:354) ... ... 19 more ------------------------------------------------------------------------ Also, as part of this update the 'max/mindBy' were replaced by 'max/mindByOrNull', but other than that everything else remained the same.
1 parent ba86630 commit 5ec4439

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/spans/IAztecNestable.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface IAztecNestable {
1212
fun getNestingLevelAt(spanned: Spanned, index: Int, nextIndex: Int = index): Int {
1313
return spanned.getSpans(index, nextIndex, IAztecNestable::class.java)
1414
.filter { spanned.getSpanEnd(it) != index || index == 0 || spanned[index - 1] != Constants.NEWLINE }
15-
.maxBy { it.nestingLevel }?.nestingLevel ?: 0
15+
.maxByOrNull { it.nestingLevel }?.nestingLevel ?: 0
1616
}
1717

1818
fun getMinNestingLevelAt(spanned: Spanned, index: Int, nextIndex: Int = index): Int {
@@ -21,7 +21,7 @@ interface IAztecNestable {
2121
.filter { spanned.getSpanStart(it) <= index && spanned.getSpanEnd(it) >= nextIndex &&
2222
(spanned.getSpanStart(it) != index || spanned.getSpanEnd(it) != nextIndex) }
2323
.filter { index != nextIndex || spanned.getSpanStart(it) != index && spanned.getSpanEnd(it) != index }
24-
.minBy { it.nestingLevel }?.nestingLevel ?: 0
24+
.minByOrNull { it.nestingLevel }?.nestingLevel ?: 0
2525
}
2626

2727
fun pushDeeper(spannable: Spannable, start: Int, end: Int, fromLevel: Int = 0, pushBy: Int = 1): List<SpanWrapper<IAztecNestable>> {

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pluginManagement {
2-
gradle.ext.kotlinVersion = '1.4.20'
2+
gradle.ext.kotlinVersion = '1.6.10'
33
gradle.ext.agpVersion = '7.2.1'
44

55
plugins {

0 commit comments

Comments
 (0)