Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3416

Iterator returned by MetaClassRegistryImpl.iterator() throws ArrayIndexOutOfBoundsException upon call to hasNext() if registry is empty

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.6
    • 1.6.1, 1.7-beta-1
    • None
    • None
    • Mac OS

    Description

      MetaClassRegistryImpl.java - Line 397 (iterator() $ Iterator.hasNext()): currentMeta= refs[index];

      import static org.junit.Assert.assertFalse;
      import groovy.lang.MetaClassRegistry;
      
      import org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl;
      import org.junit.Test;
      
      public class MetaClassRegistryImplTest {
      	@Test
      	public void testIteratorHasNext() {
      		MetaClassRegistry registry = new MetaClassRegistryImpl();
      		assertFalse(registry.iterator().hasNext());
      	}
      }
      

      Attachments

        1. 3416_16x.txt
          0.9 kB
          Roshan Dawrani

        Activity

          People

            roshandawrani Roshan Dawrani
            peter.rietzler@smarter-ecommerce.com Peter Rietzler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: