Uploaded image for project: 'Pax Logging'
  1. Pax Logging
  2. PAXLOGGING-27

IndexOutOfBoundsException in EventAdminTracker

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-RC2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Occasionally, we get the following exception:

      java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      at java.util.LinkedList.entry(LinkedList.java:365)
      at java.util.LinkedList.remove(LinkedList.java:357)
      at org.ops4j.pax.logging.EventAdminTracker.deliver(EventAdminTracker.java:94)
      at org.ops4j.pax.logging.EventAdminTracker.postEvent(EventAdminTracker.java:56)

      The fix is trivial, i think: in the EventAdminTracker.deliver, a (synchronized!) check on the queue size is missing:

      while( m_queue.size() > 0 )
      {
      Event event;
      synchronized( m_queue )

      { event = (Event) m_queue.remove( 0 ); }

      }

        Attachments

          Activity

            People

            • Assignee:
              niclas@hedhman.org Niclas Hedhman
              Reporter:
              peter.doornbosch@gmail.com Peter Doornbosch
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: