Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 360262

Summary: Cannot add review item from file in CDT project explorer
Product: z_Archived Reporter: Sebastien Dubois <sebastien.dubois>
Component: MylynAssignee: Sebastien Dubois <sebastien.dubois>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: alvaro.sanchez-leon, lmcbout
Version: unspecified   
Target Milestone: 0.9   
Hardware: PC   
OS: All   
Whiteboard:

Description Sebastien Dubois CLA 2011-10-07 13:37:24 EDT
We cannot add a new review item manually using the CDT project explorer on a whole file.  Adding review items on CDT elements (i.e. within a file) however works fine
Comment 1 Sebastien Dubois CLA 2011-10-07 13:38:06 EDT
The following exception is generated:

java.lang.ClassCastException: org.eclipse.core.internal.resources.Folder incompatible with org.eclipse.core.resources.IFile
	at org.eclipse.mylyn.reviews.r4e.ui.internal.commands.NewReviewItemHandler.addReviewItemFromTree(NewReviewItemHandler.java:240)
	at org.eclipse.mylyn.reviews.r4e.ui.internal.commands.NewReviewItemHandler.access$1(NewReviewItemHandler.java:213)
	at org.eclipse.mylyn.reviews.r4e.ui.internal.commands.NewReviewItemHandler$1.runInUIThread(NewReviewItemHandler.java:122)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
	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:79)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:618)
	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)
Comment 2 Sebastien Dubois CLA 2011-10-21 16:45:04 EDT
Now all CDT elements can be added as Review Items properly.  However, when adding whole files as Review Item, the position is always set to 0.  This is because CDT does not return the proper position values and lines ranges on whole files, unlike JDT who does it.  We might want to file a bug on them for that if we want to have it.

In any case the current problem is fixed so I will close this bug