| Summary: | IllegalStateException while decoding output to Console Stream | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Sarika Sinha <sarika.sinha> | ||||||||
| Component: | Debug | Assignee: | Andreas Loth <andy_2639> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | ||||||||||
| Version: | 4.6 | ||||||||||
| Target Milestone: | 4.7 M7 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows 7 | ||||||||||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=507664 | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 507664 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Sarika Sinha
Created attachment 267217 [details]
Check that stream is not closed before using decoder
The check for a closed stream was only in encodedWrite, which is fine when other methods don't do anything which relies on an open stream.
However, write(byte[] b, int off, int len) now uses the decoder which must not be used after the stream was closed.
Fix: do a stream closed check in write(byte[] b, int off, int len) and setCharset(Charset charset). This check throws an IOException when the stream is closed. This produces a better error message than the IllegalStateException.
Created attachment 267218 [details]
Test cases for writing to closed streams / streams with closed documents
(In reply to Sarika Sinha from comment #0) > java.io.IOException: Document is closed I don't know what this exception should tell me. Thanks Andreas, Released the changes with http://git.eclipse.org/c/platform/eclipse.platform.debug.git/commit/?id=c9e938ae8fd6b46887a9f105eff6c2cfd688e51c (In reply to Andreas Loth from comment #3) > (In reply to Sarika Sinha from comment #0) > > > java.io.IOException: Document is closed > > I don't know what this exception should tell me. The point is to analyze why the document is closed, is it a timing issue in test case or a genuine problem? (In reply to Sarika Sinha from comment #5) > The point is to analyze why the document is closed, is it a timing issue in > test case or a genuine problem? Which test case fails? Does it fail always (reproducible) or only sometimes? Test is not failing but if you run Platform Debug test suite, you can see many of these exceptions in the console. Created attachment 267466 [details] Test suites console output (In reply to Sarika Sinha from comment #7) > Test is not failing but if you run Platform Debug test suite, you can see > many of these exceptions in the console. On my computer (Windows 10 Pro x64 Anniversary Update), I ran the test suites AutomatedSuite, LocalSuite, and PerformanceSuite. Neither of the suites produced a java.io.IOException: Document is closed. I attached the console output of the test suites. However, the tests testPreserveExpandedOnContentStress, testPreserveLargeModelOnContent, JFaceViewerPerformanceTests.testRefreshListFiltered, and VirtualViewerPerformanceTests.testRefreshListFiltered failed on my system. I included the stacktraces in the attached zip file. I used the Platform Debug master branch at commit dc90c09f030a8347a715054261d62b973fdb3d92. The target definition I'm using is included in the zip. Thanks, I am also not observing them now. |