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.

Bug 137232 - Input reset does not work
Summary: Input reset does not work
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Output Window (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: t_h
URL:
Keywords:
Depends on:
Blocks: 135670
  Show dependency tree
 
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
Exception Reporter:


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