Skip to content

compiler: make Stub final class#2077

Merged
dapengzhang0 merged 1 commit intogrpc:masterfrom
dapengzhang0:finalstub
Jul 22, 2016
Merged

compiler: make Stub final class#2077
dapengzhang0 merged 1 commit intogrpc:masterfrom
dapengzhang0:finalstub

Conversation

@dapengzhang0
Copy link
Copy Markdown
Contributor

forgot to make Stub final class...

p->Print(
*vars,
"public static class $stub_name$ extends $AbstractStub$<$stub_name$> {\n");
"public static final class $stub_name$ extends $AbstractStub$<$stub_name$> {\n");
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.

Should this also be triggered by the deprecated api flag?

Copy link
Copy Markdown
Contributor Author

@dapengzhang0 dapengzhang0 Jul 22, 2016

Choose a reason for hiding this comment

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

@ejona86 deprecated stub apis should still be without final keyword as some users are using mockito.

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.

Oh, I didn't see this was only done if !enable_deprecated

@ejona86
Copy link
Copy Markdown
Member

ejona86 commented Jul 22, 2016

@dapengzhang0 LGTM

@dapengzhang0 dapengzhang0 merged commit 3a13aa5 into grpc:master Jul 22, 2016
@dapengzhang0 dapengzhang0 deleted the finalstub branch July 26, 2016 20:57
@cmargiol
Copy link
Copy Markdown

Hey guys,

We had implemented a "RetryableClient" wrapping generated stubs to reconnect dropped connections. Originally we were using java.lang.reflect.Proxy when there were interfaces, and thought we'd do it the mockito way now for the generated classes. Making them final means we can't - but wouldn't want to enable the deprecated API to use this.

So I was wondering what is the context for this change?

@ejona86
Copy link
Copy Markdown
Member

ejona86 commented Aug 16, 2016

See #1469 (comment)

For your use case, we'd recommend making a ClientInterceptor.

@lock lock Bot locked as resolved and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants