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

StringIndexOutOfBoundsException errors, possibly a problem loading Mission Equipment Storage #681

Closed
assaultdoor opened this issue Jul 20, 2020 · 2 comments · Fixed by MegaMek/megamek#2075

Comments

@assaultdoor
Copy link

Using MML 0.47.7 on OS X with Java build 1.8.0_51-b16, I get the following error in the logs:

Error parsing null!
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1967)
at megamek.common.loaders.BLKFile.getLegacyVariableSize(BLKFile.java:119)
at megamek.common.loaders.BLKBattleArmorFile.loadEquipment(BLKBattleArmorFile.java:261)
at megamek.common.loaders.BLKBattleArmorFile.getEntity(BLKBattleArmorFile.java:158)
at megamek.common.MechFileParser.parse(MechFileParser.java:204)
at megamek.common.MechFileParser.(MechFileParser.java:85)
at megamek.common.MechFileParser.(MechFileParser.java:77)
at megamek.common.MechSummaryCache.loadMechsFromDirectory(MechSummaryCache.java:565)
at megamek.common.MechSummaryCache.loadMechsFromDirectory(MechSummaryCache.java:524)
at megamek.common.MechSummaryCache.loadMechData(MechSummaryCache.java:237)
at megamek.common.MechSummaryCache.lambda$getInstance$0(MechSummaryCache.java:86)
at java.lang.Thread.run(Thread.java:748)

This may or may not be related to a similar error I get when loading any BA design created under an older version of MML that used the old fixed-weight "Mission Equipment Storage" equipment:
*** Unable to load file: megamek.common.loaders.EntityLoadingException: Exception from class java.lang.StringIndexOutOfBoundsException: Str$
at megamek.common.MechFileParser.(MechFileParser.java:94)
at megamek.common.MechFileParser.(MechFileParser.java:77)
at megamek.common.MechSummaryCache.loadMechsFromDirectory(MechSummaryCache.java:565)
at megamek.common.MechSummaryCache.loadMechsFromDirectory(MechSummaryCache.java:524)
at megamek.common.MechSummaryCache.loadMechData(MechSummaryCache.java:237)
at megamek.common.MechSummaryCache.lambda$getInstance$0(MechSummaryCache.java:86)
at java.lang.Thread.run(Thread.java:748)

MML simply refuses to load anything with Mission Equipment Storage unless I manually edit the file to add the size.

@neoancient
Copy link
Member

Provide unit file(s) per reporting instructions.

@assaultdoor
Copy link
Author

I have no idea which units cause "Error parsing null!" I get eight of those errors in the logs immediately after an error about the modular weapons quirk on the Taranis and immediately before an error about modular weapons on the Nagasawa, but no unit is named.

For the Mission Equipment Storage, it appears to be literally any unit with Mission Equipment Storage that does not have :SIZE: information, such as this one.

NewBattleArmor.txt

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 a pull request may close this issue.

2 participants