-
Notifications
You must be signed in to change notification settings - Fork 50
[Drift] Allow adding custom thrift type when using generator #112
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
Conversation
b3a1423
to
0c13a86
Compare
9b2a65c
to
06ea0c1
Compare
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.
LGTM % questions
<artifactId>maven-dependency-plugin</artifactId> | ||
<configuration> | ||
<ignoredNonTestScopedDependencies> | ||
<dependency>com.facebook.airlift:units</dependency> |
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.
Why does it need to be ignored?
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.
|
||
public void addKnowTypes(ThriftType type) | ||
{ | ||
BUILT_IN_TYPES.add(type); |
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.
Is it necessary to update BUILT_IN_TYPES
?
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.
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.
Hmm, I see.
Modifying the static map of built in types may result in unexpected side effects. Consider an application using the ThriftIdlGenerator class to generate multiple unrelated IDLs.
Maybe keep the static BUILT_IN_TYPES
map immutable and add one more, non static, customTypes
map and then initialize the knownTypes
map using both, the static BUILT_IN_TYPES
and the customTypes
map.
You may want to rename the addKnownType
method addCustomType
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.
Good point. Thanks for the suggestion! Code updated.
this.recursive = config.isRecursive(); | ||
} | ||
|
||
public void addKnowTypes(ThriftType type) |
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.
nit: addKnownType
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.
Updated
|
||
<dependency> | ||
<groupId>joda-time</groupId> | ||
<artifactId>joda-time</artifactId> |
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.
looks like this is used only for Tests ? if so can we make the scope as test ?
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.
<dependency> | ||
<groupId>joda-time</groupId> | ||
<artifactId>joda-time</artifactId> | ||
<scope>test</scope> |
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.
.
Uh oh!
There was an error while loading. Please reload this page.