8000 Fix: #7017 Fixed Mass Repair Dialog Throwing Error in Warehouse by IllianiBird · Pull Request #7018 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: #7017 Fixed Mass Repair Dialog Throwing Error in Warehouse #7018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 16, 2025

Conversation

IllianiBird
Copy link
Collaborator
@IllianiBird IllianiBird commented May 15, 2025

Fix #7017

This data should initialize as part of the object initialization but, for some reason, isn't. So now we explicitly initialize it within MRMS removing the error.

@IllianiBird IllianiBird self-assigned this May 15, 2025
@IllianiBird IllianiBird requested a review from a team as a code owner May 15, 2025 21:28
@IllianiBird IllianiBird added Bug Mass Repair/Mass Salvage Any issue around MSRS Severity: High Issues described as high severity as per the new issue form labels May 15, 2025
Copy link
codecov bot commented May 15, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 12.03%. Comparing base (f58a24d) to head (a099e53).
Report is 26 commits behind head on master.

Files with missing lines Patch % Lines
MekHQ/src/mekhq/gui/dialog/MRMSDialog.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #7018   +/-   ##
=========================================
  Coverage     12.03%   12.03%           
- Complexity     6882     6886    +4     
=========================================
  Files          1102     1102           
  Lines        142171   142198   +27     
  Branches      21976    21985    +9     
=========================================
+ Hits          17115    17119    +4     
- Misses       123221   123245   +24     
+ Partials       1835     1834    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HammerGS HammerGS requested a review from Copilot May 16, 2025 00:02
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses error #7017 by explicitly initializing the parts data in the MRMS Dialog to prevent errors when the Mass Repair Dialog is displayed.

  • Explicitly initializes partsTableModel's data with an empty ArrayList
  • Ensures the GUI component (partsTable) is constructed with an initialized model

@@ -395,6 +395,7 @@ private JPanel createPartsPanel() {
"PartsPanel.title")), BorderFactory.createEmptyBorder(5, 5, 5, 5)));

partsTableModel = new PartsTableModel();
partsTableModel.setData(new ArrayList<>());
Copy link
Preview
Copilot AI May 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this explicit initialization resolves the error, consider moving the data initialization to the PartsTableModel constructor to encapsulate the default state and reduce dependency on external initialization in the UI logic.

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not relevant

@HammerGS HammerGS merged commit 2cf0296 into MegaMek:master May 16, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Mass Repair/Mass Salvage Any issue around MSRS Severity: High Issues described as high severity as per the new issue form
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Mass Repair Function in parts warehouse non-functional
2 participants
0