[ 
https://issues.apache.org/jira/browse/GEODE-10532?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jinwoo Hwang updated GEODE-10532:
---------------------------------
    Description: 
h2. Summary

Replace deprecated {{ClientHttpResponse.getRawStatusCode()}} method with 
{{getStatusCode().value()}} in {{{}HttpRequester.java{}}}. This API is marked 
for removal in Spring Framework 7.0.
h2. Description

The {{geode-gfsh}} module contains 3 usages of 
{{ClientHttpResponse.getRawStatusCode()}} that has been deprecated for removal 
in Spring Framework 6.0 and will be removed in Spring Framework 7.0 (estimated 
2026).

*Affected File:*
{code:java}
geode-gfsh/src/main/java/org/apache/geode/management/internal/web/http/support/HttpRequester.java
{code}
*Affected Lines:* 113, 115, 117

*Current Warnings:*
{code:java}
Line 113: warning: [removal] getRawStatusCode() in ClientHttpResponse has been 
deprecated and marked for removal
Line 115: warning: [removal] getRawStatusCode() in ClientHttpResponse has been 
deprecated and marked for removal
Line 117: warning: [removal] getRawStatusCode() in ClientHttpResponse has been 
deprecated and marked for removal
{code}
h2. Technical Details

*Deprecated API:*
 * {{org.springframework.http.client.ClientHttpResponse.getRawStatusCode()}}

*Method Signature:*
{code:java}
int getRawStatusCode() throws IOException
{code}
*Deprecation Timeline:*
 * Deprecated: Spring Framework 6.0
 * Removal Target: Spring Framework 7.0 (estimated 2026)
 * Status: Marked for removal

*Replacement API:*
 * {{org.springframework.http.HttpStatusCode.value()}}

*Package:* {{org.apache.geode.management.internal.web.http.support}}
*Module:* {{geode-gfsh}}
*Warning Type:* {{[removal]}}
*Priority:* HIGH - Blocks Spring Framework 7.0 migration
h2. Migration Pattern

*Before:*
{code:java}
int statusCode = response.getRawStatusCode();
{code}
*After:*
{code:java}
int statusCode = response.getStatusCode().value();
{code}
h2. Required Actions
 # Locate all 3 occurrences of {{getRawStatusCode()}} in {{HttpRequester.java}} 
(lines 113, 115, 117)
 # Replace {{response.getRawStatusCode()}} with 
{{response.getStatusCode().value()}}
 # Verify the code compiles with Java 17 without warnings
 # Run all GFSH-related tests to ensure HTTP status code handling works 
correctly
 # Verify error handling and exception paths still function properly

h2. How to Verify Warnings

*Step 1:* Enable warnings in 
{{{}build-tools/scripts/src/main/groovy/warnings.gradle{}}}:
{code:groovy}
tasks.withType(JavaCompile) {
  options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation' << 
'-Xlint:removal'
  options.deprecation = true
}
{code}
*Step 2:* Build and check warnings:
{code:bash}
./gradlew clean :geode-gfsh:compileJava --no-build-cache 2>&1 | grep "warning:"
{code}
*Step 3:* After fixing, restore original configuration:
{code:bash}
git checkout build-tools/scripts/src/main/groovy/warnings.gradle
{code}
h2. References
 * [Spring Framework 6.0 Release 
Notes|https://github.com/spring-projects/spring-framework/wiki/What%27s-New-in-Spring-Framework-6.x]
 * [ClientHttpResponse API 
Documentation|https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/client/ClientHttpResponse.html]
 * [HttpStatusCode API 
Documentation|https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/HttpStatusCode.html]
 * [Spring Framework Migration 
Guide|https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x]

h2. Acceptance Criteria
 * All 3 occurrences of {{getRawStatusCode()}} replaced with 
{{getStatusCode().value()}}
 * Code compiles without {{[removal]}} warnings in Java 17
 * All existing GFSH tests pass
 * HTTP status code handling verified (success, error, and edge cases)
 * No changes to public API behavior
 * Exception handling remains consistent

h2. Test Coverage

Ensure the following scenarios are tested:
 * Successful HTTP responses (200, 201, etc.)
 * Client errors (400, 404, etc.)
 * Server errors (500, 503, etc.)
 * Edge cases (redirects, custom status codes)

h2. Impact

*Risk:* HIGH - This API will be removed in Spring Framework 7.0. The code will 
not compile without this fix when upgrading to Spring 7.x.
*Scope:* 1 file, 3 locations (lines 113, 115, 117)
*Related Work:* Part of Java 17 warning cleanup effort (36 total warnings 
across 6 modules)
*Reusability:* Same fix pattern applies to all 3 occurrences - straightforward 
replacement

> Replace getRawStatusCode() with getStatusCode().value() - Spring 7.0 Blocker
> ----------------------------------------------------------------------------
>
>                 Key: GEODE-10532
>                 URL: https://issues.apache.org/jira/browse/GEODE-10532
>             Project: Geode
>          Issue Type: Improvement
>            Reporter: Jinwoo Hwang
>            Assignee: Jinwoo Hwang
>            Priority: Major
>
> h2. Summary
> Replace deprecated {{ClientHttpResponse.getRawStatusCode()}} method with 
> {{getStatusCode().value()}} in {{{}HttpRequester.java{}}}. This API is marked 
> for removal in Spring Framework 7.0.
> h2. Description
> The {{geode-gfsh}} module contains 3 usages of 
> {{ClientHttpResponse.getRawStatusCode()}} that has been deprecated for 
> removal in Spring Framework 6.0 and will be removed in Spring Framework 7.0 
> (estimated 2026).
> *Affected File:*
> {code:java}
> geode-gfsh/src/main/java/org/apache/geode/management/internal/web/http/support/HttpRequester.java
> {code}
> *Affected Lines:* 113, 115, 117
> *Current Warnings:*
> {code:java}
> Line 113: warning: [removal] getRawStatusCode() in ClientHttpResponse has 
> been deprecated and marked for removal
> Line 115: warning: [removal] getRawStatusCode() in ClientHttpResponse has 
> been deprecated and marked for removal
> Line 117: warning: [removal] getRawStatusCode() in ClientHttpResponse has 
> been deprecated and marked for removal
> {code}
> h2. Technical Details
> *Deprecated API:*
>  * {{org.springframework.http.client.ClientHttpResponse.getRawStatusCode()}}
> *Method Signature:*
> {code:java}
> int getRawStatusCode() throws IOException
> {code}
> *Deprecation Timeline:*
>  * Deprecated: Spring Framework 6.0
>  * Removal Target: Spring Framework 7.0 (estimated 2026)
>  * Status: Marked for removal
> *Replacement API:*
>  * {{org.springframework.http.HttpStatusCode.value()}}
> *Package:* {{org.apache.geode.management.internal.web.http.support}}
> *Module:* {{geode-gfsh}}
> *Warning Type:* {{[removal]}}
> *Priority:* HIGH - Blocks Spring Framework 7.0 migration
> h2. Migration Pattern
> *Before:*
> {code:java}
> int statusCode = response.getRawStatusCode();
> {code}
> *After:*
> {code:java}
> int statusCode = response.getStatusCode().value();
> {code}
> h2. Required Actions
>  # Locate all 3 occurrences of {{getRawStatusCode()}} in 
> {{HttpRequester.java}} (lines 113, 115, 117)
>  # Replace {{response.getRawStatusCode()}} with 
> {{response.getStatusCode().value()}}
>  # Verify the code compiles with Java 17 without warnings
>  # Run all GFSH-related tests to ensure HTTP status code handling works 
> correctly
>  # Verify error handling and exception paths still function properly
> h2. How to Verify Warnings
> *Step 1:* Enable warnings in 
> {{{}build-tools/scripts/src/main/groovy/warnings.gradle{}}}:
> {code:groovy}
> tasks.withType(JavaCompile) {
>   options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation' << 
> '-Xlint:removal'
>   options.deprecation = true
> }
> {code}
> *Step 2:* Build and check warnings:
> {code:bash}
> ./gradlew clean :geode-gfsh:compileJava --no-build-cache 2>&1 | grep 
> "warning:"
> {code}
> *Step 3:* After fixing, restore original configuration:
> {code:bash}
> git checkout build-tools/scripts/src/main/groovy/warnings.gradle
> {code}
> h2. References
>  * [Spring Framework 6.0 Release 
> Notes|https://github.com/spring-projects/spring-framework/wiki/What%27s-New-in-Spring-Framework-6.x]
>  * [ClientHttpResponse API 
> Documentation|https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/client/ClientHttpResponse.html]
>  * [HttpStatusCode API 
> Documentation|https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/HttpStatusCode.html]
>  * [Spring Framework Migration 
> Guide|https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x]
> h2. Acceptance Criteria
>  * All 3 occurrences of {{getRawStatusCode()}} replaced with 
> {{getStatusCode().value()}}
>  * Code compiles without {{[removal]}} warnings in Java 17
>  * All existing GFSH tests pass
>  * HTTP status code handling verified (success, error, and edge cases)
>  * No changes to public API behavior
>  * Exception handling remains consistent
> h2. Test Coverage
> Ensure the following scenarios are tested:
>  * Successful HTTP responses (200, 201, etc.)
>  * Client errors (400, 404, etc.)
>  * Server errors (500, 503, etc.)
>  * Edge cases (redirects, custom status codes)
> h2. Impact
> *Risk:* HIGH - This API will be removed in Spring Framework 7.0. The code 
> will not compile without this fix when upgrading to Spring 7.x.
> *Scope:* 1 file, 3 locations (lines 113, 115, 117)
> *Related Work:* Part of Java 17 warning cleanup effort (36 total warnings 
> across 6 modules)
> *Reusability:* Same fix pattern applies to all 3 occurrences - 
> straightforward replacement



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to