Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5263

java.lang.ArrayIndexOutOfBoundsException: -1

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Resolver
    • None

    Description

      In a specific scenario where duplicate resources are provided to the resolver it produces the error bellow:

      java.lang.ArrayIndexOutOfBoundsException: -1
      	at org.apache.felix.resolver.util.CopyOnWriteList.set(CopyOnWriteList.java:57)
      	at org.apache.felix.resolver.Candidates.prepare(Candidates.java:946)
      	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:232)
      	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:179)
      	at biz.aQute.resolve.ResolverValidator.resolve(ResolverValidator.java:124)
      	at biz.aQute.resolve.ResolverValidator.validateResources(ResolverValidator.java:81)
      	at biz.aQute.resolve.ResolverValidator.validate(ResolverValidator.java:75)
      	at biz.aQute.resolve.ValidatorTest.testDuplicateIndexAgainstLargeTargetPlatform_whyDoesThisFail(ValidatorTest.java:188)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at junit.framework.TestCase.runTest(TestCase.java:176)
      	at junit.framework.TestCase.runBare(TestCase.java:141)
      	at junit.framework.TestResult$1.protect(TestResult.java:122)
      	at junit.framework.TestResult.runProtected(TestResult.java:142)
      	at junit.framework.TestResult.run(TestResult.java:125)
      	at junit.framework.TestCase.run(TestCase.java:129)
      	at junit.framework.TestSuite.runTest(TestSuite.java:255)
      	at junit.framework.TestSuite.run(TestSuite.java:250)
      	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
      	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      

      Since the reproduction is complex I've provided one as a unit test in a PR to the bnd project. https://github.com/bndtools/bnd/pull/1472

      Attachments

        Activity

          People

            Unassigned Unassigned
            rotty3000 Raymond Augé
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: