bugMibble MIB Parser - Bugs: bug #16825, Imported mibs implicitly loaded in...

 
 

bug #16825: Imported mibs implicitly loaded in MibLoader.load() are loaded multiple times

Submitted by:  Bernd Sorgenfrei <berndsorgenfrei>
Submitted on:  Mon 12 Jun 2006 06:55:20 AM UTC  
 
Severity:  5 - Major Item Group:  Software
Status:  Fixed Privacy:  Public
Assigned to:  Per Cederberg <cederberg> Open/Closed:  Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 10 Jan 2007 05:52:28 PM UTC, comment #2:

Version 2.8, including a fix for this issue, has been released.

Per Cederberg <cederberg>
Project AdministratorIn charge of this item.
Sun 25 Jun 2006 12:27:47 PM UTC, comment #1:

Again, thanks for the bug report! Your fix seems 100% correct and will be available in 2.8.alpha1.

The cause for this was that the code expected that ArrayList.contains() called equals in the other order, i.e. listItem.equals(obj) and not obj.equals(listItem).

Per Cederberg <cederberg>
Project AdministratorIn charge of this item.
Mon 12 Jun 2006 06:55:20 AM UTC, original submission:

Error is in Mibble 2.7. This causes a higher loading time, more memory usage and MibLoader.getAllMibs() returns duplicate mibs.

The cause is that mibs.contains(String) and mibs.contains(File) return always false. This is because method ArrayList.contains() uses internally String.equals(mibs[xxx]) and File.equals(mibs[xxx]) that can never be true. There are methods MibLoader.getMib(String) and MibLoader.getMib(File) that do the correct behaviour.

Fixes:

(1) The following code in MibLoader.scheduleLoad(String)
if (!mibs.contains(name) && !queue.contains(name))
should be changed to
if (getMib(name) == null && !queue.contains(name))
.

(2) The following code in MibLoader.loadQueue()
else if (!mibs.contains(obj))
should be changed to
else if (getMib((String) obj) == null)
.

(3) The following code in MibLoader.loadQueue()
if (src != null && !mibs.contains(src.getFile()))
should be changed to
if (src != null && getMib(src.getFile()) == null)
.

Example:
---------

Current behaviour:
If the mib IF-MIB is explicitly loaded, these mibs are implicitly loaded multiple times:
- 2x SNMPv2-CONF
- 2x SNMPv2-TC
- 3x SNMPv2-SMI

Bernd Sorgenfrei <berndsorgenfrei>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cederberg (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-01-10 cederberg Open/ClosedOpen => Closed
    2006-06-25 cederberg StatusNone => Fixed
        Assigned toNone => cederberg

    Back to the top


    Powered by Savane 3.4