Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-4448

DefaultObjectSupplier fails to instantiate static nested classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5
    • 1.5.5, 1.6.0
    • kernel
    • None

    Description

      The current DefaultObjectSupplier implementation cannot instantiate static nested classes. The problem is that it assumes that if the class to instantiate has a declaring class, it is an inner class. However, according to the Java language specification, an inner class is a nested class, which is not declared in a static context. Thus, in case the nested class is declared static, it is not required to create the parent enclosing instance (and it is not even possible, because the inner class does not have an implicit constructor with a parent instance first parameter)

      See http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.1.3

      Attachments

        1. DefaultObjectSupplier.diff
          0.9 kB
          Detelin Yordanov
        2. stacktrace.txt
          3 kB
          Detelin Yordanov
        3. StaticInnerClassService.aar
          2 kB
          Detelin Yordanov

        Issue Links

          Activity

            People

              veithen Andreas Veithen
              detyo Detelin Yordanov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: