ponder-lab / Rejuvenate-Logging-Levels

An Eclipse plug-in research prototype for automatically rejuvenating log statement levels using degree of interest
Eclipse Public License 2.0
2 stars 3 forks source link

v1.6.0 DOA #266

Closed khatchad closed 4 years ago

khatchad commented 4 years ago

Version 1.6.0 is dead-on-arrival. Version 0.4.0 worked fine in the UI but no wizard comes up with v1.6.0. I tried it a few different ways and ultimately got an error message asking for some value for a key, which sounds like something that belongs in the evaluation plug-in but not in the UI plug-in.

khatchad commented 4 years ago

Here's the error I received. This key/value lookup doesn't belong in the UI plug-in. It should be set in the wizard:

org.eclipse.core.commands.ExecutionException: Error executing 'edu.cuny.hunter.log.ui.commands.sampleCommand': java.lang.NumberFormatException: There is no setting associated with the key "maxTransformationDistance"
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:170)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
    at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommandInContext(LegacyHandlerService.java:440)
    at org.eclipse.ui.internal.quickaccess.providers.CommandElement.execute(CommandElement.java:61)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4930)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4451)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:658)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    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:566)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1420)
Caused by: org.eclipse.e4.core.di.InjectionException: java.lang.NumberFormatException: There is no setting associated with the key "maxTransformationDistance"
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:68)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:318)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:252)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
    ... 31 more
Caused by: java.lang.NumberFormatException: There is no setting associated with the key "maxTransformationDistance"
    at org.eclipse.jface.dialogs.DialogSettings.getInt(DialogSettings.java:200)
    at edu.cuny.hunter.log.ui.wizards.LogWizard$LogInputPage.loadSettings(LogWizard.java:242)
    at edu.cuny.hunter.log.ui.wizards.LogWizard$LogInputPage.createControl(LogWizard.java:101)
    at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:178)
    at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:743)
    at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:635)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1094)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:183)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:212)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:126)
    at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:41)
    at edu.cuny.hunter.log.ui.wizards.LogWizard.startRefactoring(LogWizard.java:264)
    at edu.cuny.hunter.log.ui.handlers.LogHandler.execute(LogHandler.java:57)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)
    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:566)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
    ... 35 more
yiming-tang-cs commented 4 years ago

Actually, the version 1.6.0 is working. This is a screenshot from the tool of version 1.6.0. image

The bug you provided only happens if you run the UI before I add a new setting into UI. After adding a new setting, running the tool again can produce this error. Settings are not updated after I add a new setting. Users will not receive this error because they install the plugin in a fresh workspace. However, I will work on this bug.

yiming-tang-cs commented 4 years ago

This is a similar fix from stream project: https://github.com/ponder-lab/Optimize-Java-8-Streams-Refactoring/blob/493cab40f2ff5152993cd9e9960fdbf3db9534df/edu.cuny.hunter.streamrefactoring.ui/src/edu/cuny/hunter/streamrefactoring/ui/wizards/OptimizeStreamRefactoringWizard.java#L175

yiming-tang-cs commented 4 years ago

Fixed: https://github.com/ponder-lab/Logging-Level-Evolution-Plugin/commit/fb8c61ec8b8f875f7ad71704722da9bda64093e2 .

khatchad commented 4 years ago

I installed it on a fresh workspace and received this bug.