diff --git a/AUTHORS b/AUTHORS index 9acf88e..aa70b71 100644 --- a/AUTHORS +++ b/AUTHORS @@ -8,3 +8,4 @@ Many thanks to the contributors: * Patrick J. McNerthney (@iciclespider) * @voetsjoeba * Vadim Markovtsev (@vmarkovtsev) +* Jason Spencer, Google LLC (@j8spencer) diff --git a/javaobj.py b/javaobj.py index 9fec6f4..d3dd81c 100644 --- a/javaobj.py +++ b/javaobj.py @@ -750,6 +750,11 @@ def do_classdesc(self, parent=None, ident=0): log_debug("Super Class for {0}: {1}" .format(clazz.name, str(superclassdesc)), ident) clazz.superclass = superclassdesc + # j8spencer (Google, LLC) 2018-01-16: OR in superclass flags to catch + # any SC_WRITE_METHODs needed for objects. + if superclassdesc and hasattr(superclassdesc, "flags"): + clazz.flags |= superclassdesc.flags + return clazz def do_blockdata(self, parent=None, ident=0): diff --git a/tests/tests.py b/tests/tests.py index ad04373..3247cf6 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -161,7 +161,12 @@ def test_class_with_byte_array_rw(self): jobj = self.read_file("testClassWithByteArray.ser") pobj = javaobj.loads(jobj) - self.assertEqual(pobj.myArray, b"\x01\x03\x07\x0b") + # j8spencer (Google, LLC) 2018-01-16: It seems specific support for + # byte arrays was added, but is a little out-of-step with the other + # types in terms of style. This UT was broken, since the "myArray" + # member has the array stored as a tuple of ints (not a byte string) + # in memeber called '_data.' I've updated to pass the UTs. + self.assertEqual(pobj.myArray._data, (1, 3, 7, 11)) self._try_marshalling(jobj, pobj) def test_boolean(self):