/hg/icedtea-web: Fix accessing Java array elements from Javascri...
jkang at icedtea.classpath.org
jkang at icedtea.classpath.org
Thu Jan 29 17:25:03 UTC 2015
changeset 382fb9c6634f in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=382fb9c6634f
author: Jie Kang <jkang at redhat.com>
date: Thu Jan 29 12:22:18 2015 -0500
Fix accessing Java array elements from Javascript. PR1298.
2015-01-29 Jie Kang <jkang at redhat.com>
Fix accessing Java array elements from Javascript. PR1298. Fix provided by
Marcin Cieslak
* AUTHORS : Add Marcin Cieslak to authors.
* NEWS : Add fix to news
* plugin/icedteanp/IcedTeaPluginUtils.cc: (javaObjectResultToNPVariant) add
jclass_name parameter to javaObjectResultToNPVariant function and use to
determine type of object.
diffstat:
AUTHORS | 1 +
ChangeLog | 10 ++++++++++
NEWS | 1 +
plugin/icedteanp/IcedTeaPluginUtils.cc | 9 ++++++---
4 files changed, 18 insertions(+), 3 deletions(-)
diffs (77 lines):
diff -r 16760ac4a689 -r 382fb9c6634f AUTHORS
--- a/AUTHORS Wed Jan 28 10:12:28 2015 -0500
+++ b/AUTHORS Thu Jan 29 12:22:18 2015 -0500
@@ -5,6 +5,7 @@
Andrew Azores <aazores at redhat.com>
Deepak Bhole <dbhole at redhat.com>
Ricardo MartÃn Camarero <rickyepoderi at yahoo.es>
+Marcin Cieslak <marcin.cieslak at gmail.com>
Danesh Dadachanji <ddadacha at redhat.com>
Adam Domurad <adomurad at redhat.com>
Lukasz Dracz <ldracz at redhat.com>
diff -r 16760ac4a689 -r 382fb9c6634f ChangeLog
--- a/ChangeLog Wed Jan 28 10:12:28 2015 -0500
+++ b/ChangeLog Thu Jan 29 12:22:18 2015 -0500
@@ -1,3 +1,13 @@
+2015-01-29 Jie Kang <jkang at redhat.com>
+
+ Fix accessing Java array elements from Javascript. PR1298. Fix provided by
+ Marcin Cieslak
+ * AUTHORS : Add Marcin Cieslak to authors.
+ * NEWS : Add fix to news
+ * plugin/icedteanp/IcedTeaPluginUtils.cc: (javaObjectResultToNPVariant) add
+ jclass_name parameter to javaObjectResultToNPVariant function and use to
+ determine type of object.
+
2015-01-28 Jie Kang <jkang at redhat.com>
Refactor initialize/download runnable out of ResourceTracker and add tests
diff -r 16760ac4a689 -r 382fb9c6634f NEWS
--- a/NEWS Wed Jan 28 10:12:28 2015 -0500
+++ b/NEWS Thu Jan 29 12:22:18 2015 -0500
@@ -29,6 +29,7 @@
- added support for -html switch for javaws. Now you can run most of the applets without browser at all
* Plugin
- PR1743 - Intermittant deadlock in PluginRequestProcessor
+ - PR1298 - LiveConnect - problem setting array elements (applet variables) from JS
- RH1121549: coverity defects
- Resolves method overloading correctly with superclass heirarchy distance
* PolicyEditor
diff -r 16760ac4a689 -r 382fb9c6634f plugin/icedteanp/IcedTeaPluginUtils.cc
--- a/plugin/icedteanp/IcedTeaPluginUtils.cc Wed Jan 28 10:12:28 2015 -0500
+++ b/plugin/icedteanp/IcedTeaPluginUtils.cc Thu Jan 29 12:22:18 2015 -0500
@@ -863,7 +863,7 @@
}
static bool
-javaObjectResultToNPVariant(NPP instance, const std::string& jobject_id, NPVariant* variant)
+javaObjectResultToNPVariant(NPP instance, const std::string& jclass_name, const std::string& jobject_id, NPVariant* variant)
{
// Reference the class object so we can construct an NPObject with it and the instance
@@ -878,12 +878,14 @@
std::string jclass_id = *jclass_result->return_string;
NPObject* obj;
- if (jclass_id.at(0) == '[') // array
+ if (jclass_name.at(0) == '[') // array
{
+ PLUGIN_DEBUG( "javaObjectResultToNPVariant Array detected: \"%s\"\n", jclass_name.c_str());
obj = IcedTeaScriptableJavaObject::get_scriptable_java_object(instance, jclass_id,
jobject_id, true);
} else
{
+ PLUGIN_DEBUG( "javaObjectResultToNPVariant Scalar object: \"%s\"\n", jclass_name.c_str());
obj = IcedTeaScriptableJavaObject::get_scriptable_java_object(instance, jclass_id,
jobject_id, false);
}
@@ -924,7 +926,8 @@
return javaStringResultToNPVariant(jobject_id, variant);
} else // Else this needs a java object wrapper
{
- return javaObjectResultToNPVariant(instance, jobject_id, variant);
+ return javaObjectResultToNPVariant(instance, *jclassname_result->return_string,
+ jobject_id, variant);
}
}
More information about the distro-pkg-dev
mailing list