axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (JIRA)" <>
Subject [jira] Assigned: (AXIS2-4235) DefaultObjectSupplier cannot attach inner classes to the proper enclosing class instance
Date Sun, 26 Jul 2009 19:23:14 GMT


Andreas Veithen reassigned AXIS2-4235:

    Assignee: Andreas Veithen

> DefaultObjectSupplier cannot attach inner classes to the proper enclosing class instance
> ----------------------------------------------------------------------------------------
>                 Key: AXIS2-4235
>                 URL:
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb, kernel
>    Affects Versions: 1.5, 1.4.1, 1.4
>            Reporter: Detelin Yordanov
>            Assignee: Andreas Veithen
> Тhe default implementation of the ObjectSupplier interface is not capable of creating
inner classes and attaching them to an already created parent instance. For example, suppose
we have the following class hierarchy:
> class Parent {
>   String name;
>   get/setName() { .. }
>   class Inner {
>       String innerName;
>    }
> }
> Transformed into XML, thiis should look sth. like:
> <Parent>
>    <name>ParentName</name>
>    <Inner>
>        <innerName>InnerName</innerName>
>    </Inner>
> </Parent>
> When ADB is parsing this, it will first invoke the ObjectSupplier requesting an instance
of Parent.class, the created instance will be populated, setting its
> name to "ParentName".
> Then, ADB will proceed to create the Inner class instance, however now it will not use
the already created Parent, but will create a new one (see DefaultObjectSupplier#getObject(..)).
Thus the Inner class instance will have an internal reference to a newly initialized Parent
instance, rather than to the already initialized and populated Parent instance. This means
that the Inner class will see the Parent's name field as null, instead as "ParentName".
> A possible, but not backward compatible solution would be to extend the ObjectSupplier
interface (or create a new interface) adding a new method:
> public Object getObject(Object parentObj, Class clazz)
> The method should use the provided parentObj instance if the given "clazz" is an inner
class and "parentObj" is an instance of its enclosing class.
> The other change would be to modify the ADB BeanUtil and pass the corresponding parent
instance on each call to the ObjectSupplier.
> If this solution is acceptable, I could provide a patch.
> Regards,
>    Detelin

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message