cederberg / mibble

Mibble is an open-source SNMP MIB parser library for Java.
https://www.mibble.org/
Other
111 stars 69 forks source link

ObjectIdentifierValue.compareTo() should use numerical comparison #13

Closed cederberg closed 10 years ago

cederberg commented 10 years ago

Via email from Matthew Walker:

From Current sorting (since OIDs are treated as Strings) results in inaccuracies like this:

1.3.6.1.2.1.33.1.9.1.0 1.3.6.1.2.1.33.1.9.10.0 1.3.6.1.2.1.33.1.9.2.0

It seems the ObjectIdentifierValue.compareTo() method doesn't perform the proper numerical sorting, but only a simple `toString().compareTo()´.

Oddly enough, it seems that NumberValue.compareTo() is properly implemented with numerical comparison. So it shouldn't be too hard to fix this.

cederberg commented 10 years ago

Also available in 2.10.alpha2 (found at http://www.mibble.org/download/development/index.html)