duplicate id exception

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

duplicate id exception

Adrian Baker-2
It would be great if the duplicate id exception actually reported the
duplicate id (I'm passing in the form via a DOM, so the location can't
be reported - I assume this is the reason anyway).

                // Make sure there are no duplicate ids
                if (idsToControlInfo.get(effectiveControlId) != null)
                    throw new ValidationException("Duplicate id for
XForms control", new ExtendedLocationData((LocationData)
controlElement.getData(),
                            "analyzing control element", controlElement));

Should be simple to add effectiveControlId to the exception string.

Adrian



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: duplicate id exception

Erik Bruchez
Administrator
The ExtendedLocationData used here is used by the Exception generator to
produce details error messages. Now it may not be used by other pieces
of code catching the exception, but it should, or at least it should be
converted into a String by somebody before passing the exception to a
further level.

In the meanwhile, I have added the id to the ExtendedLocationData
parameters but also to the description string. That should not hurt.

-Erik

Adrian Baker wrote:

> It would be great if the duplicate id exception actually reported the
> duplicate id (I'm passing in the form via a DOM, so the location can't
> be reported - I assume this is the reason anyway).
>
>                // Make sure there are no duplicate ids
>                if (idsToControlInfo.get(effectiveControlId) != null)
>                    throw new ValidationException("Duplicate id for
> XForms control", new ExtendedLocationData((LocationData)
> controlElement.getData(),
>                            "analyzing control element", controlElement));
>
> Should be simple to add effectiveControlId to the exception string.
>
> Adrian
--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws