Dead code refactor: Removed depreccated code from Table.java#668
Open
asshifasultana wants to merge 3 commits into
Open
Dead code refactor: Removed depreccated code from Table.java#668asshifasultana wants to merge 3 commits into
asshifasultana wants to merge 3 commits into
Conversation
Author
|
It's a humble request to review the PR as soon as possible. It's a project based task given by the faculty and I have to make reports depending on it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
4.1.8 Dead Code – Deprecated API Removal
File:
src/main/java/com/googlecode/lanterna/gui2/table/Table.javaSeverity:
Low
Description
The
Tableclass contains two public methods,getViewTopRow()andsetViewTopRow(int), that are marked as@Deprecated. These methods are no longer maintained and simply act as wrappers around newer APIs that provide the same functionality.Why It Is Problematic
Deprecated methods increase the public API surface and contribute to technical debt. Maintaining legacy wrapper methods makes the codebase harder to understand and increases maintenance effort. Since modern replacement methods already exist, keeping the deprecated methods provides little value while increasing the risk of future compatibility issues.
Evidence
The methods
getViewTopRow()andsetViewTopRow(int)are annotated with@DeprecatedinTable.java. The class already provides the recommended replacement methods:getViewTopRow()→getFirstViewedRowIndex()setViewTopRow(int)→getRenderer().setViewTopRow(int)A project-wide search shows no internal usages of these deprecated methods outside
Table.java, indicating that they are effectively unused within the codebase.Recommended Improvement
Remove the deprecated wrapper methods from
Table.javaand update any remaining external code to use the modern APIs:getViewTopRow()withgetFirstViewedRowIndex().setViewTopRow(int)withgetRenderer().setViewTopRow(int).If these methods are removed in a future release, the API change should be documented in the project's changelog.