Skip to content
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

[50.02] NumberFormatException in MekHQ on refurbishing a canon unit to a custom unit #5607

Open
7 tasks done
mwberlindeu opened this issue Jan 2, 2025 · 4 comments
Open
7 tasks done
Assignees
Labels
Severity: Low Issues described as low severity as per the new issue form

Comments

@mwberlindeu
Copy link

Prerequisites and Pre-Issue Checklist

  • I'm reporting the issue to the correct repository:

  • MegaMek

  • MegaMekLab

  • MekHQ

  • I've tested the issue against at least the latest MILESTONE version

  • I've asked on the MegaMek Discord about the error

  • I've reviewed the BattleTech rules and MekHQ documentation, and I've confirmed that something isn't working as intended.

  • I've searched the Github tracker and haven't found the issue listed

Severity *

Low (Minor/Nuisance): Minor glitches or cosmetic issues that don’t affect gameplay and occur rarely.

Brief Description *

I customized a unit (Rock Rover Half-Track RRV). The unit validates correctly in MegaMekLab, loads in MegaMek and is playable but I cannot refurbish the canon unit to the custom unit in MekHQ. A NumberFormatException is raised when I GM the completion of the customization.

15:39:57,460 ERROR [mekhq.MekHQ] {AWT-EventQueue-0}
mekhq.MekHQ.lambda$main$1(MekHQ.java:296) - Uncaught java.lang.NumberFormatException detected. Please open up an issue containing all logs, the game save file, and customs at https://github.com/MegaMek/megamek/issues . If Sentry is enabled, the error has also been logged.
java.lang.NumberFormatException: Character I is neither a decimal digit number, decimal point, nor "e" notation exponential mark.
at java.base/java.math.BigDecimal.(BigDecimal.java:608)
at java.base/java.math.BigDecimal.(BigDecimal.java:497)
at java.base/java.math.BigDecimal.(BigDecimal.java:903)
at mekhq.campaign.CampaignSummary.getCargoCapacityReport(CampaignSummary.java:291)
at mekhq.gui.CommandCenterTab.refreshBasicInfo(CommandCenterTab.java:604)
at mekhq.gui.ActionScheduler.lambda$new$0(ActionScheduler.java:46)
at java.desktop/javax.swing.Timer.fireActionPerformed(Timer.java:311)
at java.desktop/javax.swing.Timer$DoPostEvent.run(Timer.java:243)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:191)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:236)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:234)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:234)
at java.desktop/java.awt.Dialog.show(Dialog.java:1079)
at java.desktop/javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:881)
at java.desktop/javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:677)
at java.desktop/javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:648)
at megamek.logging.MMLogger.error(MMLogger.java:203)
at mekhq.MekHQ.lambda$main$1(MekHQ.java:296)
at java.base/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:695)
at java.base/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
at java.desktop/java.awt.EventDispatchThread.processException(EventDispatchThread.java:218)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:210)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

15:40:00,755 ERROR [mekhq.MekHQ] {AWT-EventQueue-0}
mekhq.MekHQ.lambda$main$1(MekHQ.java:296) - Uncaught java.lang.NumberFormatException detected. Please open up an issue containing all logs, the game save file, and customs at https://github.com/MegaMek/megamek/issues . If Sentry is enabled, the error has also been logged.
java.lang.NumberFormatException: Character N is neither a decimal digit number, decimal point, nor "e" notation exponential mark.
at java.base/java.math.BigDecimal.(BigDecimal.java:608)
at java.base/java.math.BigDecimal.(BigDecimal.java:497)
at java.base/java.math.BigDecimal.(BigDecimal.java:903)
at java.base/java.math.BigDecimal.valueOf(BigDecimal.java:1371)
at org.joda.money.BigMoney.of(BigMoney.java:118)
at mekhq.campaign.finances.Money.of(Money.java:50)
at mekhq.campaign.finances.Money.of(Money.java:54)
at mekhq.campaign.parts.equipment.InfantryAmmoBin.getPricePerTon(InfantryAmmoBin.java:198)
at mekhq.campaign.parts.equipment.AmmoBin.getStickerPrice(AmmoBin.java:179)
at mekhq.campaign.parts.Part.getActualValue(Part.java:238)
at mekhq.campaign.unit.Unit.lambda$getSellValue$2(Unit.java:1179)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at mekhq.campaign.unit.Unit.getSellValue(Unit.java:1180)
at mekhq.campaign.finances.FinancialReport.lambda$calculate$0(FinancialReport.java:146)
at mekhq.campaign.Hangar.lambda$forEachUnit$0(Hangar.java:117)
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:986)
at mekhq.campaign.Hangar.forEachUnit(Hangar.java:117)
at mekhq.campaign.finances.FinancialReport.calculate(FinancialReport.java:145)
at mekhq.gui.FinancesTab.getFormattedFinancialReport(FinancesTab.java:390)
at mekhq.gui.FinancesTab.lambda$refreshFinancialReport$4(FinancesTab.java:382)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:191)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:236)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:234)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:234)
at java.desktop/java.awt.Dialog.show(Dialog.java:1079)
at java.desktop/javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:881)
at java.desktop/javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:677)
at java.desktop/javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:648)
at megamek.logging.MMLogger.error(MMLogger.java:203)
at mekhq.MekHQ.lambda$main$1(MekHQ.java:296)
at java.base/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:695)
at java.base/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
at java.desktop/java.awt.EventDispatchThread.processException(EventDispatchThread.java:218)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:210)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:191)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:236)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:234)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:234)
at java.desktop/java.awt.Dialog.show(Dialog.java:1079)
at java.desktop/javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:881)
at java.desktop/javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:677)
at java.desktop/javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:648)
at megamek.logging.MMLogger.error(MMLogger.java:203)
at mekhq.MekHQ.lambda$main$1(MekHQ.java:296)
at java.base/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:695)
at java.base/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
at java.desktop/java.awt.EventDispatchThread.processException(EventDispatchThread.java:218)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:210)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Steps to Reproduce

  1. Add custom unit to MekHQ
  2. Refurbish unit to custon unit
  3. Initiate completion of customization (GM)

Operating System *

Windows 11

Java Version *

21.0.2

MekHQ Suite Version *

Free Text (type manually)

Custom MekHQ Version

50.02

Attach Files

mekhq.log

Rock Rover Half-Track RRV Mk.2 - Hunting Hellhounds.zip

Final Checklist

  • I've checked to make sure that this issue has not already been filed
  • I'm reporting only one issue in this ticket for clarity and focus
@Sleet01
Copy link
Collaborator

Sleet01 commented Jan 2, 2025

I believe I know where the issue is; I'll see what I can do.

@Sleet01 Sleet01 self-assigned this Jan 2, 2025
@Sleet01
Copy link
Collaborator

Sleet01 commented Jan 3, 2025

@mwberlindeu Would it be possible to get a copy of your campaign from around the time you hit this error, zipped and uploaded?

@mwberlindeu
Copy link
Author

Here they are (unfortunately the files are large and unwieldy).

custom.zip
Hunting Hellhounds30560203foundry.cpnx.gz.zip

@Sleet01
Copy link
Collaborator

Sleet01 commented Jan 3, 2025

@mwberlindeu
Gracias, I'll try to get to this soon.

@HammerGS HammerGS added the Severity: Low Issues described as low severity as per the new issue form label Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Severity: Low Issues described as low severity as per the new issue form
Projects
None yet
Development

No branches or pull requests

3 participants