Skip to content

Convert types to sealed classes where possible#14555

Merged
dain merged 1 commit intotrinodb:masterfrom
dain:type-sealed-classes
Oct 11, 2022
Merged

Convert types to sealed classes where possible#14555
dain merged 1 commit intotrinodb:masterfrom
dain:type-sealed-classes

Conversation

@dain
Copy link
Copy Markdown
Member

@dain dain commented Oct 10, 2022

Convert DecimalType, TimeWithTimeZoneType, and TimestampWithTimeZoneType to sealed classes

Release notes

(X) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text:

@cla-bot cla-bot bot added the cla-signed label Oct 10, 2022
Convert DecimalType, TimeWithTimeZoneType, and TimestampWithTimeZoneType
to sealed classes
@dain dain force-pushed the type-sealed-classes branch from 9d7f38e to a6744ae Compare October 11, 2022 00:01
@dain dain merged commit cf7ac01 into trinodb:master Oct 11, 2022
@dain dain deleted the type-sealed-classes branch October 11, 2022 02:50
@github-actions github-actions bot added this to the 400 milestone Oct 11, 2022
@hashhar
Copy link
Copy Markdown
Member

hashhar commented Oct 11, 2022

What's the motivation?

Does this prevent a plugin from providing specialized types for example?

@findepi
Copy link
Copy Markdown
Member

findepi commented Oct 11, 2022

Does this prevent a plugin from providing specialized types for example?

These classes were not meant to be extended and it would be dangerous if someone tried that.

public abstract sealed class TimestampWithTimeZoneType
extends AbstractType
implements FixedWidthType
permits LongTimestampWithTimeZoneType, ShortTimestampWithTimeZoneType
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The @see LongTimestampWithTimeZoneType above became redundant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants