kit-sdq-emf-refactor-fork / edu.kit.ipd.sdq.emf.refactor

These projects extend EMF Refactor by smell detections that have been transfered from object orientation to metamodeling.
Eclipse Public License 1.0
0 stars 0 forks source link

Applying smell detection directly on subpackages deletes the subpackage #11

Open MishaStrittmatter opened 5 years ago

MishaStrittmatter commented 5 years ago

This might be related to the modular metamodel support hack (adding all packages to a new package). A package that is contained in another package (and not in a resource) is then removed from its parent package.

MishaStrittmatter commented 5 years ago

See this also this exception. The move is not persisted. Nevertheless, the package disappears in the tree editor until it is reopened.

!ENTRY org.eclipse.ui 4 0 2019-02-21 13:12:04.822 !MESSAGE Unhandled event loop exception !STACK 0 org.eclipse.e4.core.di.InjectionException: java.lang.IllegalStateException: Cannot modify resource set without a write transaction at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:65) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:239) at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487) at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:431) at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:446) at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:472) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590) at org.eclipse.equinox.launcher.Main.run(Main.java:1499) at org.eclipse.equinox.launcher.Main.main(Main.java:1472) Caused by: java.lang.IllegalStateException: Cannot modify resource set without a write transaction at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(TransactionChangeRecorder.java:349) at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:303) at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processObjectNotification(TransactionChangeRecorder.java:285) at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:241) at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374) at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1027) at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addAllUnique(NotifyingListImpl.java:482) at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addAllUnique(NotifyingListImpl.java:400) at org.eclipse.emf.common.util.AbstractEList.addAll(AbstractEList.java:372) at org.eclipse.emf.refactor.smells.runtime.handler.FindModelSmellHandler.execute(FindModelSmellHandler.java:81) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:291) at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:92) at jdk.internal.reflect.GeneratedMethodAccessor126.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) ... 37 more

aminekechaou commented 5 years ago

fixed https://github.com/kit-sdq-emf-refactor-fork/org.eclipse.emf.refactor.smells/commit/3e70bb83b33c6f9474f3b79d25f38019fae42a1d

MishaStrittmatter commented 5 years ago

I can confirm, the exception is gone and I can no longer detect any funny side effects. In the tree editor, the package disappears and reappears as a last element when the analysis is done. A modification and save in the editor persists its location. This is currently negligible.