From 3dbf7319f6bfc98d7cfc1318538554278e42648a Mon Sep 17 00:00:00 2001 From: tromey Date: Mon, 5 Mar 2007 15:57:13 +0000 Subject: * sources.am, Makefile.in: Rebuilt. * scripts/makemake.tcl (emit_package_rule): Don't omit VMProcess.java. * Makefile.am (nat_source_files): Added natVMProcess.cc. (inner_nat_headers): Added ImmediateEOFInputStream.h. * gcj/javaprims.h: Regenerated. * java/lang/System.java (EnvironmentMap): Now package-private. (EnvironmentMap(Map)): New constructor. (EnvironmentMap.put): New method. * java/lang/natWin32Process.cc (startProcess): Update. * java/lang/Win32Process.java (Win32Process): Added 'redirect' argument. (startProcess): Likewise. * java/lang/EcosProcess.java (EcosProcess): Added 'redirect' argument. * java/lang/natPosixProcess.cc (nativeSpawn): Handle redirection. * java/lang/PosixProcess.java (redirect): New field. (PosixProcess): Added 'redirect' argument. * java/lang/natRuntime.cc (execInternal): Added 'redirect' argument to Process creation. * java/lang/natVMProcess.cc: New file. * java/lang/ProcessBuilder.java: Removed. * java/lang/VMProcess.java: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122553 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/lang/System.java | 44 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) (limited to 'libjava/java/lang/System.java') diff --git a/libjava/java/lang/System.java b/libjava/java/lang/System.java index 76a39f0d3f2..b516a513e75 100644 --- a/libjava/java/lang/System.java +++ b/libjava/java/lang/System.java @@ -828,7 +828,7 @@ public final class System * * @author Andrew John Hughes (gnu_andrew@member.fsf.org) */ - private static class EnvironmentMap + static class EnvironmentMap extends HashMap { @@ -854,7 +854,20 @@ public final class System { super(); } - + + /** + * Constructs a new EnvironmentMap containing + * the contents of the specified map. + * + * @param m the map to be added to this. + * @throws NullPointerException if a key or value is null. + * @throws ClassCastException if a key or value is not a String. + */ + EnvironmentMap(Map m) + { + super(m); + } + /** * Blocks queries containing a null key or one which is not * of type String. All other queries @@ -939,7 +952,32 @@ public final class System keys = new EnvironmentSet(super.keySet()); return keys; } - + + /** + * Associates the given key to the given value. If the + * map already contains the key, its value is replaced. + * The map does not accept null keys or values, or keys + * and values not of type {@link String}. + * + * @param key the key to map. + * @param value the value to be mapped. + * @return the previous value of the key, or null if there was no mapping + * @throws NullPointerException if a key or value is null. + * @throws ClassCastException if a key or value is not a String. + */ + public String put(String key, String value) + { + if (key == null) + throw new NullPointerException("A new key is null."); + if (value == null) + throw new NullPointerException("A new value is null."); + if (!(key instanceof String)) + throw new ClassCastException("A new key is not a String."); + if (!(value instanceof String)) + throw new ClassCastException("A new value is not a String."); + return super.put(key, value); + } + /** * Removes a key-value pair from the map. The queried key may not * be null or of a type other than a String. -- cgit v1.2.1