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

Examples not working if running with a locale different from en #3

Open
cecchisandrone opened this issue Jan 16, 2019 · 0 comments
Open

Comments

@cecchisandrone
Copy link

I'm running examples on a machine with italian locale and examples don't work. In particular, MockDataProducer is not able to generate data, due to the generation with a different decimal separator. This is the stacktrace:

java.lang.NumberFormatException: For input string: "262,00"
	at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
	at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
	at java.lang.Double.parseDouble(Double.java:538)
	at bbejeck.util.datagen.DataGenerator.generatePurchases(DataGenerator.java:96)
	at bbejeck.clients.producer.MockDataProducer.lambda$producePurchaseData$0(MockDataProducer.java:68)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
	at java.util.concurrent.FutureTask.run(FutureTask.java)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Also it has been very hard to debug since that code is wrapped in a task run with ExecutorService and exception is not thrown.
The solution anyway is to add the following JVM parameters: -Duser.country=US -Duser.language=en

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

No branches or pull requests

1 participant