summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorRoman Kennke <roman@kennke.org>2006-08-15 11:37:05 +0000
committerRoman Kennke <roman@kennke.org>2006-08-15 11:37:05 +0000
commitbb650fa7857a762e5a31d54a6f1fc9041b009014 (patch)
tree38d1415a0f23a78c357d206e0dbb8ce55cef8e7e /java
parent841bd1a34d639fd06d4c427e123453b4eeb3e82b (diff)
downloadclasspath-bb650fa7857a762e5a31d54a6f1fc9041b009014.tar.gz
2006-08-15 Roman Kennke <kennke@aicas.com>
* java/io/PrintStream.java (line_separator): Provide default for system property. * java/io/FileDescriptor.java (valid): Create local copy of channel field for better threading safetly.
Diffstat (limited to 'java')
-rw-r--r--java/io/FileDescriptor.java5
-rw-r--r--java/io/PrintStream.java2
2 files changed, 4 insertions, 3 deletions
diff --git a/java/io/FileDescriptor.java b/java/io/FileDescriptor.java
index d300c9cb6..dd3db1c74 100644
--- a/java/io/FileDescriptor.java
+++ b/java/io/FileDescriptor.java
@@ -133,7 +133,8 @@ public final class FileDescriptor
* native file handle, <code>false</code> otherwise
*/
public boolean valid ()
- {
- return channel != null && channel.isOpen();
+ {
+ ByteChannel c = channel;
+ return (c != null) && (c.isOpen());
}
}
diff --git a/java/io/PrintStream.java b/java/io/PrintStream.java
index 98461db2b..2d31bbd1e 100644
--- a/java/io/PrintStream.java
+++ b/java/io/PrintStream.java
@@ -67,7 +67,7 @@ public class PrintStream extends FilterOutputStream
// Line separator string.
private static final char[] line_separator
- = SystemProperties.getProperty("line.separator").toCharArray();
+ = SystemProperties.getProperty("line.separator", "\n").toCharArray();
/**
* Encoding name