leaningtech / cheerpj-applet-runner

CheerpJ Applet Runner - Chrome Extension to Enable Java Applets
http://www.leaningtech.com/cheerpj
57 stars 3 forks source link

Some java.lang.Math fields give NaN when accessing reflectively #24

Closed ghost closed 5 years ago

ghost commented 5 years ago

Dear Leaningtech,

I am about to complete my test suite. I stepped over an interestig little glitch. My code uses reflection to access some fields. This works most of the time, exception for some fields of java.lang.Math, where I get a NaN, but I should get something else. My code reads:

Object res= field.get(obj);
System.err.println("field="+field+", obj="+obj+", res="+res);
return res;

The expected result is:

field=public static final double java.lang.Math.PI, obj=null, res=3.141592653589793

What happens in CheerpJ is the following:

field=public static final double java.lang.Math.PI, obj=null, res=NaN

ghost commented 5 years ago

Interestingly even the debugger pops up, which I have no explanation for:

unbenannt

The break happens here:

unbenannt2

alexp-sssup commented 5 years ago

This problem should be fixed in CheerpJ Applet Runner 6.7