Re: [Asterisk-java-users] Possible bug in actionid generation?
Brought to you by:
srt
From: Stefan R. <sr...@re...> - 2005-04-21 23:36:35
|
On Thu, 2005-04-21 at 18:05 -0500, Chad Kitching wrote: > I'm sure I'll get harassed for this, but no not at all, we all get enough harassment from the pure c folks implementing asterisk :) > I converted some of asterisk-java to C#, and in the process, > I may have run across a possible bug. do you plan to release your port as open source? > DefaultManagerConnection uses the hashcode of the object in > createInternalActionId, however, the Java specs do not specify that > hashcodes must be positive, so if a VM provides a negative value for > this function, Util.{get,strip}InternalActionId will fail to work, and > will return null. Yes you are right. Though I didn't encounter any negative hash codes yet... > Either a different separator between the internal > actionid and the object actionid needs to be used, or the util functions > should perhaps start scanning at the second character instead of the first. I fixed in in CVS and replaced the delimiter with a '#'. > Now, I have no idea if any JVM is actually affected by this, and my > conversion job worked fine on Microsoft's CLR, but failed on Mono > because of the hashing implementation differences. Yep - as I said i never encountered in on Sun's JVM or JRockit but the spec clearly allows any int. Thanks for your hint. =Stefan |