Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XMIResource load throws RangeError #18

Closed
krissrex opened this issue Feb 26, 2021 · 1 comment
Closed

XMIResource load throws RangeError #18

krissrex opened this issue Feb 26, 2021 · 1 comment

Comments

@krissrex
Copy link

krissrex commented Feb 26, 2021

Description: I don't know if I'm using this correctly, but I have a model that I generated from crossecore-generator, and an XMI file created with Eclipse. When trying to load this xmi with crossecore, something in the model seems to recurse infinitely.

Expected: deserialization of the xmi should return a TreeDocument that I defined with ecore, and this has a TreeRoot as a child.

Actual: My TreeRoot cant be deserialized because it throws an error:

TreeRootBase.ts?fbfe:173 Uncaught RangeError: Maximum call stack size exceeded
    at TreeRootImpl.basicSetRootNode (TreeRootBase.ts?fbfe:173)
    at TreeRootImpl.set (TreeRootBase.ts?fbfe:41)
    at TreeRootImpl.basicSetRootNode (TreeRootBase.ts?fbfe:173)
    at TreeRootImpl.set (TreeRootBase.ts?fbfe:41)
    at TreeRootImpl.basicSetRootNode (TreeRootBase.ts?fbfe:173)
    at TreeRootImpl.set (TreeRootBase.ts?fbfe:41)
    at TreeRootImpl.basicSetRootNode (TreeRootBase.ts?fbfe:173)
    at TreeRootImpl.set (TreeRootBase.ts?fbfe:41)
    at TreeRootImpl.basicSetRootNode (TreeRootBase.ts?fbfe:173)
    at TreeRootImpl.set (TreeRootBase.ts?fbfe:41)

How I load it:

export function loadXmi(): TreeDocument {
  const resource = new XmiResource(
  TreedocumentmodelPackageImpl.eINSTANCE,
  TreedocumentmodelFactoryImpl.eINSTANCE,
  new DOMParser()
);

const doc = resource.load(treeDocument) as TreeDocument;  // This crashes
@krissrex
Copy link
Author

I tried without XMI, and it turns out the deserialization is not the problem.
It also crashes with root.rootNode = rootNode;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant