This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Multiple project run - projects do not run in display order | ||
---|---|---|---|
Product: | platform | Reporter: | mclaborn <mclaborn> |
Component: | Explorer | Assignee: | Jan Peska <JPESKA> |
Status: | REOPENED --- | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 8.1 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | IDE log |
Description
mclaborn
2015-11-16 22:29:50 UTC
Created attachment 157367 [details]
IDE log
Update on this. If you click once on the first project and then once on the last project, they seem to run in order. If you do that, then ctrl + click to de-select some in the middle of the list, the order is messed up. Can you please provide more details. I've tried to reproduce it, but the project always run in the order, I've selected them. This is 100% repeatable for me. I have 4 projects that are next to each other, call them A, B, C and D. Scenario 1: - Click on A - Shift+Click on D - All 4 projects are selected - Right click and Run - Projects run in order A,B,C,D (this is good) Scenario 2: - Click on A - Shift+Click on D - Ctrl+Click on B to deselect it - Right click and Run - Projects run in this order: D,C,A (this is bad) Reproducible Thanks for scenarios. Probably not related to java/projects but generic projects. But I will take a look. The order of selected nodes is done by BeanTreeView, reassigning to explorer. However while debugging I've found the problematic part which is in the JDK's DefaultTreeSelectionModel. Removing the node calls DefaultTreeSelectionModel.removeSelectionPaths(TreePath[] paths) which does: /* Find the paths that can be removed. */ for (int removeCounter = paths.length - 1; removeCounter >= 0; removeCounter--) { if(paths[removeCounter] != null) { if (uniquePaths.get(paths[removeCounter]) != null) { if(pathsToRemove == null) pathsToRemove = new Vector<PathPlaceHolder>(paths.length); uniquePaths.remove(paths[removeCounter]); pathsToRemove.addElement(new PathPlaceHolder (paths[removeCounter], false)); } } } And later: Enumeration<TreePath> pEnum = uniquePaths.keys(); int validCount = 0; selection = new TreePath[selection.length - removeCount]; while (pEnum.hasMoreElements()) { selection[validCount++] = pEnum.nextElement(); } The problem is that uniquePaths is a Hashtable which does not preserve order. So the composite selection does not preserve order. |