JingsongLi commented on code in PR #9661:
URL: https://github.com/apache/paimon/pull/9661#discussion_r3986216026


##########
paimon-api/src/main/java/org/apache/paimon/rest/responses/ErrorResponse.java:
##########
@@ -79,7 +80,7 @@ public ErrorResponse(
             @Nullable @JsonProperty(FIELD_RESOURCE_TYPE) String resourceType,
             @Nullable @JsonProperty(FIELD_RESOURCE_NAME) String resourceName,
             @JsonProperty(FIELD_MESSAGE) String message,
-            @JsonProperty(FIELD_CODE) int code) {
+            @Nullable @JsonProperty(FIELD_CODE) Integer code) {

Review Comment:
   [P2] Retain the existing primitive constructor for compiled API consumers
   
   Changing the public constructor's final parameter from int to Integer 
removes the JVM descriptor (String,String,String,int). Autoboxing only helps 
newly compiled source: existing REST clients/extensions compiled against 
paimon-api still invoke the removed method. I reproduced NoSuchMethodError at 
HttpClient.buildErrorResponse on a missing-code 404 when loading the changed 
ErrorResponse with an already compiled caller; rebuilding that caller makes the 
functional regression pass.
   
   Keep the nullable Integer constructor as the JsonCreator and retain an 
unannotated int overload delegating to it. That preserves the existing binary 
entry point without losing the distinction between an omitted code and HTTP 0. 
Please include a small precompiled-caller compatibility check.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to