Skip to content

feat(generator): add HttpJsonServiceResumableUploadStubClassComposer - #14303

Merged
whowes merged 1 commit into
whowes/showcase-baseline-resumable-uploadfrom
whowes/generator-resumable-upload-stub-composer
Sep 9, 2026
Merged

whowes merged 1 commit into
whowes/showcase-baseline-resumable-uploadfrom
whowes/generator-resumable-upload-stub-composer

Conversation

@whowes

@whowes whowes commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Work in progress, not ready for review

@whowes
whowes added this pull request to stack #14308 September 9, 2026 00:10

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the HttpJsonServiceResumableUploadStubClassComposer class and its corresponding unit tests to generate REST stub transport classes for resumable upload methods in Java GAPIC clients. The review feedback identifies two critical compilation and AST construction issues in the newly added composer: a call to a non-existent method setResponseParserExpr instead of getResponseParserExpr on HttpJsonServiceStubClassComposer, and an invalid usage of ThrowExpr.builder() which does not directly support setting the exception type, message, or cause.

methodMaker
.apply(
"setResponseParser",
HttpJsonServiceStubClassComposer.setResponseParserExpr(protoMethod))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

The method in HttpJsonServiceStubClassComposer is named getResponseParserExpr, not setResponseParserExpr. Calling setResponseParserExpr will cause a compilation failure of the generator.

Suggested change
HttpJsonServiceStubClassComposer.setResponseParserExpr(protoMethod))
HttpJsonServiceStubClassComposer.getResponseParserExpr(protoMethod))

Comment on lines +663 to +669
ThrowExpr.builder()
.setType(
TypeNode.withExceptionClazz(
IllegalStateException.class))
.setMessageExpr("Failed to close resource")
.setCauseExpr(catchExceptionVarExpr)
.build())))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

ThrowExpr.builder() does not support setType, setMessageExpr, or setCauseExpr directly. Instead, you should build a NewObjectExpr representing the IllegalStateException and pass it to setThrowExpr.

                                    ThrowExpr.builder()
                                        .setThrowExpr(
                                            NewObjectExpr.builder()
                                                .setType(
                                                    TypeNode.withExceptionClazz(
                                                        IllegalStateException.class))
                                                .setArguments(
                                                    Arrays.asList(
                                                        ValueExpr.withValue(
                                                            StringObjectValue.withValue(
                                                                "Failed to close resource")),
                                                        catchExceptionVarExpr))
                                                .build())
                                        .build())))

@whowes
whowes removed this pull request from stack #14308 September 9, 2026 02:59
Add HttpJsonServiceResumableUploadStubClassComposer to generate dedicated
REST stub classes (HttpJson[Service]ResumableUploadStub) for services
containing resumable upload RPC methods.
@whowes
whowes force-pushed the whowes/generator-resumable-upload-stub-composer branch from 8cb5081 to e8fec50 Compare September 9, 2026 03:47
@whowes
whowes force-pushed the whowes/generator-rest-composer-helpers branch from 3bb9af9 to 1c99669 Compare September 9, 2026 03:47
Base automatically changed from whowes/generator-rest-composer-helpers to whowes/showcase-baseline-resumable-upload September 9, 2026 03:47
@whowes
whowes merged commit e8fec50 into whowes/showcase-baseline-resumable-upload Sep 9, 2026
71 of 73 checks passed
@whowes
whowes deleted the whowes/generator-resumable-upload-stub-composer branch September 9, 2026 03:47
@whowes
whowes restored the whowes/generator-resumable-upload-stub-composer branch September 9, 2026 03:56
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant