You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've implemented a particle animation using this library, but I keep getting this exceptions from time to time. Here is the stacktrace from the exception I got from the exception.
E/AndroidRuntime﹕ FATAL EXCEPTION: Timer-28
java.lang.IllegalArgumentException
at java.util.Random.nextInt(Random.java:187)
at com.plattysoft.leonids.ParticleSystem.getFromRange(ParticleSystem.java:536)
at com.plattysoft.leonids.ParticleSystem.activateParticle(ParticleSystem.java:524)
at com.plattysoft.leonids.ParticleSystem.onUpdate(ParticleSystem.java:544)
at com.plattysoft.leonids.ParticleSystem.access$1(ParticleSystem.java:539)
at com.plattysoft.leonids.ParticleSystem$1.run(ParticleSystem.java:363)
at java.util.Timer$TimerImpl.run(Timer.java:284)
I did search trough Random class and I found only one IllegalArgumentException from the whole class in the method nextInt(int n).
/**
* Returns a pseudo-random uniformly distributed {@code int}
* in the half-open range [0, n).
*/
public int nextInt(int n) {
if (n <= 0) {
throw new IllegalArgumentException("n <= 0: " + n);
}
if ((n & -n) == n) {
return (int) ((n * (long) next(31)) >> 31);
}
int bits, val;
do {
bits = next(31);
val = bits % n;
} while (bits - val + (n - 1) < 0);
return val;
}
The text was updated successfully, but these errors were encountered:
Hi,
I've implemented a particle animation using this library, but I keep getting this exceptions from time to time. Here is the stacktrace from the exception I got from the exception.
E/AndroidRuntime﹕ FATAL EXCEPTION: Timer-28
java.lang.IllegalArgumentException
at java.util.Random.nextInt(Random.java:187)
at com.plattysoft.leonids.ParticleSystem.getFromRange(ParticleSystem.java:536)
at com.plattysoft.leonids.ParticleSystem.activateParticle(ParticleSystem.java:524)
at com.plattysoft.leonids.ParticleSystem.onUpdate(ParticleSystem.java:544)
at com.plattysoft.leonids.ParticleSystem.access$1(ParticleSystem.java:539)
at com.plattysoft.leonids.ParticleSystem$1.run(ParticleSystem.java:363)
at java.util.Timer$TimerImpl.run(Timer.java:284)
I did search trough Random class and I found only one IllegalArgumentException from the whole class in the method
nextInt(int n)
.The text was updated successfully, but these errors were encountered: