Unregister a managed object will call "public void unregister(ManagedObject mo, 
OctetString context)" (DefaultMOServer.java).
This will remove the mo from registry (treemap) with "registry.remove(key);"

The problem is the comperator from the treemap registry will call: 
"compareContextScope(MOScope scope, MOContextScope scope2)"
In this function it will compare first the upperbound and if it is the same it 
will do:
if (result == 0) {
          result = scope.getUpperBound().compareTo(scope2.getLowerBound());

and this is always 1 so the result is always -1 or 1 even if it is exact the 
same scope. So it will never be removed from registry.

If you unregister without context (context==null) the compare function:
result = o1.getLowerBound().compareTo(o2.getLowerBound());
will return 0 and it will be removed from registry.

_______________________________________________
SNMP4J mailing list
[email protected]
http://oosnmp.net/mailman/listinfo/snmp4j

Reply via email to