lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Garland (JIRA)" <j...@apache.org>
Subject [jira] Created: (LUCENE-1553) ConcurrentScheduleManager.addMyself() has wrong inted
Date Thu, 05 Mar 2009 00:45:56 GMT
ConcurrentScheduleManager.addMyself() has wrong inted
-----------------------------------------------------

                 Key: LUCENE-1553
                 URL: https://issues.apache.org/jira/browse/LUCENE-1553
             Project: Lucene - Java
          Issue Type: Bug
    Affects Versions: 2.4
            Reporter: Scott Garland
            Priority: Minor


This method has the wrong index for the 'size' variable, I think it should b allInstances.size.

{code:java}
private void addMyself() {
    synchronized(allInstances) {
      final int size=0;
      int upto = 0;
      for(int i=0;i<size;i++) {
        final ConcurrentMergeScheduler other = (ConcurrentMergeScheduler) allInstances.get(i);
        if (!(other.closed && 0 == other.mergeThreadCount()))
          // Keep this one for now: it still has threads or
          // may spawn new threads
          allInstances.set(upto++, other);
      }
      allInstances.subList(upto, allInstances.size()).clear();
      allInstances.add(this);
    }
  }
{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message