Uploaded image for project: 'HiveMind'
  1. HiveMind
  2. HIVEMIND-41

No bounds checking in SchemaProcessorImpl stack

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0
    • None
    • framework
    • None

    Description

      org.apache.hivemind.impl.SchemaProcessorImpl aggregates stack functionality along with its other functions. This is achieved by a java.util.List and some public methods.
      Unfortunately, these methods do not perform bounds checking or a way to check the size of thist stack. Java does do this, and throws ArrayIndexOutOfBoundsException, but the resulting exception seen in client code looks like:
      2004-08-06 13:22:31,959 com.cowww.test.commons.hivemind.RegistryFactoryTestCase [ERROR] org.apache.hivemind.ApplicationRuntimeException: Unable to construct configuration cowww.HibernateConfiguration: -1
      java.util.Stack throws an EmptyStackException in this case, which is a lot easier to diagnose without having to check the rootCause.

      My opinion is that:
      1. EmptyStackException is thrown
      2. A method for checking the stack depth is added.
      It may be easier to just use a Stack internally and make the pertinent methods available to calling classes.

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            steve.gibson Steve Gibson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: