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 22611 - Need Ant input support (was: Unable to specify EOF character from Output Window "[FFJ CUSTBUG]")
Summary: Need Ant input support (was: Unable to specify EOF character from Output Wind...
Status: RESOLVED DUPLICATE of bug 47708
Alias: None
Product: third-party
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@third-party
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-19 00:04 UTC by kishm
Modified: 2006-01-22 16:46 UTC (History)
5 users (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 kishm 2002-04-19 00:04:35 UTC
"[FFJ CUSTBUG]"

Hi there, lets say I have the following program

public class MyClass{

  public  static void main (String [] args)
  {
     byte[] buf = new byte[2048];
     int len = 0;
     int c;

     InputStreamReader inRead;
     File file;

     FileInputStream  fis =  new FileInputStream 
(FileDescriptor.in);
     FileOutputStream fos =  new FileOutputStream 
(FileDescriptor.out);

     try {
          while ((len = fis.read(buf, 0, 2048)) != -1)
          {
            System.out.print("You Typed : ");
            fos.write(buf, 0, len);
          }
     }
     catch  (IOException e) {
        e.printStackTrace();
     }
  }
}

Now, create a class in the IDE , with this code. Execute 
it in the IDE. Now the
output window will appear and wait for input. (Now what 
this program does is read the input from the std input
and write it out to stdout until it encounters the EOF 
character.) So as you type input into the output window of
the IDE and hit return u'll see that the program types the 
same out and wait for more input and so on , till you
type in the EOF char from the Output Window. 

Now the problem is there is no way to do this , i.e type 
the EOF char, I tried ctrl+D, ctrl+Z nothing works.

Please fix.
Comment 1 Jan Zajicek 2002-04-22 15:21:58 UTC
CCing Ales, maybe this is his issue.
Comment 2 David Strupl 2002-04-25 13:45:32 UTC
Ales, are the right person?
Comment 3 _ mihmax 2002-06-14 08:00:49 UTC
I have the same problem in both Netbeans 3.3.2 & 3.4 beta 1

It's surely a serious problem and it avoids 
running/debugging some console Java programs.

I'm raising priority to P2.
Should I mark it as a defect?
Comment 4 akemr 2002-06-14 11:09:13 UTC
Problem is not in OW. Ctrl-Z ( ascii 26) is passed to input stream, so
I think problem could be in execution which works with redirecting of
stdin (maybe ProcessExecutor.CopyMaker
or core SysIn??)
I modified above testing program to display eof character:

try {
    boolean eof = false;
    while (!eof) {              
       len = fis.read(buf, 0, 2048);
       for (int i = 0; i < len; i++) {
           System.out.println(" :" + (byte) buf[i]);
       }
       System.out.println("len:" + len);
       if ( len == -1 ) {
           System.out.println("eof");
           eof = true;
       }
       else {
           System.out.print("You Typed : ");
           fos.write(buf, 0, len);
       }            
    }
}
catch  (IOException e) {
    System.out.println("chyba");
    e.printStackTrace();
}
System.out.println("standard program end");
Comment 5 Marek Grummich 2002-07-22 09:02:06 UTC
Target milestone was changed from '3.4' to TBD.
Comment 6 Marek Grummich 2002-07-22 09:29:40 UTC
Target milestone was changed from '3.4' to TBD.
Comment 7 David Strupl 2002-07-23 15:17:27 UTC
This should be dealt with in 4.0 timeframe.
Comment 8 _ mihmax 2002-11-05 17:59:13 UTC
Well, if I'm not too annoying (I raised e-mail storm due to 3.4.1),
what's the source of this problem?

I'd like to fix this in 3.4.1 (I mean, that PERSONALLY I find this bug
annoying, and I'll try to cut some time from my work, my 3.4.1 Release
Coordination, my Russian NB project, etc. to look at this bug), and I
surely need your help in the source .java file to look at.

Thanks,
Maxym Mykhalchuk
Comment 9 _ mihmax 2002-11-10 17:45:36 UTC
David! Ales!

Do you hear me? ;-)

please answer, where's the source of this bug?
Comment 10 akemr 2002-11-11 08:21:34 UTC
I don't know, really :-) It could be somewhere in execution IMO - see
my earlier comment..
Comment 11 David Strupl 2002-11-11 13:39:14 UTC
I also can hear you and also don't have an idea. Someone would have to
grab debugger and start the hard work ;-( I have marked this bug as
target milestone 4.0 - at least for me. If there is someone willing to
check this sooner I will gladly accept such help. Otherwise - I am
sorry for now. Ales's hint with starting from ProcessExecutor
 sounds promising. I am ready to review the fix - if there is someone
to create such a diff. Best, David
Comment 12 _ mihmax 2002-11-12 19:49:30 UTC
Starting the investigation
Further update: two days
Comment 13 _ mihmax 2002-11-21 18:11:41 UTC
Two days lasted longer then real two days ;-(
Sorry.

starting with ProcessExecutor didn't help much, or maybe I debugged
wrong ;o)
As for now - I haven't give up and try again, but...

What I've found out is that there's a PrintWriter (to where the chars
are written) and PrintReader (attached to PrintWriter), that gives the
chars out to Terminal Emulator, but nowhere I can see what class gives
the chars to the debugged application.

BTW: How to pass a programmatic EOF (not a ^Z char, but rather simply
say him - "Hey, you're finished") to smth. like PrintWriter? I'll try
to experiment with manual closing different streams to find out, the
closure of which will yield to the application finish.

Next update (C) Kristen (Collab.net support) ;-)
?? don't know, really

Sincere, Maxym
Comment 14 Jaroslav Tulach 2002-12-03 09:54:26 UTC
Hi. This issue is marked as 3.4.1_CANDIDATE. It means that it should be
integrated into release341 one branch. The plan at
http://www.netbeans.org/devhome/docs/releases/34/index.html expected beta1 to be
produced on Dec01. That did not happen due to a lot of outstanding not
integrated candidates like this one. 

Would it be possible to spend few minutes by backporting this fix? Thank you in
advance.
Comment 15 David Strupl 2002-12-03 13:26:30 UTC
Since there is no fix available for 341 I am removing the keyword and
leaving it opened for 4.0.
Comment 16 David Strupl 2003-01-06 14:50:22 UTC
Decreasing priority - not that critical IMHO. If someone disagrees and
wants to invest the time --- it is all yours ;-))
Comment 17 _ mihmax 2003-01-06 18:06:42 UTC
I tried, but I failed to find the source of the bug, so P3 is OK imho
Comment 18 Marian Mirilovic 2003-03-13 13:43:18 UTC
Changed owner David S. -> David K.
Comment 19 Marian Mirilovic 2004-01-14 15:24:10 UTC
changing owner dkonecny -> pnejedly
Comment 20 Jesse Glick 2004-03-16 17:10:22 UTC
Needs to be reevaluated as Ant input.
Comment 21 Petr Nejedly 2004-06-04 12:51:46 UTC
stdin doesn't work at all (seems it is EOF all the time) under new
projects system.
Comment 22 Jesse Glick 2004-06-04 13:01:28 UTC
The output window and Ant engine support console input. Ant 1.6.1
supports it for unforked apps. Currently it does not support it for
forked apps; I have submitted a patch to ant.apache.org, we'll see if
it is accepted for 1.6.2 or not.
Comment 23 Jesse Glick 2006-01-22 16:46:22 UTC

*** This issue has been marked as a duplicate of 47708 ***