Skip to content

Address PR review feedback: fix indentation, resource leak, test naming#361

Merged
bedaHovorka merged 2 commits into
feature/backlog_2026_02from
copilot/sub-pr-358
Feb 7, 2026
Merged

Address PR review feedback: fix indentation, resource leak, test naming#361
bedaHovorka merged 2 commits into
feature/backlog_2026_02from
copilot/sub-pr-358

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 7, 2026

Addresses 5 code review comments from PR #358 review thread.

Changes

Code Style

  • GridStoragePerformance.kt: Convert space indentation to tabs (lines 34-87) per .editorconfig

Resource Management

  • MenuBar.kt: Add context.close() when user cancels validation dialog to prevent AutoCloseable resource leak

Test Accuracy

  • TrainReverseDirectionTest.kt: Rename class and tests to reflect testing Timetable.reverseDirection() (data swap) not Train.reverseDirection() (includes hold(30.0) simulation delay)
  • XMLContextFactoryLenientTest.kt: Update test name and comments to reflect minimum 1 InOut requirement after bidirectional train support (was 2)

Grammar

  • XMLPolishTest.kt: Fix test name grammar "exactly one InOuts is valid" → "exactly one InOut is valid"

Example: Resource Leak Fix

if (dialogResult == ValidationDialog.DialogResult.OPEN_ANYWAY) {
    frame.setContext(context)
    frame.modificationTracker.setCurrentFile(selectedFile)
    frame.modificationTracker.markClean()
} else {
    // User cancelled - close context to avoid resource leak
    context.close()
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…ng, and documentation

Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with backlog 2026 Address PR review feedback: fix indentation, resource leak, test naming Feb 7, 2026
Copilot AI requested a review from bedaHovorka February 7, 2026 04:49
@bedaHovorka bedaHovorka marked this pull request as ready for review February 7, 2026 04:55
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Feb 7, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@bedaHovorka bedaHovorka merged commit 9deb731 into feature/backlog_2026_02 Feb 7, 2026
6 of 7 checks passed
@bedaHovorka bedaHovorka deleted the copilot/sub-pr-358 branch February 7, 2026 05:01
bedaHovorka added a commit that referenced this pull request Feb 7, 2026
…ng (#361)

* Address PR review comments: fix indentation, resource leak, test naming, and documentation

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
bedaHovorka added a commit that referenced this pull request Feb 7, 2026
…ng (#361)

* Address PR review comments: fix indentation, resource leak, test naming, and documentation

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
bedaHovorka added a commit that referenced this pull request Feb 7, 2026
…ode Quality (#358)

  Major enhancements across bidirectional train support, dependency injection                                                                                                                                      
  testing, context system validation, and code quality.

  Key Features:
  - Bidirectional train operation with single-InOut network support
  - PathResult sealed class for permanent vs temporary path unavailability
  - PropertyChangeEvents on BaseContext property setters
  - Comprehensive context transformation validation

  Testing & Performance:
  - Koin scope lifecycle tests for scope-per-context pattern
  - JMH performance benchmarks for Koin and Array2DMap
  - 2,249 tests (2,229 passing, 20 skipped, 0 failing)
  - 51% code coverage maintained

  API Improvements:
  - Kotlin property accessors for Train public API
  - Modifiable EntrySet operations (remove, removeAll, retainAll, clear)
  - HashMapGraph collection optimization with unmodifiable views
  - Remove unused parameters from navigation services

  Code Quality:
  - Detekt compliance (unused imports, PhysicsConstants migration)
  - Fix indentation, resource leaks, test naming
  - Document internal test accessors with state verification
  - Lenient XML validation for editor mode

  Data Structure Refinements:
  - Remove lazy track wrapper creation for consistency
  - Optimize collection methods with unmodifiable views

  Bug Fixes:
  - Correct NavigationModuleKoinTest assertion for InOut path reservation

  Zero regressions. All changes follow conservative approach per CLAUDE.md.

  Resolves #261, #336, #337, #338, #339, #340, #342, #343, #345, #346,
  #350, #352, #353, #356, #359, #360, #361

  Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>

  This commit message:
  - ✅ Includes all 17 issues
  - ✅ Groups changes by category (Features, Testing, API, Quality, etc.)
  - ✅ Highlights key achievements (bidirectional trains, zero regressions)
  - ✅ References the conservative approach from CLAUDE.md
  - ✅ Follows conventional commit structure (subject + detailed body + footer)
  - ✅ Stays under 72 chars for subject line


Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
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