some minor style fixes

Thu, 29 Dec 2022 15:04:21 +0100

author
Mike Becker <universe@uap-core.de>
date
Thu, 29 Dec 2022 15:04:21 +0100
changeset 260
fb2ae2d63a56
parent 259
30ec2cf1e495
child 261
1467d182cfe3

some minor style fixes

src/main/kotlin/de/uapcore/lightpit/HttpMethod.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/viewmodel/Feeds.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt file | annotate | diff | comparison | revisions
     1.1 --- a/src/main/kotlin/de/uapcore/lightpit/HttpMethod.kt	Thu Dec 29 14:53:05 2022 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,30 +0,0 @@
     1.4 -/*
     1.5 - * Copyright 2021 Mike Becker. All rights reserved.
     1.6 - *
     1.7 - * Redistribution and use in source and binary forms, with or without
     1.8 - * modification, are permitted provided that the following conditions are met:
     1.9 - *
    1.10 - * 1. Redistributions of source code must retain the above copyright
    1.11 - * notice, this list of conditions and the following disclaimer.
    1.12 - *
    1.13 - * 2. Redistributions in binary form must reproduce the above copyright
    1.14 - * notice, this list of conditions and the following disclaimer in the
    1.15 - * documentation and/or other materials provided with the distribution.
    1.16 - *
    1.17 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    1.18 - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1.19 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    1.20 - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    1.21 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    1.22 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    1.23 - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    1.24 - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.25 - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    1.26 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.27 - */
    1.28 -
    1.29 -package de.uapcore.lightpit
    1.30 -
    1.31 -enum class HttpMethod {
    1.32 -    GET, POST, PUT, DELETE, TRACE, HEAD, OPTIONS
    1.33 -}
     2.1 --- a/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt	Thu Dec 29 14:53:05 2022 +0100
     2.2 +++ b/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt	Thu Dec 29 15:04:21 2022 +0100
     2.3 @@ -193,7 +193,7 @@
     2.4          render()
     2.5      }
     2.6  
     2.7 -    fun i18n(key: String) = ResourceBundle.getBundle("localization/strings", response.locale).getString(key)
     2.8 +    fun i18n(key: String): String = ResourceBundle.getBundle("localization/strings", response.locale).getString(key)
     2.9  }
    2.10  
    2.11  /**
     3.1 --- a/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt	Thu Dec 29 14:53:05 2022 +0100
     3.2 +++ b/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt	Thu Dec 29 15:04:21 2022 +0100
     3.3 @@ -215,9 +215,9 @@
     3.4                  setStringSafe(2, node)
     3.5                  setInt(3, ordinal)
     3.6                  setEnum(4, status)
     3.7 -                setInt(5, version.projectid)
     3.8 -                setDateOrNull(6, version.release)
     3.9 -                setDateOrNull(7, version.eol)
    3.10 +                setInt(5, projectid)
    3.11 +                setDateOrNull(6, release)
    3.12 +                setDateOrNull(7, eol)
    3.13              }
    3.14              executeUpdate()
    3.15          }
     4.1 --- a/src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt	Thu Dec 29 14:53:05 2022 +0100
     4.2 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt	Thu Dec 29 15:04:21 2022 +0100
     4.3 @@ -48,7 +48,7 @@
     4.4          get("/%project/issues.rss", this::issues)
     4.5      }
     4.6  
     4.7 -    val diffGenerator by lazyOf(DiffRowGenerator.create()
     4.8 +    private val diffGenerator: DiffRowGenerator by lazyOf(DiffRowGenerator.create()
     4.9          .showInlineDiffs(true)
    4.10          .mergeOriginalRevised(true)
    4.11          .inlineDiffByWord(true)
     5.1 --- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/Feeds.kt	Thu Dec 29 14:53:05 2022 +0100
     5.2 +++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/Feeds.kt	Thu Dec 29 15:04:21 2022 +0100
     5.3 @@ -63,5 +63,5 @@
     5.4      val entries: List<IssueFeedEntry>
     5.5  ) : View() {
     5.6      val lastModified: Timestamp =
     5.7 -        entries.map(IssueFeedEntry::time).maxOrNull() ?: Timestamp.from(Instant.now())
     5.8 +        entries.maxOfOrNull(IssueFeedEntry::time) ?: Timestamp.from(Instant.now())
     5.9  }
    5.10 \ No newline at end of file
     6.1 --- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt	Thu Dec 29 14:53:05 2022 +0100
     6.2 +++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt	Thu Dec 29 15:04:21 2022 +0100
     6.3 @@ -47,7 +47,7 @@
     6.4  
     6.5      override fun compare(left: Issue, right: Issue): Int {
     6.6          if (left == right) {
     6.7 -            return 0;
     6.8 +            return 0
     6.9          }
    6.10          for (c in criteria) {
    6.11              val result = when (c.field) {

mercurial