gf-metro/jaxb — pull request #7 by highsource (2014-10-02 07:01:03+00:00)
Title: [JAXB-1045,JAXB-1046] Fixes for two issues related to catalogs

Hi,

here's a pull request to fix [JAXB-1045](https://java.net/jira/browse/JAXB-1045) and [JAXB-1046](https://java.net/jira/browse/JAXB-1046).

*JAXB-1045*

The problem here is that when the entity resolver resolves some systemId, you get an input source with the stream AND a *resolved* systemId. Subsequent resolutions (when you for instance have an import or an include) will use this resolved system id. This may result in some schemas addressed by an unresolved and by a resolved system id - despite being placed in the same local source.

The fix is simple: when resolving, only provide the stream and don't change the system id (or public id) of the input source. This still works well - parsers take XML from the stream. And this corrects the problem since system id does not change.

* JAXB-1046*

This is a simple one. When resolving URIs, add BOTH the original URI as well as the resolved URI to the id/documents map - with the same document, of course.

As I noted before, OCA is signed, please consider the fixes.

I understand that we're talking customer-facing interface here so you probably have to carefully consider if you apply the fixes or not. I am persuaded that what I propose is the correct behaviour, so I will want to fix it anyway (in `maven-jaxb2-plugin`, at least). I think I can make workarounds via the entity resolver for JAXB-1044 and JAXB-1045 as it is basically the entity resolver logic which is changed here.
What I can't do is JAXB-1046 since it addresses the interna of the DOMForest which is not accessible. But I think this fix is not dangerous at all.

Please let me know what you think of the fixes and if we can work them into the XJC release.

Best wishes,
Alexey Valikov