-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 possibly thread unsafe constants #15743
Conversation
abstract class ConstantExpr<T> implements Expr | ||
{ | ||
final ExpressionType outputType; | ||
|
||
@SuppressWarnings("Immutable") |
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.
What does @Immutable
do and why are these various @SuppressWarnings("Immutable")
necessary (here, in BaseTypeSignature, in ColumnCapabilitiesImpl)?
I am not familiar with this annotation so was just wondering what the extra lines are for.
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.
- the
@Immutable
enables a compile time check that the class satisfies some immutable rules- such a check could have warned me before doing the original PR
- the suppression is added for this field as we don't know what it is...but since this class will handle it as a blackbox I think its okay to ignore it
- I had to also add
SuppressWarnings("Immutable")
toColumnCapabiliiesImpl
because its kinda immutable; but fixing that turned into a massacre - I've asked @clintropolis about the value of such a change and based on that conversion I opted to not touch a lot of files without much benefits
should I remove these @Immutable
related changes?
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.
Ah, it's an errorprone thing? Cool. I was just wondering. I don't think we should necessarily aggressively use it everywhere (we have a lot of immutable classes, seems like it would be a lot of annotation noise) but it seems useful here.
closing as #15694 was merged |
this is an alternate version to retain some positive changes #15552 ; but fix the thread safety issue
ExprEval
-s fromConstantExpr
classes@Immutable
markers