JavaMemoryModel: Why not delegate System.in/out/err, instead of see it as special case?

From: Doron Rajwan (doron@rajwan.org)
Date: Fri Oct 03 2003 - 15:36:27 EDT


I do not understand why System.in, out, and err won't be replaced with
delegation.
 
What I mean is:
1. Define a class that extends PrintStream and delegate to another
PrintStream.
2. System.out will be final instance of this class, w/o any magic
involved.
3. When someone wants to change the output, they can use a method to
change the delegation. This method can be public method, and the
Security check will be inside it.
4. The native magic can be removed.
 
I cannot see how this change will break anything, except, maybe, when
someone sync(System.out) in order to print few lines together. Maybe
this can be solved too, using some tricks.
 
My question is: have you considered other options, except declaring
these 3 variables as special case?
 
thanks,
  Doron.

 

 

_______________________________________________

Doron Rajwan, doron@rajwan.org, www.rajwan.org <http://www.rajwan.org/>

13 Odem street, Rishon Le-Zion, Israel

Home: 03-9512348 [+972-(3)-9512348]

Cell: 064-887732 [+972-(64)-887732]

 

-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:51 EDT