This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
This arose out of bug #222859 where it was determined that a synchronization problem exists between TerminalInputOutput.dispose() and getOut(). if dispose() and getOut() are executed "simultaneously" it is possible for getOut() to return a null reference (nulled by dispose). Moving the synchronized in getOut() to method level (and adding one to dispose()) isn't quite appropriate because terminal.setOutConnected() has a side-effect of calling callbacks and that's not a good idea while holding locks. Even if there was no callback there's the issue of getOut() returning a new OutputWriter after dispose(). This leads to the notion that operations on InputOutput after a call to InputOutput.closeInputOutput(), which ultimately calls dispose(), are "undefined" in the documentation and should perhaps raise IllegalStateException. Synchronous test-and-set access to such an "illegal state" might be a more tractable problem to solve than synchronising 'outputWriter'. (although ... can one re-open an InputOutput tat has been closeInputOutput()ed?). See .../terminal/README.close_semantics for a discussion of InputOutput state transitions.
*** Bug 223376 has been marked as a duplicate of this bug. ***