[SNMP4J] UsmUserEntry.java question

Frank Fock fock at agentpp.com
Wed Jan 12 21:43:38 CET 2005


Phil,

Thanks for the hint. I overlooked the other changes.
Besides the UsmUserEntry also the UsmUserTable
inner class UsmUserKey.compareTo method needs to
be fixed. The fixed version (1.0.4c) can be now
downloaded from
http://www.snmp4j.org/SNMP4J.zip

Best regards,
Frank

PHIL BERGSTRESSER wrote:

>Frank,
>    It's more than one line in error. 
>    Kenping clearly noted that the second if (else if) has the same
>conditional expression as the first, so it will never be true as coded if
>the first if evaluated to true. Did you see that he expanded the check for
>null pointer on either object into 2 conditional expressions so the return
>result would show +1 or -1 depending on which engine.ID was null.
>    Likely to be unlikely situations, but still in need of repair to make
>sense.
>    HTH,
>Phil
>
>
>-----Original Message-----
>From: Frank Fock [mailto:fock at agentpp.com]
>Sent: Wednesday, January 12, 2005 12:40 PM
>To: kenping
>Cc: snmp4j at agentpp.org
>Subject: Re: [SNMP4J] UsmUserEntry.java question
>
>
>Hi Kenping,
>
>Yes, well observed, it's obviously a bug.
>The correct line should read:
>
>result = engineID.compareTo(other.engineID);
>
>A patch release will be available for download
>soon. Many thanks for reporting the bug!
>
>Best regards,
>Frank
>
>kenping wrote:
>
>  
>
>>Hi,
>>   Has there a bug in UsmUserEntry.java at line 135 ?:
>>
>>   if ((engineID != null) && (other.engineID != null)) {
>>     engineID.compareTo(other.engineID);   <----- ???
>>   }
>>   else if ((engineID != null) && (other.engineID != null)) {
>>     result = 1;
>>   }
>>
>>   I changed it to follows:
>>
>>   if ((engineID != null) && (other.engineID != null)) {
>>     result = engineID.compareTo(other.engineID);
>>   }
>>   else if ((engineID != null) && (other.engineID == null)) {
>>     result = 1;
>>   }
>>   else if ((engineID == null) && (other.engineID != null)) {
>>     result = -1;
>>   }
>>
>>   Is it correct?
>>
>>thanks for all.
>>yours kenping
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>SNMP4J mailing list
>>SNMP4J at agentpp.org
>>http://p15141779.pureserver.info/mailman/listinfo/snmp4j
>> 
>>
>>    
>>
>
>
>_______________________________________________
>SNMP4J mailing list
>SNMP4J at agentpp.org
>http://p15141779.pureserver.info/mailman/listinfo/snmp4j
>
>  
>





More information about the SNMP4J mailing list