The following comment has been added to this issue:

     Author: Ian Phillips
    Created: Thu, 24 Feb 2005 5:23 PM
       Body:
First off, a caveat: I've only just started looking at JiBX and so don't really 
know the code base, plus, I've never used BCEL before, so please bear with me!

I've made some changes to the BindingBuilder so that it can recognise the 
item-type paramater and look for the add-methods and load-methods with the 
correct type. The next step I think is to work on the code generating bit. I'm 
getting this failure when I run the compiler:


Exception in thread "main" java.lang.IllegalStateException: Internal error: 
Expected org.ianp.mx.model.Transport on stack, found java.lang.Object
 full stack:
  0: org.ianp.mx.model.Project
  1: org.ianp.mx.model.Project
  2: java.lang.Object

        at 
org.jibx.binding.classes.MethodBuilder.verifyCompatible(MethodBuilder.java:408)
        at 
org.jibx.binding.classes.MethodBuilder.verifyCallStack(MethodBuilder.java:479)
        at 
org.jibx.binding.classes.MethodBuilder.verifyCallStack(MethodBuilder.java:500)
        at 
org.jibx.binding.classes.MethodBuilder.appendCall(MethodBuilder.java:807)
        at 
org.jibx.binding.def.NestedCollection$AddStore.genStoreItem(NestedCollection.java:658)
        at 
org.jibx.binding.def.NestedCollection.genContentUnmarshal(NestedCollection.java:133)
        at 
org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:153)
// more stack elements omitted...

so it looks to me like the code gen is still trying to use Object. That makes 
sense, and I acn see that in the NestedCollection class there is a field 
holding the store strategy, so I need to try to find where this is getting 
assigned to then I can ensure that the correct ClassItem is used in the 
AddStore constructor call.

I'm going to spend some more time (but not much, I've got a job interview 
tomorrow that I should be revising for!) looking at this, but if anybody who 
knows the code base could give me some pointers that'd be great.
---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/JIBX-48?page=comments#action_30279

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/JIBX-48

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JIBX-48
    Summary: Use item-type as the parameter type of the add-method in collection
       Type: Improvement

     Status: Unassigned
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: JiBX
 Components: 
             core
   Versions:
             1.0-beta3c

   Assignee: 
   Reporter: Juan Carlos Estibariz

    Created: Tue, 2 Nov 2004 5:21 PM
    Updated: Thu, 24 Feb 2005 5:23 PM

Description:
The current implementation only allows java.lang.Object as the parameter type 
for the method specified in the attribute add-method of the element collection.

Instead, it should use the class specified in the attribute item-type (if this 
attribute is not specified it should use java.lang.Object).



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to