Skip to content

refactor: Replace unused exception parameter with underscore#2721

Merged
bog-walk merged 8 commits intoJetBrains:mainfrom
devch37:main
Feb 4, 2026
Merged

refactor: Replace unused exception parameter with underscore#2721
bog-walk merged 8 commits intoJetBrains:mainfrom
devch37:main

Conversation

@devch37
Copy link
Copy Markdown
Contributor

@devch37 devch37 commented Jan 22, 2026

Description

Summary of the change: Provide a concise summary of this PR. Describe the changes made in a single sentence or short paragraph

Replace unused exception parameter in catch block.
(exposed-core/src/main/kotlin/org/jetbrains/exposed/v1/core/vendors/OracleDialect.kt)
(exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/v1/jdbc/statements/InsertBlockingExecutable.kt)
(exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/v1/jdbc/transactions/Transactions.kt)
(exposed-r2dbc/src/main/kotlin/org/jetbrains/exposed/v1/r2dbc/transactions/Transactions.kt)

Detailed description:

  • Why: Explain the reasons behind the changes. Why were they necessary?
    Following Kotlin's idiomatic conventions, unused variables should be represented with an underscore (_) rather than named parameters. This improves code readability and makes it immediately clear that the exception parameter is intentionally unused. It also eliminates IDE warnings about unused variables and aligns with the Kotlin style guide recommendations.

  • What: Detail what changes have been made in the PR.
    This PR replaces unused exception parameters in catch blocks with underscore notation across the codebase. The changes affect exception handling where the caught exception is not referenced in the catch block body.

  • How: Describe how the changes were implemented, including any key aspects of the code modified or new features added.

  1. Identified all catch blocks where exception parameters are declared but never used
  2. Replaced named exception parameters (e.g., e, ex, exception) with _
  3. Maintained the exception type specification for proper exception handling
  4. No functional changes were made; this is purely a style improvement

Type of Change

Please mark the relevant options with an "X":

  • Bug fix
  • New feature
  • Documentation update

Updates/remove existing public API methods:

  • Is breaking change

Affected databases:

  • MariaDB
  • Mysql5
  • Mysql8
  • Oracle
  • Postgres
  • SqlServer
  • H2
  • SQLite

Checklist

  • Unit tests are in place
  • The build is green (including the Detekt check)
  • All public methods affected by my PR has up to date API docs
  • Documentation for my change is up to date

Related Issues

@devch37 devch37 changed the title Replace unused exception parameter with underscore feat: Replace unused exception parameter with underscore Jan 23, 2026
Copy link
Copy Markdown
Member

@bog-walk bog-walk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for starting this @devch37

Could you please address the comments and also take a look at a similar catch block in OracleDialect.kt from exposed-core? It seems to be the only case missing from your changes.

@bog-walk bog-walk self-assigned this Jan 29, 2026
@bog-walk bog-walk changed the title feat: Replace unused exception parameter with underscore refactor: Replace unused exception parameter with underscore Jan 29, 2026
@devch37 devch37 requested a review from bog-walk January 29, 2026 01:49
Copy link
Copy Markdown
Member

@bog-walk bog-walk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @devch37 and apologies for the delay. There was an unrelated CI issue we wanted to resolve before any new merges.

@bog-walk bog-walk merged commit 08df6b2 into JetBrains:main Feb 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants