mirror of
https://github.com/corda/corda.git
synced 2025-04-05 10:27:11 +00:00
more bugfixes
This commit is contained in:
parent
587dbeb163
commit
71c7013808
@ -58,7 +58,7 @@ doOpen(JNIEnv* e, const char* path, int mask)
|
||||
{
|
||||
int fd = OPEN(path, mask | OPEN_MASK, S_IRUSR | S_IWUSR);
|
||||
if (fd == -1) {
|
||||
throwNew(e, "java/lang/IOException", strerror(errno));
|
||||
throwNew(e, "java/io/IOException", strerror(errno));
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
@ -68,7 +68,7 @@ doClose(JNIEnv* e, jint fd)
|
||||
{
|
||||
int r = CLOSE(fd);
|
||||
if (r == -1) {
|
||||
throwNew(e, "java/lang/IOException", strerror(errno));
|
||||
throwNew(e, "java/io/IOException", strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ doRead(JNIEnv* e, jint fd, jbyte* data, jint length)
|
||||
} else if (r == 0) {
|
||||
return -1;
|
||||
} else {
|
||||
throwNew(e, "java/lang/IOException", strerror(errno));
|
||||
throwNew(e, "java/io/IOException", strerror(errno));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -91,7 +91,7 @@ doWrite(JNIEnv* e, jint fd, const jbyte* data, jint length)
|
||||
{
|
||||
int r = WRITE(fd, data, length);
|
||||
if (r != length) {
|
||||
throwNew(e, "java/lang/IOException", strerror(errno));
|
||||
throwNew(e, "java/io/IOException", strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ Java_java_io_File_mkdir(JNIEnv* e, jclass, jstring path)
|
||||
if (not exists(chars)) {
|
||||
int r = ::MKDIR(chars, 0700);
|
||||
if (r != 0) {
|
||||
throwNew(e, "java/lang/IOException", strerror(errno));
|
||||
throwNew(e, "java/io/IOException", strerror(errno));
|
||||
}
|
||||
}
|
||||
e->ReleaseStringUTFChars(path, chars);
|
||||
@ -143,7 +143,7 @@ Java_java_io_File_createNewFile(JNIEnv* e, jclass, jstring path)
|
||||
if (not exists(chars)) {
|
||||
int fd = CREAT(chars, 0600);
|
||||
if (fd == -1) {
|
||||
throwNew(e, "java/lang/IOException", strerror(errno));
|
||||
throwNew(e, "java/io/IOException", strerror(errno));
|
||||
} else {
|
||||
doClose(e, fd);
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ public class StringReader extends Reader {
|
||||
}
|
||||
}
|
||||
in.getChars(position, length, b, offset);
|
||||
position += length;
|
||||
return length;
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,10 @@ public class Throwable {
|
||||
return message;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return getClass().getName() + ": " + message;
|
||||
}
|
||||
|
||||
private static native Object trace(int skipCount);
|
||||
|
||||
private static native StackTraceElement[] resolveTrace(Object trace);
|
||||
|
@ -95,6 +95,12 @@ ThrowNew(Thread* t, jclass c, const char* message)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
DeleteLocalRef(Thread*, jobject)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
jboolean
|
||||
ExceptionCheck(Thread* t)
|
||||
{
|
||||
@ -119,6 +125,7 @@ populateJNITable(JNIEnvVTable* table)
|
||||
table->FindClass = ::FindClass;
|
||||
table->ThrowNew = ::ThrowNew;
|
||||
table->ExceptionCheck = ::ExceptionCheck;
|
||||
table->DeleteLocalRef = ::DeleteLocalRef;
|
||||
}
|
||||
|
||||
} // namespace vm
|
||||
|
@ -1033,7 +1033,9 @@ parseMethodTable(Thread* t, Stream& s, object class_, object pool)
|
||||
set(t, classMethodTable(t, class_), methodTable);
|
||||
}
|
||||
|
||||
if (declaredVirtualCount == 0) {
|
||||
if (declaredVirtualCount == 0
|
||||
and (classFlags(t, class_) & ACC_INTERFACE) == 0)
|
||||
{
|
||||
// inherit interface table and virtual table from superclass
|
||||
|
||||
set(t, classInterfaceTable(t, class_),
|
||||
|
@ -208,11 +208,14 @@ resolve(Thread* t, object pool, unsigned index,
|
||||
object class_ = resolveClass(t, o, referenceClass);
|
||||
if (UNLIKELY(t->exception)) return 0;
|
||||
|
||||
o = 0;
|
||||
if (classFlags(t, class_) & ACC_INTERFACE) {
|
||||
o = ::find(t, classVirtualTable(t, class_), arrayBody(t, pool, index),
|
||||
methodName, methodSpec);
|
||||
if (classVirtualTable(t, class_)) {
|
||||
o = ::find(t, classVirtualTable(t, class_), arrayBody(t, pool, index),
|
||||
methodName, methodSpec);
|
||||
}
|
||||
} else {
|
||||
for (o = 0; o == 0 and class_; class_ = classSuper(t, class_)) {
|
||||
for (; o == 0 and class_; class_ = classSuper(t, class_)) {
|
||||
o = find(t, class_, arrayBody(t, pool, index));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user