Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
OR together all flags for base classes; change byte array unit test c…
…ompare type.
  • Loading branch information
ggjspencer committed Jan 16, 2018
commit a58988f5a3e12329f59746b726ad9ef29ccc70e3
5 changes: 5 additions & 0 deletions javaobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
7 changes: 6 additions & 1 deletion tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down