java/io bugfixes and coverage; jni bugfixes; minor refactoring

This commit is contained in:
Joel Dice
2007-07-26 18:06:05 -06:00
parent b00fcd4463
commit 7212ba1c30
17 changed files with 570 additions and 264 deletions

21
classpath/java-lang.cpp Normal file
View File

@ -0,0 +1,21 @@
#include "string.h"
#include "jni.h"
#undef JNIEXPORT
#define JNIEXPORT __attribute__ ((visibility("default")))
extern "C" JNIEXPORT jstring JNICALL
Java_java_lang_System_getProperty(JNIEnv* e, jclass, jstring key)
{
jstring value = 0;
const char* chars = e->GetStringUTFChars(key, 0);
if (chars) {
if (strcmp(chars, "line.separator") == 0) {
value = e->NewStringUTF("\n");
}
e->ReleaseStringUTFChars(key, chars);
}
return value;
}