Bug 381036 - Unable to find Review items from imported maven projects
Summary: Unable to find Review items from imported maven projects
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 1.0   Edit
Assignee: Alvaro Sanchez-Leon CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks: 381373
  Show dependency tree
 
Reported: 2012-05-30 08:57 EDT by Alvaro Sanchez-Leon CLA
Modified: 2012-06-01 15:06 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alvaro Sanchez-Leon CLA 2012-05-30 08:57:52 EDT
Setup: 
=====

Eclipse 3.7
EGit 1.0.0
m2e 1.0
m2e-egit 0.14
r4e 0.10.0

"Import Maven Projects" from the eclipse egit repositories view

Switch to the Java perspective. Right click on the project and choose "Team > Share Project". Select "Git" and be sure to tick the box "Use or create repository in parent folder of project".


Create an R4E Review Group
Create an R4E REview
Select one of the imported maven projects and select R4E Find Review Items

you will get.
--- Exception in Eclipse Log ----
 
 
!ENTRY org.eclipse.mylyn.git.ui 4 0 2012-05-24 10:59:34.338
!MESSAGE org.eclipse.core.runtime.CoreException: TreeWalk should have exactly two trees.
!STACK 1
org.eclipse.core.runtime.CoreException: TreeWalk should have exactly two trees.
        at org.eclipse.mylyn.internal.git.core.GitConnector.getChangeSet(GitConnector.java:149)
        at org.eclipse.mylyn.internal.git.ui.GetChangeSetDialog.updateChangeSet(GetChangeSetDialog.java:461)
        at org.eclipse.mylyn.internal.git.ui.GetChangeSetDialog.populateNextChangeSets(GetChangeSetDialog.java:292)
        at org.eclipse.mylyn.internal.git.ui.GetChangeSetDialog.createFormContent(GetChangeSetDialog.java:244)
        at org.eclipse.ui.forms.FormDialog.createDialogArea(FormDialog.java:92)
        at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:760)
        at org.eclipse.jface.window.Window.create(Window.java:431)
        at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
        at org.eclipse.jface.window.Window.open(Window.java:790)
        at org.eclipse.mylyn.internal.git.ui.connector.GitConnectorUi.getChangeSet(GitConnectorUi.java:52)
        at org.eclipse.mylyn.reviews.r4e.ui.internal.commands.handlers.FindReviewItemsHandler.execute(FindReviewItemsHandler.java:234)
        at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
        at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
        at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
        at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
        at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
        at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
        at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
        at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
        at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
        at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
        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)
!SUBENTRY 1 org.eclipse.mylyn.git.core 4 0 2012-05-24 10:59:34.339
!MESSAGE TreeWalk should have exactly two trees.
 
!ENTRY org.eclipse.ui 4 0 2012-05-24 10:59:34.341
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.RangeCheck(ArrayList.java:547)
        at java.util.ArrayList.get(ArrayList.java:322)
        at org.eclipse.mylyn.internal.git.ui.GetChangeSetDialog.createFormContent(GetChangeSetDialog.java:249)
        at org.eclipse.ui.forms.FormDialog.createDialogArea(FormDialog.java:92)
        at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:760)
        at org.eclipse.jface.window.Window.create(Window.java:431)
        at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
        at org.eclipse.jface.window.Window.open(Window.java:790)
        at org.eclipse.mylyn.internal.git.ui.connector.GitConnectorUi.getChangeSet(GitConnectorUi.java:52)
        at org.eclipse.mylyn.reviews.r4e.ui.internal.commands.handlers.FindReviewItemsHandler.execute(FindReviewItemsHandler.java:234)
        at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
        at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
        at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
        at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
        at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
        at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
        at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
        at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
        at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
        at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
        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)
Comment 1 Alvaro Sanchez-Leon CLA 2012-05-30 09:01:41 EDT
The issue is related to a filter in the Git connector UI, 
the intention of the filter is to only list commits which are related to the selected work space project, 
This is done by comparing the project path of the files under the commit against the selected project. 
 
These maven projects are imported in such a way that the folders containing a pom file are represented as a project in the work space, 
so all the files underneath will not appear to be related to the project under .project.
 
However somehow maven creates one main project which represent the hierarchy structure of the folders underneath the .project 
if you select the main projects to find the review items, R4E will be able to find the commits,
if you select any of the other pom related projects, R4E will not be able to resolve the commits as explained above.
 
Selecting the main projects as mentioned below can be used as a work around, the exceptions below need to be fixed.
Comment 2 Alvaro Sanchez-Leon CLA 2012-06-01 09:57:02 EDT
The implementation will be concentrated to fix the index out of bounds exception.
The treewalk exception is tracked on Bug 364622

The actual commits can be resolved by selecting the main project mentioned above. 

As for the possibility to make this work for the child imported maven projects, this needs a new api in Mylyn versions which is being tracked on Bug 381373
Comment 3 Alvaro Sanchez-Leon CLA 2012-06-01 15:06:24 EDT
Fix implemented as per comment 2