Fix parcelling code for structs containing interfaces
This change implements the proper parcel serialization/deserialization
functionality for structs containing interfaces; previously, structs
containing interfaces+{arrays,strings,vectors} would not be handled
correctly. The compile-time error was of the form:
// Here, the member variable ("array") of a struct ("swi") is referenced
// using the member access operator. However, this results in an invalid
// identifier name.
error: expected ';' at end of declaration
size_t _hidl_swi.array_parent;
^
Also updated the C++ and Java hidl_test suites.
Bug: 111019943
Test: Ran the hidl_test suite, including the new test-case
Change-Id: Ibcd6517737ed9038832884df11f4274e0dd8970c
diff --git a/VectorType.cpp b/VectorType.cpp
index 3ba3df5..cb7a658 100644
--- a/VectorType.cpp
+++ b/VectorType.cpp
@@ -546,7 +546,7 @@
void VectorType::emitJavaFieldInitializer(
Formatter &out, const std::string &fieldName) const {
const std::string typeName = getJavaType(false /* forInitializer */);
- const std::string fieldDeclaration = "final " + typeName + " " + fieldName;
+ const std::string fieldDeclaration = typeName + " " + fieldName;
emitJavaFieldDefaultInitialValue(out, fieldDeclaration);
}