Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1535

Inconsistency in exceptions thrown from MetaDataRepository.resolve()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.3, 1.1.0, 1.2.2, 2.0.0-beta
    • 1.3.0, 2.0.0-beta3
    • None
    • None
    • Patch Available

    Description

      There is an inconsistency in the way exceptions are thrown from MetaDataRepository.resolve(ClassMetaData).
      If there are more than one error encountered while resolving metadata then all these exceptions are wrapped inside MetaDataException
      and the MetaDataException is thrown. If there is only single exception thrown then that exception is thrown without wrapping inside MetaDataException.

      So, in case of single error encountered any exception ( need not be MetaDataException) is thrown
      but in case of multiple errors encountered MetaDataException is thrown.

      Now, there is a method loadRegisteredClassMetaData() inside same class which calls the above resolve method ( via other method calls).
      This loadRegisteredClassMetaData() catches MetaDataException and logs a warning, which is an expected behavior.
      But as resolve(), in case of a single error , throws an exception other than MetaDataException loadRegisteredClassMetaData() is not
      able to catch this Exception.

      I think this inconsistence behavior has to be fixed inside MetaDataRepository.resolve().

      Attachments

        1. OPENJPA-1535-1.1.x.patch
          1.0 kB
          Ravi Prakash Palacherla
        2. OPENJPA-1535-trunk.patch
          0.9 kB
          Ravi Prakash Palacherla

        Activity

          People

            Unassigned Unassigned
            rpalache Ravi Prakash Palacherla
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: