[SNMP4J] UsmUserEntry.java question

kenping kenping at os.org.cn
Thu Jan 13 12:26:00 CET 2005


Hi, frank
    It seems there is a new bug in the Snmp.java at line 712:
  public void send(PDU pdu, Target target,
                   Object userHandle,
                   ResponseListener listener) throws IOException {
    send(pdu, target, userHandle, listener);  <---- the recursion will go 
for ever...
  }
thanks for al.
yours kenping

----- Original Message ----- 
From: "Frank Fock" <fock at agentpp.com>
To: "PHIL BERGSTRESSER" <phil.bergstresser at adtran.com>
Cc: "kenping" <kenping at os.org.cn>; <snmp4j at agentpp.org>
Sent: Thursday, January 13, 2005 4:43 AM
Subject: Re: [SNMP4J] UsmUserEntry.java question


> 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