Github user neykov commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/59#discussion_r57022541
--- Diff:
core/src/main/java/org/apache/brooklyn/core/mgmt/persist/XmlMementoSerializer.java
---
@@ -454,25 +460,25 @@ public Object unmarshal(HierarchicalStreamReader
reader, UnmarshallingContext co
result.catalogItemId(catalogItemId);
return result;
} finally {
- instance = null;
+ SpecConverterLocalInstance.remove();
if (customLoaderSet) {
popXstreamCustomClassLoader();
}
}
}
- Object instance;
-
@Override
protected Object instantiateNewInstance(HierarchicalStreamReader
reader, UnmarshallingContext context) {
// the super calls getAttribute which requires that we have
not yet done moveDown,
// so we do this earlier and cache it for when we call
super.unmarshal
+ Object instance = SpecConverterLocalInstance.get();
--- End diff --
I believe you can put arbitrary objects in the `context`, just for cases
like this.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---