JDK-8139844 com.sun.webkit.Timer is never fired if delay is too low
Guru Hb
guru.hb at oracle.com
Thu Nov 12 10:19:08 UTC 2015
Hello Oliver,
Could you please provide info where this problem is seen more often.
OS type, version & 32 / 64 bit
JDK version & 32 / 64 bit. (already mentioned 8u66 and 32 bit in email)
fireTime (argument) value can't go less than "1.0E-9". As you pointed out the problem lies in "Math.ceil(fireTime * 1000)". Initially I have tested on window 7 64 bit and JDK 8u66 64 bit.
Asserting the value if less than 0 in "fwkSetFireTime" would be a temporary solution.
Thanks,
Guru
-----Original Message-----
From: Schmidtmer, Oliver [mailto:O.Schmidtmer at elo.com]
Sent: Wednesday, November 11, 2015 7:06 PM
To: openjfx-dev at openjdk.java.net
Subject: JDK-8139844 com.sun.webkit.Timer is never fired if delay is too low
Hello,
I'm the submitter of JDK-8139844.
A few of our customers are affected by this issue and we can only reproduce it when loading webpages from a specific machine, independent from which machine the client with the web view is started.
As a workaround for our problem and JDK-8091962 I modified com.sun.webkit.Timer.fwkSetFireTime in 1.8.0_65-b17 - 32 bit as following and added some output to the calculations:
private static void fwkSetFireTime(double fireTime) {
long fireTimeMS = (long)Math.ceil(fireTime * 1000);
if(fireTimeMS < 0){
double withoutCast = Math.ceil(fireTime * 1000);
System.err.println( "fireTime=" + fireTime + " before cast=" + withoutCast + " after cast=" + ((long) withoutCast) + " as one step=" + ((long)Math.ceil(fireTime * 1000)) + " original calculation=" + fireTimeMS);
fireTimeMS = 1;
}
getTimer().setFireTime(System.currentTimeMillis() + fireTimeMS);
}
Which produces the following output:
fireTime=1.0E-9 before cast=1.0 after cast=1 as one step=1 original calculation=-9223372036854775808
fireTime=0.03379535675048828 before cast=34.0 after cast=34 as one step=34 original calculation=-9223372036854775808
fireTime=0.042267560958862305 before cast=43.0 after cast=43 as one step=43 original calculation=-9223372036854775808
fireTime=0.04301285743713379 before cast=44.0 after cast=44 as one step=44 original calculation=-9223372036854775808
fireTime=0.041814565658569336 before cast=42.0 after cast=42 as one step=42 original calculation=-9223372036854775808
fireTime=0.03879666328430176 before cast=39.0 after cast=39 as one step=39 original calculation=-9223372036854775808
fireTime=0.04811882972717285 before cast=49.0 after cast=49 as one step=49 original calculation=-9223372036854775808
fireTime=0.0494379997253418 before cast=50.0 after cast=50 as one step=50 original calculation=-9223372036854775808
fireTime=0.04372882843017578 before cast=44.0 after cast=44 as one step=44 original calculation=-9223372036854775808
fireTime=0.04262733459472656 before cast=43.0 after cast=43 as one step=43 original calculation=-9223372036854775808
fireTime=1.0E-9 before cast=1.0 after cast=1 as one step=1 original calculation=-9223372036854775808
fireTime=0.04141855239868164 before cast=42.0 after cast=42 as one step=42 original calculation=-9223372036854775808
fireTime=0.01515507698059082 before cast=16.0 after cast=16 as one step=16 original calculation=-9223372036854775808
fireTime=0.047502994537353516 before cast=48.0 after cast=48 as one step=48 original calculation=-9223372036854775808
It seems this only happens sometimes in the first calculation. Even when the ceiling & cast is done again with the same value it doesn't happen again.
If I can do anything to help sorting this out I will happily do so.
Regards,
Oliver
________________________________
ELO Digital Office GmbH
Firmensitz: T?binger Strasse 43, 70178 Stuttgart
Fon: +49 711 806089-0, Fax: +49 711 806089-19, Web: www.elo.com
Gesch?ftsf?hrer: Karl Heinz Mosbach, Matthias Thiele BW-Bank, Konto-Nr. 2089782, BLZ 600 501 01
IBAN: DE67600501010002089782 BIC: SOLADEST Registergericht Stuttgart HRB 15059 - USt-IdNr.: DE812471516
More information about the openjfx-dev
mailing list