You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2006/06/21 20:29:42 UTC

svn commit: r416060 - in /incubator/harmony/enhanced/classlibadapter/trunk: modules/kernel/src/main/java/java/lang/System.java vmi/vmi.cpp

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);