Closed marschall closed 6 years ago
Hey there, is there any chance that you publish a new artifact for that? We are facing this issue right now.
@MALPI As the MR1 is not complete, please bare with us, there will be a new release if everything was addressed. In the meantime, could you check out the latest SNAPSHOT build of Moneta?
After some analysis I believe I found the issue behind #189. I think the classes have been miscompiled and need to be recompiled and republished. I think what happened here is the following:
Math.multiplyExact(this.number, -1)
, see https://github.com/JavaMoney/jsr354-ri/blob/master/moneta-core/src/main/java/org/javamoney/moneta/FastMoney.java#L396 as you can see aint
rather than along
literal is used.java.lang.Math.multiplyExact(long, long)
, so this one is chosenjava.lang.Math.multiplyExact(long, int)
so this one is chosen.The issue is that he project got compiled on Java 9 with
-source 1.8 -target 1.8
. Unfortunately this is not a safe way to do cross compilation as seen in this example. Before Java 9 you had to follow the rules outlined in Cross-Compilation Options which comes down to using-bootclasspath
. This is not very convenient to use so with Java 9 there is now-release
. It is my option that the project needs to be built either on Java 8 or on Java 9 with-release 8
. Building on Java 9 with-source 1.8 -target 1.8
is not safe.