rename package avian.avian_vm_resource to avian.avianvmresource

This package name must match the URL protocol we use for loading
embedded resources, but OpenJDK's URL class won't tolerate underscores
in a protocol name.  Also, I had not updated the names of the native
methods in avian.avianvmresource.Handler, leading to
UnsatisfiedLinkErrors when they were called.
This commit is contained in:
Joel Dice 2012-10-06 15:33:24 -06:00
parent 7946aaf48f
commit a3c4b60f43
6 changed files with 14 additions and 12 deletions

View File

@ -8,7 +8,7 @@
There is NO WARRANTY for this software. See license.txt for
details. */
package avian.avian_vm_resource;
package avian.avianvmresource;
import java.net.URL;
import java.net.URLStreamHandler;

View File

@ -83,8 +83,8 @@ public final class URL {
{
if ("http".equals(protocol) || "https".equals(protocol)) {
return new avian.http.Handler();
} else if ("avian_vm_resource".equals(protocol)) {
return new avian.avian_vm_resource.Handler();
} else if ("avianvmresource".equals(protocol)) {
return new avian.avianvmresource.Handler();
} else if ("file".equals(protocol)) {
return new avian.file.Handler();
} else if ("jar".equals(protocol)) {

View File

@ -806,7 +806,7 @@ ifneq ($(classpath),avian)
$(classpath-src)/avian/VMClass.java \
$(classpath-src)/avian/VMField.java \
$(classpath-src)/avian/VMMethod.java \
$(classpath-src)/avian/avian_vm_resource/Handler.java
$(classpath-src)/avian/avianvmresource/Handler.java
ifneq ($(openjdk),)
classpath-sources := $(classpath-sources) \

View File

@ -208,7 +208,7 @@
-keep class sun.nio.cs.UTF_8
# loaded reflectively to handle embedded resources:
-keep class avian.resource.Handler
-keep class avian.avianvmresource.Handler
# refered to symbolically in MethodAccessorGenerator:
-keep class sun.reflect.MethodAccessorImpl {
@ -244,3 +244,5 @@
-keep class sun.nio.fs.UnixException {
UnixException(int);
}
-keep class sun.net.www.protocol.jar.Handler

View File

@ -155,7 +155,7 @@ Avian_java_lang_Runtime_exit
}
extern "C" JNIEXPORT int64_t JNICALL
Avian_avian_resource_Handler_00024ResourceInputStream_getContentLength
Avian_avian_avianvmresource_Handler_00024ResourceInputStream_getContentLength
(Thread* t, object, uintptr_t* arguments)
{
object path = reinterpret_cast<object>(*arguments);
@ -179,7 +179,7 @@ Avian_avian_resource_Handler_00024ResourceInputStream_getContentLength
}
extern "C" JNIEXPORT int64_t JNICALL
Avian_avian_resource_Handler_00024ResourceInputStream_open
Avian_avian_avianvmresource_Handler_00024ResourceInputStream_open
(Thread* t, object, uintptr_t* arguments)
{
object path = reinterpret_cast<object>(*arguments);
@ -200,7 +200,7 @@ Avian_avian_resource_Handler_00024ResourceInputStream_open
}
extern "C" JNIEXPORT int64_t JNICALL
Avian_avian_resource_Handler_00024ResourceInputStream_available
Avian_avian_avianvmresource_Handler_00024ResourceInputStream_available
(Thread*, object, uintptr_t* arguments)
{
int64_t peer; memcpy(&peer, arguments, 8);
@ -211,7 +211,7 @@ Avian_avian_resource_Handler_00024ResourceInputStream_available
}
extern "C" JNIEXPORT int64_t JNICALL
Avian_avian_resource_Handler_00024ResourceInputStream_read__JI
Avian_avian_avianvmresource_Handler_00024ResourceInputStream_read__JI
(Thread*, object, uintptr_t* arguments)
{
int64_t peer; memcpy(&peer, arguments, 8);
@ -226,7 +226,7 @@ Avian_avian_resource_Handler_00024ResourceInputStream_read__JI
}
extern "C" JNIEXPORT int64_t JNICALL
Avian_avian_resource_Handler_00024ResourceInputStream_read__JI_3BII
Avian_avian_avianvmresource_Handler_00024ResourceInputStream_read__JI_3BII
(Thread* t, object, uintptr_t* arguments)
{
int64_t peer; memcpy(&peer, arguments, 8);
@ -251,7 +251,7 @@ Avian_avian_resource_Handler_00024ResourceInputStream_read__JI_3BII
}
extern "C" JNIEXPORT void JNICALL
Avian_avian_resource_Handler_00024ResourceInputStream_close
Avian_avian_avianvmresource_Handler_00024ResourceInputStream_close
(Thread*, object, uintptr_t* arguments)
{
int64_t peer; memcpy(&peer, arguments, 8);

View File

@ -602,7 +602,7 @@ class BuiltinElement: public JarElement {
}
virtual const char* urlPrefix() {
return "avian_vm_resource:";
return "avianvmresource:";
}
virtual const char* sourceUrl() {