partiql / partiql-lang-kotlin

PartiQL libraries and tools in Kotlin.
https://partiql.org/
Apache License 2.0
536 stars 60 forks source link

Resolve Class Path conflict. #1465

Closed yliuuuu closed 1 month ago

yliuuuu commented 1 month ago

Relevant Issues

Description

Previously, the class StaticTypeMeta is duplicated the ast package and in the lang package.

Both of which get packaged under org.partiql.lang.ast.

This fails the build when a customer enables compile time validation for duplicated class in the classpath.

This PR removes the StaticTypeMeta in the lang package as a short term fix for the issue.

We anticipate issue of similar pattern will not occurs once we complete the split of packages, but it is still worthy for us to consider adding a check for similar issue in the future. Unfortunately, a cursor search does not reveal a good gradle-plugin for this purposes, hence this PR does not include such check.

Note that the issue only happens when a compile time check as described is included in the build process, this is because the two classes are identical and at runtime, it does not matter which class gets loaded...

Also, worth to call out that this PR should not be considered backward-incompatible: This is: one can access the StaticTypeMeta is only taking dependency from partiql-ast package, and one can still access StaticTypeMeta when takiing dependency from partiql-lang package. The APIs are exposed because partiql-ast is a dependency of partiql-lang.

Other Information

License Information

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.