[jbosstools-issues] [JBoss JIRA] (JBIDE-9940) Quickfix and Wizard for fixing ambigious injection warning is confusing

Victor Rubezhny (Commented) (JIRA) jira-events at lists.jboss.org
Tue Nov 29 13:49:41 EST 2011


    [ https://issues.jboss.org/browse/JBIDE-9940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646427#comment-12646427 ] 

Victor Rubezhny commented on JBIDE-9940:
----------------------------------------

When played with TCK project's org.jboss.jsr299.tck.tests.jbt.quickfixes.Farm_Broken3 used
- "Specify 'Cow' bean for injection to the injection point" to add and specify new qualifier; 
- "Specify 'Cow' bean for injection to the injection point" to add Named qualifier.

As result, the following exceptions where found in Error log:

{code}
!ENTRY org.eclipse.jface 4 0 2011-11-29 21:34:14.642
!MESSAGE Unhandled event loop exception during blocked modal context.
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
	at org.eclipse.swt.SWT.error(SWT.java:4282)
	at org.eclipse.swt.SWT.error(SWT.java:4197)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:173)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:388)
	at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1029)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizard.internalPerformFinish(RefactoringWizard.java:605)
	at org.eclipse.ltk.internal.ui.refactoring.PreviewWizardPage.performFinish(PreviewWizardPage.java:384)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizard.performFinish(RefactoringWizard.java:678)
	at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
	at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog.finishPressed(RefactoringWizardDialog.java:108)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:181)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:193)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:116)
	at org.jboss.tools.cdi.ui.wizard.AbstractModifyInjectionPointWizard.showWizard(AbstractModifyInjectionPointWizard.java:44)
	at org.jboss.tools.cdi.ui.marker.MakeInjectedPointUnambiguousMarkerResolution.internal_run(MakeInjectedPointUnambiguousMarkerResolution.java:58)
	at org.jboss.tools.cdi.ui.marker.MakeInjectedPointUnambiguousMarkerResolution.run(MakeInjectedPointUnambiguousMarkerResolution.java:51)
	at org.eclipse.jdt.internal.ui.text.correction.proposals.MarkerResolutionProposal.apply(MarkerResolutionProposal.java:53)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:935)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertSelectedProposalWithMask(CompletionProposalPopup.java:881)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$27(CompletionProposalPopup.java:877)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$5.widgetDefaultSelected(CompletionProposalPopup.java:657)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:119)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.NullPointerException
	at org.jboss.tools.cdi.ui.refactoring.CDIRefactoringProcessor$CDIFileChange$1.run(CDIRefactoringProcessor.java:189)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	... 57 more
{code}
!ENTRY org.jboss.tools.cdi.ui 4 0 2011-11-29 21:36:57.455
!MESSAGE <import container> [in [Working copy] Cow.java [in org.jboss.jsr299.tck.tests.jbt.quickfixes [in JavaSource [in tck]]]] does not exist
!STACK 1
Java Model Exception: Java Model Status [<import container> [in [Working copy] Cow.java [in org.jboss.jsr299.tck.tests.jbt.quickfixes [in JavaSource [in tck]]]] does not exist]
	at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:495)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:529)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:255)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:241)
	at org.eclipse.jdt.internal.core.JavaElement.getChildren(JavaElement.java:196)
	at org.eclipse.jdt.internal.core.ImportContainer.getSourceRange(ImportContainer.java:83)
	at org.jboss.tools.cdi.ui.marker.MarkerResolutionUtils.addImport(MarkerResolutionUtils.java:180)
	at org.jboss.tools.cdi.ui.marker.MarkerResolutionUtils.addImport(MarkerResolutionUtils.java:110)
	at org.jboss.tools.cdi.ui.marker.MarkerResolutionUtils.addAnnotation(MarkerResolutionUtils.java:262)
	at org.jboss.tools.cdi.ui.marker.MarkerResolutionUtils.addQualifiersToBean(MarkerResolutionUtils.java:601)
	at org.jboss.tools.cdi.ui.marker.AddQualifiersToBeanProcessor.createChange(AddQualifiersToBeanProcessor.java:114)
	at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.createChange(ProcessorBasedRefactoring.java:292)
	at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:124)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
!SUBENTRY 1 org.eclipse.jdt.core 4 969 2011-11-29 21:36:57.456
!MESSAGE <import container> [in [Working copy] Cow.java [in org.jboss.jsr299.tck.tests.jbt.quickfixes [in JavaSource [in tck]]]] does not exist
{code}

{code}
                
> Quickfix and Wizard for fixing ambigious injection warning is confusing
> -----------------------------------------------------------------------
>
>                 Key: JBIDE-9940
>                 URL: https://issues.jboss.org/browse/JBIDE-9940
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: CDI
>            Reporter: Max Rydahl Andersen
>            Assignee: Victor Rubezhny
>            Priority: Blocker
>             Fix For: 3.3.0.M5
>
>         Attachments: addremovequalifiers.png, quickfix_specify_bean_for_injection.png, SpecifyCDIBean.png, SpecifyCDIBean3.png, SpecifyCDIBeanForInjectionPoint1.png, SpecifyCDIBeanForInjectionPoint2.png, SpecifyCDIBeanForInjectionPoint3.png, SpecifyCDIBeanNew.png
>
>
> Tried to use the quickfix for fixing ambigious injection points - it is *very* confusing.
> I use the jboss-javaee6-webapp quickstart from Central and I get a warning about ambigous injection (which is true since there are two on the classpath)
> I get this when trying to quickfix it:
> !quickfix_specify_bean_for_injection.png!
> The message reads "Specify <some injection source> bean for injection to injection point".
> That sounds to me like when I press this it will figure out which qualifiers that is to be set on this to make it choose this.
> When I choose one of these it give me this wizard:
> !addremovequalifiers.png!
> And now my confusion starts:
> 1) Its not clear what "Bean" it is referring to - it is written in the long text label but that is not the first thing you look at - this should be more clear.
> 2) Its error is saying "This set of qualifiers is not unique" immediately - but it doesn't say which beans its actually matching so you don't really know what kind of "uniqueness" that is the problem. 
>  Maybe we should write something like "We could not find a set of qualifiers that makes the LoggerProducer.produceLog() unique for @Injection Logger log. You can make it unique by changing the  qualifiers below"
> 3) Using Create Qualifier I actually get a new qualifier showing up in the editor behind the wizard but it does not show up in available list of qualifiers and now a completely different qualifier have been added to Available section.
> 4) When I actually do add qualifiers and pres Finish - there is no warning or information about what actually will change; I would expect a preview dialog for this especially since we are actually changing the Bean source and not the injection point we are coming from.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list