Skip to content

Phase 1 refactor: typo fixes, dead code removal, class rename#957

Merged
timmolter merged 4 commits into
developfrom
timmolter/phase-1-refactor
May 29, 2026
Merged

Phase 1 refactor: typo fixes, dead code removal, class rename#957
timmolter merged 4 commits into
developfrom
timmolter/phase-1-refactor

Conversation

@timmolter
Copy link
Copy Markdown
Member

@timmolter timmolter commented May 29, 2026

Phase 1 Refactor — Low-hanging fruit, no API breakage

Changes included

1. Fix typos in error messages (BoxChart.java)

  • "connot be null""cannot be null"
  • "connot be empyt""cannot be empty"
  • Searched entire codebase for similar typos — none found elsewhere

2. Rename AxesChartSeriesNumericalNoErrorBarsAxesChartSeriesNumerical

  • The original name was misleading — the class does support error bars (contains double[] extraValues and findMinMaxWithErrorBars()). A TODO comment in the file itself called this out.
  • Renamed to AxesChartSeriesNumerical — accurate and concise.
  • Updated all references: NoMarkersSeries.java, XYSeries.java, ChartZoom.java

3. Magic numbers — Legend_.java (no changes needed)

  • All requested constants (BOX_SIZE, BOX_OUTLINE_WIDTH, LEGEND_MARGIN, MULTI_LINE_SPACE, MAX_LEGEND_TEXT_WIDTH_RATIO) were already present as private static final constants.
  • Scanned other PlotContent/Legend subclasses — only algorithmic/geometric constants found, nothing warranting extraction.

4. BoxPlot DTO TODO (deferred)

  • BoxPlotData.java has a // TODO remove these BoxPlot DTOs comment.
  • Investigated: the DTO is used extensively by BoxPlotDataCalculator. Removing it would require an architectural refactor (Phase 4 territory, and Java 11 rules out records). Left as-is.

5. Commented-out debug println statements — kept as-is (not removed)

Tests

All tests pass: mvn test -pl xchart
Formatting clean: mvn fmt:check -pl xchart

timmolter and others added 4 commits May 29, 2026 12:04
'connot be null' -> 'cannot be null'
'connot be empyt' -> 'cannot be empty'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove commented-out System.out.println lines from series classes
  (AxesChartSeriesNumericalNoErrorBars, NoMarkersSeries, AxesChartSeriesCategory,
  HorizontalBarSeries) and chart-part classes (AxisTickLabels,
  AxisTickCalculator_, AxisTickCalculator_Date, AxisTitle, ChartZoom,
  PlotContent_OHLC, PlotSurface_AxesChart, AnnotationTextPanel)
- Remove active debug System.out.println block in AxisTickCalculator_
  catch clause (replaced with a concise comment)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The old name was inaccurate — the class does support error bars via
extraValues and findMinMaxWithErrorBars(). The new name AxesChartSeriesNumerical
is accurate and concise.

Updated all references:
- NoMarkersSeries (extends)
- XYSeries (extends)
- ChartZoom (instanceof checks and casts)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@timmolter timmolter merged commit caf30ba into develop May 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant