[Mulgara-dev] AbstractStreamedAnswer's OutputStreamWriter set to null in four methods

Paul Gearon gearon at ieee.org
Wed Oct 28 13:17:21 UTC 2009


Hi Eric,

Sorry it's taken me so long to get to this.

It looks like setting the stream to null was a dirty attempt at
resetting the object. However, this supposed reset wasn't being done
properly anyway. Besides that, the object should only be used once
before being thrown away. This is how it's used internally, so that's
why I haven't seen any problems at all.

Feel free to fix it up and post the patch.

Regards,
Paul

On Sat, Oct 24, 2009 at 6:26 PM, Eric Kobrin
<ekobrin+mulgara at velocitude.com> wrote:
> The OutputStreamWriter from
> org.mulgara.protocol.AbstractStreamedAnswer is set to null in the
> following methods:
>   org.mulgara.protocol.AbstractStreamedXMLAnswer.addNamespace(String, URI)
>   org.mulgara.protocol.AbstractStreamedXMLAnswer.clearNamespaces()
>   org.mulgara.protocol.AbstractStreamedXMLAnswer.setPrettyPrint(boolean)
>   org.mulgara.protocol.StreamedSparqlXMLAnswer.useW3CSchema(boolean)
>
> This triggers rebuilding from the underlying stream in the next call
> to AbstractStreamedAnswer.emit().
>
> These methods are only called from within the unit tests for the
> subclasses of AbstractStreamedXMLAnswer.
>
> This does not seem to be a safe operation and is making the addition
> of nested answers (from subqueries) difficult.
> In my local branch, I have disabled this behavior, but I would like to
> submit a patch for http://mulgara.org/trac/ticket/208
>
> Is there a reason for continuing the present behavior?
> If so, I can retain it through some additional work.
> If not, I would like to submit the full patch this weekend.
>
> Thank you,
> Eric Kobrin
> ekobrin at velocitude.com
> _______________________________________________
> Mulgara-dev mailing list
> Mulgara-dev at mulgara.org
> http://mulgara.org/mailman/listinfo/mulgara-dev
>



More information about the Mulgara-dev mailing list