-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
1.2.1
-
x86
-
windows_nt
Name: tb29552 Date: 05/14/99
I'm using jdk 1.1.7B
and according to your bug reports the problem with regards to
"using System.setOut doesn't do anything with jit enabled" was fixed in 1.1.6
I still have this problem in 1.1.7B
symptoms are exactly the same, with -nojit it works
as per the problem description.
--------------------------------------------------
out put from command line
--------------------------------------------------
D:\tmp\foo>java -fullversion
java full version "JDK1.1.7U"
D:\tmp\foo>java -classpath %classpath%;. foo
type something
Enter ('q') for quit :
q
this should go to a file
D:\tmp\foo>java -nojit -classpath %classpath%;. foo
type something
Enter ('q') for quit :
q
--------------------------------------------------------
source code (foo.java)
--------------------------------------------------------
import java.io.*;
public class foo
{
public static void main(String argv[])
{
try
{
PrintStream p=new PrintStream(new FileOutputStream("foo.out", false));
System.out.println("type something");
String input;
BufferedReader my_bf=new BufferedReader(new InputStreamReader(System.in));
/*1*/ do
/*2*/ {
System.out.println("Enter ('q') for quit : ");
input=my_bf.readLine();
p.println(input);
/*3*/ }
/*4*/ while (!input.equals("q"));
p.println("test");
System.setOut(p);
System.out.println("this should go to a file");
}
catch (Throwable t)
{
t.printStackTrace();
}
}
}
------------------------------------------------
Please take note of lines marked /*1*/ through /*4*/
if you comment out those lines the program will work as
expected.
(Review ID: 54822)
======================================================================
- relates to
-
JDK-4115974 Need to be able to tell JIT not to optimize certain finals.
-
- Closed
-