aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/System.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2007-03-05 15:57:13 +0000
committerTom Tromey <tromey@gcc.gnu.org>2007-03-05 15:57:13 +0000
commitf4a2a1deec8e1c2c8f9ed80d166a37341fbafd19 (patch)
treeade62852d2118479bf46fcdfc3db7466a4d05e58 /libjava/java/lang/System.java
parent344189f9ec005682d1e5d6a700b91184e58538b8 (diff)
downloadgcc-f4a2a1deec8e1c2c8f9ed80d166a37341fbafd19.zip
gcc-f4a2a1deec8e1c2c8f9ed80d166a37341fbafd19.tar.gz
gcc-f4a2a1deec8e1c2c8f9ed80d166a37341fbafd19.tar.bz2
sources.am, [...]: Rebuilt.
* 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. From-SVN: r122553
Diffstat (limited to 'libjava/java/lang/System.java')
-rw-r--r--libjava/java/lang/System.java44
1 files changed, 41 insertions, 3 deletions
diff --git a/libjava/java/lang/System.java b/libjava/java/lang/System.java
index 76a39f0..b516a51 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<String,String>
{
@@ -854,7 +854,20 @@ public final class System
{
super();
}
-
+
+ /**
+ * Constructs a new <code>EnvironmentMap</code> 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<String,String> m)
+ {
+ super(m);
+ }
+
/**
* Blocks queries containing a null key or one which is not
* of type <code>String</code>. 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 <code>String</code>.