users@jaxb.java.net

Re: Problems with substitutionGroup

From: Vivian Steller <vivian.steller_at_informatik.uni-ulm.de>
Date: Wed, 26 Jan 2005 22:58:22 +0100

Am Mittwoch, 26. Januar 2005 17:37 schrieb Kohsuke Kawaguchi:
> Vivian Steller wrote:
> > Now, I perfom the following code, resulting in a strange behaviour:
> >
> > ################# CODE ##################
> > SystemProfileDiagram dia = (SystemProfileDiagram)
> > diagramFactory.createSystemProfileDiagram();
> >
> > Diagrams dias = (Diagrams) project.getDiagrams();
> > List diagramList = dias.getDiagram();
> > diagramList.add(dia);
> >
> > System.out.println(diagramList.size());
> > System.out.println(project.getDiagrams().getDiagram().size());
> > ################# CODE ##################
> >
> > The output made by printlns is:
> > ################# OUTPUT ##################
> > 1 // that's still right
> > 0 // something went wrong... :(
> > ################# OUTPUT ##################
>
> Is your "diagramList" and "project.getDiagrams().getDiagram()" the same
> object?
>
> If you could file a bug with the schema plus the test case, we'd like to
> take a look.

Thanks very much for your reply.
I got behind the problem (not a jaxb bug, but a coding error of mine), but
maybe this information is helpful for others...

in the given code snippet (see below) the Diagrams implementation class was
customized so that getDiagrams() returns an object of type DiagramsAdapter.
In this class I overloaded the (jaxb generated) method getDiagram(). If you
do so, you have to ensure that a list of type com.sun.xml.bind.util.ListImpl
will be returned! Not just a java.util.Vector or sth.l.t..
I think this behaviour is not a bug..?

Again, thanks for your efforts.
Best Regards

vivian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net