apache / apache/druid

Statically prohibit missing format parameters in Druid's exception classes

Open
#8,333 6 comments 0 reactions 0 assignees View on GitHub
Area - Automation/Static Analysis Contributions Welcome
Dominant language
Java
Stars
14.1k
Forks
3.8k
Avg merge
2d 58m
Merged PRs (30d)
233

Description

https://youtrack.jetbrains.com/issue/IDEA-175327 doesn't allow to prevent bugs like fixed in #8331 using IntelliJ's "Malformed format string" inspection. However, there is a simple workaround: make constructors in all Druid's exception classes like `RE`, `ISE`, `IAE`, etc. private, expose static factory methods (e. g. `RE.of()`), and put them into the MalformedFormatString inspection config.

This would be a follow-up of #4474.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing follow-up issue #4474 and the RE, ISE, IAE, and other Druid exception classes. Determine the full set of constructors and the IntelliJ MalformedFormatString inspection configuration that must change. Done means constructors are private, static factories such as RE.of() are exposed, and missing format parameters are statically rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.