Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!

Bug 137232

Summary: Input reset does not work
Product: platform Reporter: Petr Hejl <phejl>
Component: Output WindowAssignee: t_h <t_h>
Status: RESOLVED FIXED QA Contact: issues <issues.netbeans.org>
Priority: P2 CC: pjiricka
Version: 6.x   
Target Milestone: 6.x   
Hardware: All   
OS: All   
Whiteboard:
Issue Type: DEFECT Exception Report:
Bug Depends on:    
Bug Blocks: 135670    

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