Skip to content

refactor: simplify existence checks and object-loading helper - #1531

Merged
joaodinissf merged 2 commits into
masterfrom
codex/simplify-pmd-followup
Sep 11, 2026
Merged

refactor: simplify existence checks and object-loading helper#1531
joaodinissf merged 2 commits into
masterfrom
codex/simplify-pmd-followup

Conversation

@joaodinissf

Copy link
Copy Markdown
Collaborator

Summary

Optional simplifications deliberately separated from PMD-only #1515. This PR is based on codex/pmd-7.27-base, an upstream mirror of the narrowed #1515 head, so the review diff contains only this follow-up. After #1515 merges, retarget this PR to master and rerun checks before merging.

Changes

  • Replace exception-driven existence searches with boolean predicates; simplify both catalog checks with lambdas and one local catalog reference while retaining completeness checks before identity comparison.
  • Replace marker-help key lookup plus predicate scanning with direct multimap entry membership. Xtext pairs use value-based equality and hashing.
  • Inline the private loading helper, removing its unused parameter, unnecessary exception declaration, and suppression while preserving adapter attachment behavior.
  • Add six tests in the existing aggregate suite for matching entries/default check kind, missing context with equal issue count, wrong marker type, wrong issue code, null marker type, and null issue code.
  • Advance affected runtime plugin/feature versions independently of fix: satisfy PMD 7.27.0 across the reactor #1515.

Behavioral boundaries

This is not claimed to be strictly exception-equivalent. The former searches caught NoSuchElementException from the entire find call, including predicate evaluation; the new checks do not intentionally swallow predicate exceptions. Null-valued marker-help pair components are non-matches against expected non-null values instead of potentially throwing NullPointerException. The new regression tests cover these null-valued entries at the Eclipse model level. Normal Check kinds default to FAST, including when set to null, and successfully generated issue-code values are non-null strings.

Validation

Local full verification and quality checks passed on head 21e9bae62: Maven verify, Checkstyle, PMD, CPD, and SpotBugs using Java 21 on macOS. The aggregate suite reported 360 tests, 0 failures, 0 errors, and 2 skipped. All 11 CheckMarkerHelpExtensionTest cases passed, including the six new cases. They run through the existing aggregate suite; no separate test runtime configuration is added. This draft must receive its own fresh green CI before merge.

Keep draft with no reviewer requests. Review independently from #1515; do not merge before its dependency.


Re-homed from #1521, for the same reason. Content is identical — same head commit 21e9bae6.

🤖 Generated with Claude Code

@joaodinissf
joaodinissf marked this pull request as ready for review September 8, 2026 09:22
@joaodinissf
joaodinissf requested review from KrisLimbo, markdomeng and rubenporras and removed request for rubenporras September 8, 2026 09:22
@joaodinissf
joaodinissf force-pushed the codex/simplify-pmd-followup branch from 21e9bae to d708719 Compare September 8, 2026 09:45
Eulan2025
Eulan2025 previously approved these changes Sep 10, 2026
stack merge was automatically disabled September 10, 2026 09:27

Pull Request is not mergeable

Base automatically changed from fix/pmd-7.27-compat to master September 10, 2026 09:37
@joaodinissf
joaodinissf dismissed Eulan2025’s stale review September 10, 2026 09:37

The merge-base changed after approval.

Separate optional cleanup from PMD compatibility fixes. Cover marker-help matching, missing contexts, mismatched pairs, and null-valued entries in the existing aggregate test suite.
@joaodinissf
joaodinissf force-pushed the codex/simplify-pmd-followup branch from d708719 to 6a99368 Compare September 10, 2026 09:43
compare-version-with-baselines compares the sources artifact as well as the
compiled one, so any source change since the published release requires a
version above the baseline. The v19.2.0 release republished the baseline after
the PMD 7.27 work had already been verified, leaving three bundles at their
baseline version with changed sources:

  com.avaloq.tools.ddk.xtext            17.4.0 -> 17.4.1
  com.avaloq.tools.ddk.xtext.expression 17.3.3 -> 17.3.4
  com.avaloq.tools.ddk.test.ui          17.3.3 -> 17.3.4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@joaodinissf
joaodinissf force-pushed the codex/simplify-pmd-followup branch from 3d96c09 to 41288c6 Compare September 10, 2026 09:55
@joaodinissf
joaodinissf merged commit d3b6e08 into master Sep 11, 2026
4 checks passed
@joaodinissf
joaodinissf deleted the codex/simplify-pmd-followup branch September 11, 2026 05:48
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.

2 participants