mirror of
https://github.com/corda/corda.git
synced 2025-01-09 06:23:04 +00:00
return unadorned filename from JVM_GetSystemPackage
Package.defineSystemPackage expects a filename, not a URL.
This commit is contained in:
parent
2a45a5919c
commit
0adccdc99c
@ -746,7 +746,20 @@ class MyClasspath : public Classpath {
|
|||||||
byteArrayEqual);
|
byteArrayEqual);
|
||||||
|
|
||||||
object source = classSource(t, class_);
|
object source = classSource(t, class_);
|
||||||
if (source == 0) {
|
if (source) {
|
||||||
|
// note that we strip the "file:" prefix, since
|
||||||
|
// Package.defineSystemPackage expects an unadorned
|
||||||
|
// filename:
|
||||||
|
const unsigned PrefixLength = 5;
|
||||||
|
unsigned sourceNameLength = byteArrayLength(t, source)
|
||||||
|
- PrefixLength;
|
||||||
|
THREAD_RUNTIME_ARRAY(t, char, sourceName, sourceNameLength);
|
||||||
|
memcpy(RUNTIME_ARRAY_BODY(sourceName),
|
||||||
|
&byteArrayBody(t, source, PrefixLength),
|
||||||
|
sourceNameLength);
|
||||||
|
|
||||||
|
source = vm::makeByteArray(t, "%s", sourceName);
|
||||||
|
} else {
|
||||||
source = vm::makeByteArray(t, "avian-dummy-package-source");
|
source = vm::makeByteArray(t, "avian-dummy-package-source");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user