Skip to content

Commit 0533909

Browse files
committed
Suppress a few detekt warnings
1 parent 6ee6b13 commit 0533909

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/main/kotlin/org/mybatis/dynamic/sql/util/kotlin/KotlinBaseBuilders.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,18 @@ abstract class KotlinBaseBuilder<D : AbstractWhereSupport<*>> {
145145
or(existsPredicate, sc)
146146
}
147147

148+
/**
149+
* This function does nothing, but it can be used to make some code snippets more understandable.
150+
*
151+
* For example, to count all rows in a table you can write either of the following:
152+
*
153+
* val rows = countFrom(foo) { }
154+
*
155+
* or
156+
*
157+
* val rows = countFrom(foo) { allRows() }
158+
*/
159+
@SuppressWarnings("EmptyFunctionBlock")
148160
fun allRows() {}
149161

150162
private fun applyToWhere(block: AbstractWhereDSL<*>.() -> Unit) {

src/main/kotlin/org/mybatis/dynamic/sql/util/kotlin/elements/SqlTableExtensions.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 the original author or authors.
2+
* Copyright 2016-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ import kotlin.reflect.KClass
2727
* This function preserves the non-nullable column type which is lost with the Java
2828
* native versions.
2929
*/
30+
@SuppressWarnings("LongParameterList")
3031
fun <T : Any> SqlTable.column(
3132
name: String,
3233
jdbcType: JDBCType? = null,

src/main/kotlin/org/mybatis/dynamic/sql/util/kotlin/spring/NamedParameterJdbcTemplateExtensions.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 the original author or authors.
2+
* Copyright 2016-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -188,6 +188,7 @@ fun NamedParameterJdbcTemplate.selectOne(
188188
this
189189
)
190190

191+
@SuppressWarnings("SwallowedException")
191192
fun <T> NamedParameterJdbcTemplate.selectOne(
192193
selectStatement: SelectStatementProvider,
193194
rowMapper: (rs: ResultSet, rowNum: Int) -> T
@@ -197,6 +198,7 @@ fun <T> NamedParameterJdbcTemplate.selectOne(
197198
null
198199
}
199200

201+
@SuppressWarnings("SwallowedException")
200202
fun <T : Any> NamedParameterJdbcTemplate.selectOne(
201203
selectStatement: SelectStatementProvider,
202204
type: KClass<T>

0 commit comments

Comments
 (0)