-
Notifications
You must be signed in to change notification settings - Fork 62
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
[v1] Change public fields to Lombok getters; make concrete classes final #1685
base: main
Are you sure you want to change the base?
Conversation
CROSS-ENGINE-REPORT ❌
Testing Details
Result Details
Now FAILING Tests ❌The following 5 test(s) were previously PASSING in BASE but are now FAILING in TARGET: Click here to see
Now IGNORED Tests ❌The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact. Now Passing Tests180 test(s) were previously failing in BASE (LEGACY-V0.14.8) but now pass in TARGET (EVAL-28DB2B2). Before merging, confirm they are intended to pass. The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact. CROSS-COMMIT-REPORT ✅
Testing DetailsResult Details
|
val asAlias = node.asAlias | ||
t = if (asAlias != null) t concat " GROUP AS ${asAlias.sql()}" else t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(self-review): previously, when we used public fields, we could use the smart-casting of these nullable fields to non-null values (e.g. call node.asAlias.sql()
directly). Since we switch to use getters
, will need to define a variable first that we perform null-checks on.
@@ -13,12 +14,14 @@ | |||
*/ | |||
@Builder(builderClassName = "Builder") | |||
@EqualsAndHashCode(callSuper = false) | |||
public class Explain extends Statement { | |||
public final class Explain extends Statement { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(self-review): change all of the concrete classes to be final
.
@@ -394,19 +396,20 @@ public abstract class SqlDialect : AstVisitor<SqlBlock, SqlBlock>() { | |||
override fun visitExprLike(node: ExprLike, tail: SqlBlock): SqlBlock { | |||
var t = tail | |||
t = visitExprWrapped(node.value, t) | |||
t = t concat if (node.not) " NOT LIKE " else " LIKE " | |||
t = t concat if (node.isNot) " NOT LIKE " else " LIKE " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(self-review): Lombok's default getter for boolean
(not the boxed Boolean
; boxed will still use get
) will use the is
prefix rather than get
. Stylistically, is
is
- more consistent with what we do in the plan already (e.g. RelUnion's
isAll
) - default for IntelliJ when creating new getters from private fields
- if we care about conventions, JavaBeans prescribes using
is
overget
This change applies to other places we had used a boolean getter (e.g. identifier's delimited
).
@@ -16,6 +16,9 @@ | |||
plugins { | |||
id(Plugins.conventions) | |||
id(Plugins.publish) | |||
// Need the Kotlin lombok plugin to allow for Kotlin code in partiql-ast to understand Java Lombok annotations. | |||
// https://kotlinlang.org/docs/lombok.html | |||
id(Plugins.kotlinLombok) version Versions.kotlinLombok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(self-review): Kotlin lombok plugin required to allow Kotlin code to understand Java lombok annotations -- https://kotlinlang.org/docs/lombok.html. It is experimental but
- seems pretty stable so far since its published by the Kotlin team
- we could always use a fixed version or hand-write the getters if we encounter issues without breaking the public API
4c7f12a
to
73e25c5
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1685 +/- ##
============================================
+ Coverage 73.16% 80.03% +6.87%
+ Complexity 2393 47 -2346
============================================
Files 247 19 -228
Lines 17627 506 -17121
Branches 3178 23 -3155
============================================
- Hits 12896 405 -12491
+ Misses 3854 88 -3766
+ Partials 877 13 -864
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Relevant Issues
Description
Other Information
Updated Unreleased Section in CHANGELOG: [NO]
Any backward-incompatible changes? [YES]
Any new external dependencies? [YES]
Do your changes comply with the Contributing Guidelines
and Code Style Guidelines? [YES]
License Information
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.