Skip to content

Commit

Permalink
Fix code debt.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bojan committed Aug 5, 2022
1 parent aebaaf9 commit ce14798
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ internal class RemoveIgnoredTableNameInteractor(
entity.toBuilder().removeIgnoredTableNames(indexed.first).build()
}
}
} ?: throw IllegalStateException("Ignored table name cannot be empty or blank.")
} ?: error("Ignored table name cannot be empty or blank.")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ internal class SaveIgnoredTableNameInteractor(
)
.build()
}
} ?: throw IllegalStateException("Ignored table name cannot be empty or blank.")
} ?: error("Ignored table name cannot be empty or blank.")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class Delete {

fun build(): String {
if (!::table.isInitialized) {
throw IllegalStateException("Failed to build - target table is undefined")
error("Failed to build - target table is undefined")
}
return toString()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal class DropTrigger {

fun build(): String {
if (!::trigger.isInitialized) {
throw IllegalStateException("Failed to build - target view is undefined")
error("Failed to build - target view is undefined")
}
return toString()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal class DropView {

fun build(): String {
if (!::view.isInitialized) {
throw IllegalStateException("Failed to build - target view is undefined")
error("Failed to build - target view is undefined")
}
return toString()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal class Pragma {

fun build(): String {
if (!::pragmaName.isInitialized) {
throw IllegalStateException("Failed to build - pragmaName is undefined")
error("Failed to build - pragmaName is undefined")
}
return toString()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal class Select {

fun columns(vararg columns: String) {
if (this.columns.isNotEmpty()) {
throw IllegalStateException("Detected an attempt to re-define columns to fetch.")
error("Detected an attempt to re-define columns to fetch.")
}
this.columns.addAll(columns)
}
Expand All @@ -39,7 +39,7 @@ internal class Select {
throw IllegalArgumentException("At least one column should be defined")
}
if (this.orderByColumns.isNotEmpty()) {
throw IllegalStateException("Detected an attempt to re-define ORDER BY columns.")
error("Detected an attempt to re-define ORDER BY columns.")
}
this.orderByColumns = columns.toList().filterNotNull()
}
Expand All @@ -50,7 +50,7 @@ internal class Select {

fun build(): String {
if (!::table.isInitialized) {
throw IllegalStateException("Failed to build - target table is undefined")
error("Failed to build - target table is undefined")
}
return toString()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal class Eq(
}

override fun addCondition(condition: Condition) {
throw IllegalStateException("Can't add a nested condition to 'eq'")
error("Can't add a nested condition to 'eq'")
}

override fun toString(): String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class Like(
}

override fun addCondition(condition: Condition): Unit =
throw IllegalStateException("Can't add a nested condition to 'like'")
error("Can't add a nested condition to 'like'")

override fun toString(): String =
"$column LIKE \"%%$value%%\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal class LifecycleConnectionDelegate(
.currentState
.isAtLeast(Lifecycle.State.INITIALIZED).not()
) {
throw IllegalStateException("Owner has not passed created yet.")
error("Owner has not passed created yet.")
}

val extras = when (thisRef) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ internal class ViewBindingDelegate<T : ViewBinding>(
.currentState
.isAtLeast(Lifecycle.State.INITIALIZED).not()
) {
throw IllegalStateException("Fragment views are not created yet.")
error("Fragment views are not created yet.")
}

viewBindingFactory(thisRef.requireView()).also { this.binding = it }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ internal class SplitLinearLayout @JvmOverloads constructor(

private fun checkChildCount() {
if (childCount != 2) {
throw IllegalStateException("SplitLinearLayout must have exactly 2 child views.")
error("SplitLinearLayout must have exactly 2 child views.")
}
}

Expand Down

0 comments on commit ce14798

Please sign in to comment.