Commit fc6cf159 authored by Ricki Hirner's avatar Ricki Hirner

Update Kotlin, gradle; move lambda expressions out of parentheses

parent 1ee63a75
Pipeline #24015908 passed with stages
in 8 minutes and 20 seconds
buildscript {
ext.kotlin_version = '1.2.41'
ext.kotlin_version = '1.2.50'
ext.dokka_version = '0.9.16'
repositories {
......@@ -25,7 +25,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.dokka-android'
ext {
okhttp_version = "3.10.0"
okhttp_version = '3.10.0'
}
android {
......
......@@ -11,4 +11,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip
......@@ -30,9 +30,9 @@ data class CurrentUserPrincipal(
override fun create(parser: XmlPullParser): CurrentUserPrincipal {
// <!ELEMENT current-user-principal (unauthenticated | href)>
var href: String? = null
XmlUtils.processTag(parser, XmlUtils.NS_WEBDAV, "href", {
XmlUtils.processTag(parser, XmlUtils.NS_WEBDAV, "href") {
href = XmlUtils.readText(parser)
})
}
return CurrentUserPrincipal(href)
}
......
......@@ -32,7 +32,7 @@ data class CurrentUserPrivilegeSet(
// <!ELEMENT privilege ANY>
val privs = CurrentUserPrivilegeSet(false, false)
XmlUtils.processTag(parser, XmlUtils.NS_WEBDAV, "privilege", {
XmlUtils.processTag(parser, XmlUtils.NS_WEBDAV, "privilege") {
val depth = parser.depth
var eventType = parser.eventType
while (!(eventType == XmlPullParser.END_TAG && parser.depth == depth)) {
......@@ -49,7 +49,7 @@ data class CurrentUserPrivilegeSet(
}
eventType = parser.next()
}
})
}
return privs
}
......
......@@ -36,13 +36,13 @@ class SupportedAddressData: Property {
val supported = SupportedAddressData()
try {
XmlUtils.processTag(parser, XmlUtils.NS_CARDDAV, "address-data-type", {
XmlUtils.processTag(parser, XmlUtils.NS_CARDDAV, "address-data-type") {
parser.getAttributeValue(null, "content-type")?.let { contentType ->
var type = contentType
parser.getAttributeValue(null, "version")?.let { version -> type += "; version=$version" }
MediaType.parse(type)?.let { supported.types.add(it) }
}
})
}
} catch(e: XmlPullParserException) {
Constants.log.log(Level.SEVERE, "Couldn't parse <resourcetype>", e)
return null
......
......@@ -36,7 +36,7 @@ class SupportedReportSet: Property {
*/
val supported = SupportedReportSet()
XmlUtils.processTag(parser, XmlUtils.NS_WEBDAV, "supported-report", {
XmlUtils.processTag(parser, XmlUtils.NS_WEBDAV, "supported-report") {
XmlUtils.processTag(parser, XmlUtils.NS_WEBDAV, "report") {
parser.nextTag()
if (parser.eventType == XmlPullParser.TEXT)
......@@ -44,7 +44,7 @@ class SupportedReportSet: Property {
else if (parser.eventType == XmlPullParser.START_TAG)
supported.reports += "${parser.namespace}${parser.name}"
}
})
}
return supported
}
......
......@@ -21,9 +21,9 @@ class XmlUtilsTest {
// now on START_DOCUMENT [0]
var processed = false
XmlUtils.processTag(parser, "", "test", {
XmlUtils.processTag(parser, "", "test") {
processed = true
})
}
assertTrue(processed)
}
......@@ -34,9 +34,9 @@ class XmlUtilsTest {
parser.next() // now on START_TAG <root>
var processed = false
XmlUtils.processTag(parser, "", "test", {
XmlUtils.processTag(parser, "", "test") {
processed = true
})
}
assertTrue(processed)
}
......
......@@ -47,7 +47,7 @@ class DavExceptionTest {
val dav = DavResource(httpClient, url)
val builder = StringBuilder()
builder.append(CharArray(DavException.MAX_EXCERPT_SIZE-1, { '*' }))
builder.append(CharArray(DavException.MAX_EXCERPT_SIZE-1) { '*' })
builder.append("\u03C0") // Pi
val body = builder.toString()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment