Add utilities to detect and replace broken links. by barsh404error · Pull Request #1366 · Together-Java/TJ-Bot

@barsh404error

tj-wazei

tj-wazei

@barsh404error

@barsh404error

christolis

@barsh404error

@barsh404error

@barsh404error barsh404error changed the title Add utilities to detect and replace broken links. Add utilities to detect and replace broken links. Fixed #1276

Jan 3, 2026

@christolis christolis changed the title Add utilities to detect and replace broken links. Fixed #1276 Add utilities to detect and replace broken links.

Jan 4, 2026

Zabuzard

@barsh404error

Zabuzard

Zabuzard

Zabuzard

Zabuzard

Zabuzard

@barsh404error

Updated isLinkBroken() to only treat 4xx/5xx status codes as broken.
Previously 3xx redirects were incorrectly marked as broken links

also improved javadoc clarity throughout LinkDetection class

@barsh404error

Zabuzard

@barsh404error

- Rename replaceDeadLinks to replaceBrokenLinks for consistency
- Use Optional instead of null values in stream processing
- Add convenience overload for extractLinks with default filters
- Update javadocs to be more generic and future-proof
- Move implementation details from javadoc to inline comments
- Replace 'ignored' lambda params with '_'

Resolves the review comments from @Zabuzard

Zabuzard

@barsh404error

Zabuzard

@barsh404error

Use streams thraughout and extract replacement logic into a separate
method for better readbility

@christolis

Remove a reoccuring line gap introduced between each method's JavaDoc and
its corresponding method signatures to adhere to the overall style of the
project.

Signed-off-by: Chris Sdogkos <work@chris-sdogkos.com>

christolis

Zabuzard