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,15 +186,17 @@ public class AnalysisUtils {
double probability = 1.0; double probability = 1.0;
if (!similarM.isEmpty()) {
int stickM = 0; int stickM = 0;
for (StickyData stickyData : stickyStuckM) { for (StickyData stickyData : stickyStuckM) {
if (similarM.contains(stickyData)) { if (similarM.contains(stickyData)) {
stickM++; stickM++;
} }
} }
probability *= (stickM / similarM.size()); probability *= (stickM / similarM.size());
}
if (!similarW.isEmpty()) {
int stickW = 0; int stickW = 0;
for (StickyData stickyData : stickyStuckW) { for (StickyData stickyData : stickyStuckW) {
if (similarW.contains(stickyData)) { if (similarW.contains(stickyData)) {
@ -203,6 +205,7 @@ public class AnalysisUtils {
} }
probability *= (stickW / similarW.size()); probability *= (stickW / similarW.size());
}
return probability; return probability;
} }