Thu, 29 Dec 2022 15:04:21 +0100
some minor style fixes
--- a/src/main/kotlin/de/uapcore/lightpit/HttpMethod.kt Thu Dec 29 14:53:05 2022 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* - * Copyright 2021 Mike Becker. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package de.uapcore.lightpit - -enum class HttpMethod { - GET, POST, PUT, DELETE, TRACE, HEAD, OPTIONS -}
--- a/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt Thu Dec 29 14:53:05 2022 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt Thu Dec 29 15:04:21 2022 +0100 @@ -193,7 +193,7 @@ render() } - fun i18n(key: String) = ResourceBundle.getBundle("localization/strings", response.locale).getString(key) + fun i18n(key: String): String = ResourceBundle.getBundle("localization/strings", response.locale).getString(key) } /**
--- a/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt Thu Dec 29 14:53:05 2022 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt Thu Dec 29 15:04:21 2022 +0100 @@ -215,9 +215,9 @@ setStringSafe(2, node) setInt(3, ordinal) setEnum(4, status) - setInt(5, version.projectid) - setDateOrNull(6, version.release) - setDateOrNull(7, version.eol) + setInt(5, projectid) + setDateOrNull(6, release) + setDateOrNull(7, eol) } executeUpdate() }
--- a/src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt Thu Dec 29 14:53:05 2022 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt Thu Dec 29 15:04:21 2022 +0100 @@ -48,7 +48,7 @@ get("/%project/issues.rss", this::issues) } - val diffGenerator by lazyOf(DiffRowGenerator.create() + private val diffGenerator: DiffRowGenerator by lazyOf(DiffRowGenerator.create() .showInlineDiffs(true) .mergeOriginalRevised(true) .inlineDiffByWord(true)
--- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/Feeds.kt Thu Dec 29 14:53:05 2022 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/Feeds.kt Thu Dec 29 15:04:21 2022 +0100 @@ -63,5 +63,5 @@ val entries: List<IssueFeedEntry> ) : View() { val lastModified: Timestamp = - entries.map(IssueFeedEntry::time).maxOrNull() ?: Timestamp.from(Instant.now()) + entries.maxOfOrNull(IssueFeedEntry::time) ?: Timestamp.from(Instant.now()) } \ No newline at end of file
--- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt Thu Dec 29 14:53:05 2022 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt Thu Dec 29 15:04:21 2022 +0100 @@ -47,7 +47,7 @@ override fun compare(left: Issue, right: Issue): Int { if (left == right) { - return 0; + return 0 } for (c in criteria) { val result = when (c.field) {