ASF Bugzilla – Attachment 27714 Details for
Bug 51985
System.out.print is adding an extra line feed when flushed as a result of a System.in.readLine() call
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Test task definition that reproduces the problem
ConfirmInputTask.java (text/x-java-source), 752 bytes, created by
Scott Asire
on 2011-10-06 23:49:20 UTC
(
hide
)
Description:
Test task definition that reproduces the problem
Filename:
MIME Type:
Creator:
Scott Asire
Created:
2011-10-06 23:49:20 UTC
Size:
752 bytes
patch
obsolete
>// Copyright (c) 2011, CA Inc. All rights reserved. >package com.runamok.tools.taskdefs; > >import org.apache.tools.ant.BuildException; >import org.apache.tools.ant.Project; >import org.apache.tools.ant.Task; > >import java.io.BufferedReader; >import java.io.IOException; >import java.io.InputStreamReader; > >/** > * > */ >public class ConfirmInputTask extends Task >{ > private BufferedReader _in = new BufferedReader( new InputStreamReader( System.in ) ); > > public void execute() throws BuildException > { > System.out.print("Enter your name:"); > try > { > String name = _in.readLine(); > System.out.println("You entered: " + name); > } > catch (IOException e) > { > log(e, Project.MSG_ERR); > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 51985
: 27714 |
27715