Bug in OpdfInteger.clone()

10 views
Skip to first unread message

Sadegh D.

unread,
Jul 29, 2011, 8:31:00 AM7/29/11
to Jahmm HMM library
Thanks for the great package...

The method: be.ac.ulg.montefiore.run.jahmm.OpdfInteger.clone() is
buggy since it doesn't clone the probabilities arrary.

Buggy code:

public OpdfInteger clone()
{
try {
return (OpdfInteger) super.clone();
} catch(CloneNotSupportedException e) {
throw new AssertionError(e);
}
}

Possible fix:

public OpdfInteger clone()
{
try {
OpdfInteger opdf = (OpdfInteger)
super.clone();
opdf.probabilities = probabilities.clone();
} catch(CloneNotSupportedException e) {
throw new AssertionError(e);
}
}

Regards,
Sadegh

Sadegh Dorri N.

unread,
Jul 29, 2011, 8:33:58 AM7/29/11
to Jahmm HMM library
Sorry, I forgot to return opdf...
Reply all
Reply to author
Forward
0 new messages