Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-517

Unhandled IOException during model write to OutputStream

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Jena 2.10.1
    • Fix Version/s: Jena 2.11.0
    • Component/s: Jena
    • Labels:
      None

      Description

      Method "N3JenaWriterCommon.write()" silently ignores IOException from Writer.flush() while writing a model to an OutputStream.

      This might lead to debugging nightmares.

      Should at the very least throw some runtime exception wrapping the original exception

      	@Override
          public synchronized void write(Model model, OutputStream output, String base) 
      	{
      		try {
      			Writer w =  new BufferedWriter(new OutputStreamWriter(output, "UTF-8")) ;
      			write(model, w, base) ;
      			try { w.flush() ; } catch (IOException ioEx) {}
      		} catch (java.io.UnsupportedEncodingException ex)
      		{
      			System.err.println("Failed to create UTF-8 writer") ;
      		}
      	}
      

        Attachments

          Activity

            People

            • Assignee:
              andy Andy Seaborne
              Reporter:
              hovenko Knut-Olav Hoven
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: