harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r416060 - in /incubator/harmony/enhanced/classlibadapter/trunk: modules/kernel/src/main/java/java/lang/System.java vmi/vmi.cpp
Date Wed, 21 Jun 2006 18:29:42 GMT
Author: hindessm
Date: Wed Jun 21 11:29:41 2006
New Revision: 416060

URL: http://svn.apache.org/viewvc?rev=416060&view=rev
Log:
Implement java.lang.System.setIn method.

Modified:
    incubator/harmony/enhanced/classlibadapter/trunk/modules/kernel/src/main/java/java/lang/System.java
    incubator/harmony/enhanced/classlibadapter/trunk/vmi/vmi.cpp

Modified: incubator/harmony/enhanced/classlibadapter/trunk/modules/kernel/src/main/java/java/lang/System.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlibadapter/trunk/modules/kernel/src/main/java/java/lang/System.java?rev=416060&r1=416059&r2=416060&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlibadapter/trunk/modules/kernel/src/main/java/java/lang/System.java
(original)
+++ incubator/harmony/enhanced/classlibadapter/trunk/modules/kernel/src/main/java/java/lang/System.java
Wed Jun 21 11:29:41 2006
@@ -89,8 +89,10 @@
 	 *            the new value for in.
 	 */
 	public static void setIn(InputStream newIn) {
-        throw new RuntimeException("not implemented");
+            setInImpl(newIn);
 	}
+
+        private static native void setInImpl(InputStream newIn);
 
 	/**
 	 * Sets the value of the static slot "out" in the receiver to the passed in

Modified: incubator/harmony/enhanced/classlibadapter/trunk/vmi/vmi.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlibadapter/trunk/vmi/vmi.cpp?rev=416060&r1=416059&r2=416060&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlibadapter/trunk/vmi/vmi.cpp (original)
+++ incubator/harmony/enhanced/classlibadapter/trunk/vmi/vmi.cpp Wed Jun 21 11:29:41 2006
@@ -307,6 +307,23 @@
         return;
     }
 
+    /*
+     * Class:     java_lang_System
+     * Method:    setInImpl
+     * Signature: (Ljava/io/InputStream;)V
+     */
+    JNIEXPORT void JNICALL Java_java_lang_System_setInImpl
+        (JNIEnv *env, jclass c, jobject stream)
+    {
+        jfieldID fid;
+        fid = env->GetStaticFieldID(c, "in", "Ljava/io/InputStream;");
+        if (!fid) {
+            return;
+        }
+        env->SetStaticObjectField(c, fid, stream);
+        return;
+    }
+
     JNIEXPORT void JNICALL Java_java_lang_VMThread_attach
         (JNIEnv *env, jobject) {
         hythread_attach(NULL);



Mime
View raw message