Fixed ArithmetricException in AnalysisUtils #438

This commit is contained in:
Rsl1122 2017-12-02 18:09:05 +02:00
parent 34069d2477
commit b1e82f7ebc

View File

@ -186,23 +186,26 @@ public class AnalysisUtils {
double probability = 1.0;
int stickM = 0;
for (StickyData stickyData : stickyStuckM) {
if (similarM.contains(stickyData)) {
stickM++;
if (!similarM.isEmpty()) {
int stickM = 0;
for (StickyData stickyData : stickyStuckM) {
if (similarM.contains(stickyData)) {
stickM++;
}
}
probability *= (stickM / similarM.size());
}
probability *= (stickM / similarM.size());
int stickW = 0;
for (StickyData stickyData : stickyStuckW) {
if (similarW.contains(stickyData)) {
stickW++;
if (!similarW.isEmpty()) {
int stickW = 0;
for (StickyData stickyData : stickyStuckW) {
if (similarW.contains(stickyData)) {
stickW++;
}
}
}
probability *= (stickW / similarW.size());
probability *= (stickW / similarW.size());
}
return probability;
}