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

fix kotlin warnings in CDK core #37477

Merged

Conversation

stephane-airbyte
Copy link
Contributor

@stephane-airbyte stephane-airbyte commented Apr 22, 2024

just fixing kotlin warnings in CDK

Interesting tidbit: Because of named parameters, it's important that a function override has the same parameter names as the overriden function. Hence some parameter renaming here.

Also, variable name shadowing is reported as a warning

Copy link

vercel bot commented Apr 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Apr 23, 2024 8:41pm

@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Apr 22, 2024
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @stephane-airbyte and the rest of your teammates on Graphite Graphite

@stephane-airbyte stephane-airbyte marked this pull request as ready for review April 22, 2024 17:57
@stephane-airbyte stephane-airbyte requested review from a team as code owners April 22, 2024 17:57
@stephane-airbyte stephane-airbyte force-pushed the stephane/04-22-fix_kotlin_warnings_in_cdk_core branch from 2b42c18 to f703678 Compare April 22, 2024 19:31
@@ -332,8 +332,10 @@ abstract class AbstractJdbcCompatibleSourceOperations<Datatype> :
}
}

// Note: I'm guessing this is an open function, since it doesn't do anything here, and doesn't
// override anything either
Copy link
Contributor

@postamar postamar Apr 23, 2024

Choose a reason for hiding this comment

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

I can answer that: all these methods should be open

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think they should be abstract. I really don't like optional methods. Battle for another day though

@@ -17,7 +17,7 @@ import org.slf4j.LoggerFactory
/** Implementation of source operations with standard JDBC types. */
open class JdbcSourceOperations :
AbstractJdbcCompatibleSourceOperations<JDBCType>(), SourceOperations<ResultSet, JDBCType> {
protected fun safeGetJdbcType(columnTypeInt: Int): JDBCType {
private fun safeGetJdbcType(columnTypeInt: Int): JDBCType {
Copy link
Contributor

Choose a reason for hiding this comment

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

This probably needs to be open protected as well, but I'm less sure.

@@ -256,7 +251,7 @@ internal constructor(
messageIterator: AutoCloseableIterator<AirbyteMessage>,
recordCollector: Consumer<AirbyteMessage>
) {
messageIterator!!.airbyteStream.ifPresent { s: AirbyteStreamNameNamespacePair? ->
messageIterator.airbyteStream.ifPresent { s: AirbyteStreamNameNamespacePair? ->
Copy link
Contributor

Choose a reason for hiding this comment

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

s need not be nullable. Comment applies elsewhere also.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will need another pass

@stephane-airbyte stephane-airbyte force-pushed the stephane/04-22-fix_kotlin_warnings_in_cdk_core branch 3 times, most recently from e10a324 to 5fc346d Compare April 23, 2024 18:15
@stephane-airbyte stephane-airbyte force-pushed the stephane/04-22-fix_kotlin_warnings_in_cdk_core branch from 5fc346d to 4d64c8f Compare April 23, 2024 20:41
@stephane-airbyte stephane-airbyte merged commit 6ca1a76 into master Apr 23, 2024
30 checks passed
@stephane-airbyte stephane-airbyte deleted the stephane/04-22-fix_kotlin_warnings_in_cdk_core branch April 23, 2024 21:14
strosek pushed a commit that referenced this pull request Apr 24, 2024
just fixing kotlin warnings in CDK

Interesting tidbit: Because of named parameters, it's important that a function override has the same parameter names as the overriden function. Hence some parameter renaming here.

Also, variable name shadowing is reported as a warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDK Connector Development Kit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants