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

Refactorring problems when regenerating #15

Open
cfsnook opened this issue Jun 25, 2021 · 1 comment
Open

Refactorring problems when regenerating #15

cfsnook opened this issue Jun 25, 2021 · 1 comment

Comments

@cfsnook
Copy link
Member

cfsnook commented Jun 25, 2021

James: The Refactoring in the latest packaging is not rebuilding/generating the Component view and leads to errors. The fix is to simply go into each component refactored and build again, but it caught us off guard to begin with. Information is being unlinked during the refactoring process even though it has not been refactored in previous refinements i.e. variables not defined although present in the event-b code. Perhaps this relates to a refresh issue?

@cfsnook
Copy link
Member Author

cfsnook commented Jun 25, 2021

One of the stack traces describes an npe in the 'removeGenerated' method of the GeneratedRemover (used before re-generating). The problem appears to be that Change Records still refer to an element that is being removed. (see delete operation in the code below) and getting the change record object fails, presumbaly because it still referes to other objects that have also been removed.

    public List<Resource> removeGenerated(){
         modifiedResources = new ArrayList<Resource>();
         List<EObject> previouslyGeneratedElements = getPreviouslyGeneratedElements(
                (EventBNamedCommentedComponentElement)    abstractExtension.getContaining(CorePackage.Literals.EVENT_BNAMED_COMMENTED_COMPONENT_ELEMENT));
        for (EObject eObject : previouslyGeneratedElements){    
            EcoreUtil.delete(eObject, true);    //this deletes the object from its containment and removes all references to it and its    content
      }

    return modifiedResources;

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