Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 137232 - Input reset does not work
Input reset does not work
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: Output Window
6.x
All All
: P2 (vote)
: 6.x
Assigned To: t_h
issues@platform
:
Depends on:
Blocks: 135670
  Show dependency treegraph
 
Reported: 2008-06-14 15:28 UTC by Petr Hejl
Modified: 2008-12-22 11:30 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Hejl 2008-06-14 15:28:54 UTC
When code relies on non-blocking operation getIn().ready() is providing wrong results.

This happens when IO is reused:
1) output does not contain any line from previous operation
2) getOut().reset() is called
3) because reuse() on NbIO.IOReader is not called getIn().ready() will report false forever (even if there is input
available)

One possible solution would be to change NbIO.IOReader.ready() symmetrically to its read methods:

         public boolean ready() throws IOException {        
             synchronized (lock) {
-                return !inputClosed && buffer().length() > 0;
+                if (inputClosed) {
+                    reuse();
+                    return false;
+                }
+                return buffer().length() > 0;
             }
         }

Other possible solution would be to fix NbWriter().reset() method to not to rely on ((OutWriter) out).isEmpty() in order
to perform real reset.
Comment 2 Quality Engineering 2008-06-20 15:56:25 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #271 build
Changeset: http://hg.netbeans.org/main/rev/7ea1bf6a7428
User: Tomas Holy <t_h@netbeans.org>
Log: #137232: Input reset does not work


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo