[ http://jira.codehaus.org/browse/JIBX-75?page=comments#action_43531 ] 

Andreas Brenk commented on JIBX-75:
-----------------------------------

Patching org.jibx.binding.classes.ClassFile.getSuperName() as an experiment to 
read

    public String getSuperName() {
        if (m_curClass == null) {
            return null;
        } else {
            if(m_curClass.getClassName().equals("java.util.SortedSet")) {
                return "java.util.Set";
            } else {
                return m_curClass.getSuperclassName();
            }
        }
    }

fixes the test case as expected. Is this a BCEL bug?

(I also added direction="output" to the binding and removed 
compiler.setSkipValidate(true) from the test case.)

> <collection> does not work with java.util.SortedSet
> ---------------------------------------------------
>
>          Key: JIBX-75
>          URL: http://jira.codehaus.org/browse/JIBX-75
>      Project: JiBX
>         Type: Bug
>   Components: core
>     Versions: CVS
>  Environment: JDK 1.5.0_03
>     Reporter: Andreas Brenk
>  Attachments: SortedSetContainer.java, SortedSetElement.java, 
> SortedSetTest.java, bindingSortedSet0.xml
>
>
> Using java.util.SortedSet for fields and mapping them using <collection> does 
> not work. It produces the following errors:
> Error: add-method add not found in class java.util.SortedSet for collection 
> element at (line 3, col 40, in bindingSortedSet0.xml)
> Error: iter-method iterator not found in class java.util.SortedSet for 
> collection element at (line 3, col 40, in bindingSortedSet0.xml)
> I could already pinpoint the problem:
> org.jibx.binding.classes.ClassFile line 903 (Method[] methods = 
> m_curClass.getMethods();) returns an array containing only the six methods 
> directly defined by the java.util.SortedSet interface and not the methods of 
> its super interface java.util.Set (amongst others add(Object) and 
> iterator()...). So JiBX does not find a match and continues with the 
> superclass. But m_superclass is java.lang.Object, so no match there either.
> I guess the bug is m_superclass being java.lang.Object instead of 
> java.util.Set.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to