Skip to content

[BUG] [Code Style] HttpStatus & Headers should not be imported from org.apache.hc.core5.http #3581

@peternied

Description

@peternied

What is the bug?

In this codebase on main, we are using a newer version of the apache http client; however, in our currently supported major version, 2.x we don't use this version of the http client and cannot due to dependency conflicts. Any changes that reference org.apache.hc.core5.http.HttpStatus or org.apache.hc.core5.http.Header cannot be backported without manual conflict resolution.

What is the expected behavior?

Our code hygiene workflows should catch usages of these namespace and prevent them from being checked into the codebase. It would be a bonus to fixing the issue by switching to org.apache.http.HttpStatus & org.apache.http.Header which will work in both the 2.x and mainline branches or provide the specific recommendation.

Exit Criteria

  • Add a new checkstyle or spotless rule that prevents the use of the org.apache.hc.core5.http package for HttpStatus and Header classes.
  • Fix all existing references to use org.apache.http.HttpStatus & org.apache.http.Header
  • [Optional] Update spotlessApply so that it can switch the references to the preferred replacement OR have the error message indicate how to resolve the issue by suggesting the correct replacement class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CCICollege Contributor InitiativebugSomething isn't workinggood first issueThese are recommended starting points for newcomers looking to make their first contributions.triagedIssues labeled as 'Triaged' have been reviewed and are deemed actionable.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions