Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: KotlinGenerator produces superfluous public keyword for overriding methods #14883

Closed
lukaseder opened this issue Mar 30, 2023 · 2 comments

Comments

@lukaseder
Copy link
Member

This is a cosmetic regression, introduced with a recent bugfix for:

It can be seen in this commit, for example:
jOOQ/jOOQ-mcve@e53f134

diff --git a/jOOQ-mcve-kotlin-h2/src/main/kotlin/org/jooq/mcve/kotlin/h2/DefaultCatalog.kt b/jOOQ-mcve-kotlin-h2/src/main/kotlin/org/jooq/mcve/kotlin/h2/DefaultCatalog.kt
index a1cbd61..223c89a 100644
--- a/jOOQ-mcve-kotlin-h2/src/main/kotlin/org/jooq/mcve/kotlin/h2/DefaultCatalog.kt
+++ b/jOOQ-mcve-kotlin-h2/src/main/kotlin/org/jooq/mcve/kotlin/h2/DefaultCatalog.kt
@@ -29,7 +29,7 @@ open class DefaultCatalog : CatalogImpl("") {
      */
     val MCVE: Mcve get(): Mcve = Mcve.MCVE
 
-    override fun getSchemas(): List<Schema> = listOf(
+    public override fun getSchemas(): List<Schema> = listOf(
         Mcve.MCVE
     )

The fix in #14855 made sure that visibility cannot be reduced, but now, it's just always generated explicitly.

This regression is "cosmetic," meaning it does not produce any compilation errors, only a minor annoyance in generated code, e.g. when warnings are active for unnecessary keywords in the IDE.

@lukaseder
Copy link
Member Author

There's a rare case where public is desired, e.g. when -Xexplicit-api=strict is specified

lukaseder added a commit that referenced this issue Mar 30, 2023
lukaseder added a commit that referenced this issue Mar 30, 2023
lukaseder added a commit that referenced this issue Mar 30, 2023
lukaseder added a commit that referenced this issue Mar 30, 2023
@lukaseder
Copy link
Member Author

Fixed in jOOQ 3.19.0, 3.18.3 (#14884), 3.17.12 (#14886), and 3.16.18 (#14885)

3.14 Better Kotlin and Scala Support automation moved this from To do to Done Mar 30, 2023
lukaseder added a commit that referenced this issue Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant