Gendustry

Gendustry

35M Downloads

Crash from toUppercase() selecting the wrong enum

mezz opened this issue · 6 comments

commented

Gendustry is trying to access an enum that doesn't exist
https://gist.github.com/mezz/ec712ee920c7dc24269d

notice the dots over the capital Is in HUMİDİTY_TOLERANCE

Probably needs to be done with an english locale.
from here
https://github.com/bdew/gendustry/blob/mc1710/src/net/bdew/gendustry/custom/BeeSpecies.scala#L170

commented

It also seems to break many other mods (e.g. CoFH/Feedback#772)

commented

Nice, thanks bdew!

commented

All issues with Turkish locale should be fixed in Gendustry, Advanced Generators and Pressure Pipes now

commented

That's... interesting. The letter seems to be U+0130 (capital letter i with dot above).

What locale are you using that translates (i -> İ) out of curiosity?

Edit: I assume it happens with the default config?

commented

I'm not sure, it was reported to me by JadedCat and this is my best guess.
It may be because Forestry's enum's .getName() do a toLowerCase() without locale. I'm not sure how (or why) you are converting between strings and enums since I'm not very literate in scala.

The only solution I found is here: http://support.feed-the-beast.com/t/ftb-infinitiy-crash/10438

I have the exact same problem I tried downloading the latest versions of forestry, gendustry and bdlib and I still get the same crash log. I use java version 8 update 40. If anyone could help it would be great.

Edit: I have figured it out. My windows language is not English so I had to add some additional java parameters.

On the launcher go to Options tab
Select Advanced Options
On the Additional Java Parameters box paste in this: -Duser.language=en -Duser.country=US
Have fun!

Here's some of the same crash reported elsewhere:
http://openeye.openmods.info/crashes/e4ea8d7c34470d7f95a25eae7dc5245b

http://www.minecraftforum.net/forums/support/modded-client-support/2402949-hellp-the-1-7-10-pack-crashes-technic-launcher

http://www.minecraftforum.net/forums/support/modded-client-support/2410203-magic-farm-3-curse-crash

commented

I've managed to reproduce the original crash using turkish locale (thanks to Wikipedia for the hint :P)

The fix above seems to solve it, but there are also a bunch of bugs happening because of toLowerCase as well (I -> ı).

It may be because Forestry's enum's .getName() do a toLowerCase() without locale.

I don't think it's related to this issue, but it will probably break something somewhere if there are capital I's in anything (which will become dotless lowercase i in turkish locale)

I'm not sure how you are converting between strings and enums since I'm not very literate in scala.

By passing the uppercased string to Enum.valueOf (which is part of the JVM i guess)

or why

Because i'm reading species and mutation definitions from a (user-editable) text file and need to translate chromosome names, humidity and temperatures to their enums.