mirror of
https://github.com/corda/corda.git
synced 2025-01-23 12:58:35 +00:00
accept foo.bar.Baz as well as foo/bar/Baz in FindClass
This commit is contained in:
parent
ee60d48cfe
commit
e9826b2d7f
@ -143,13 +143,24 @@ NewStringUTF(Thread* t, const char* chars)
|
|||||||
return makeLocalReference(t, s);
|
return makeLocalReference(t, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
replace(int a, int b, const char* in, int8_t* out)
|
||||||
|
{
|
||||||
|
while (*in) {
|
||||||
|
*out = (*in == a ? b : *in);
|
||||||
|
++ in;
|
||||||
|
++ out;
|
||||||
|
}
|
||||||
|
*out = 0;
|
||||||
|
}
|
||||||
|
|
||||||
jclass JNICALL
|
jclass JNICALL
|
||||||
FindClass(Thread* t, const char* name)
|
FindClass(Thread* t, const char* name)
|
||||||
{
|
{
|
||||||
ENTER(t, Thread::ActiveState);
|
ENTER(t, Thread::ActiveState);
|
||||||
|
|
||||||
object n = makeByteArray(t, strlen(name) + 1, false);
|
object n = makeByteArray(t, strlen(name) + 1, false);
|
||||||
memcpy(&byteArrayBody(t, n, 0), name, byteArrayLength(t, n));
|
replace('.', '/', name, &byteArrayBody(t, n, 0));
|
||||||
|
|
||||||
return makeLocalReference(t, resolveClass(t, n));
|
return makeLocalReference(t, resolveClass(t, n));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user