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.
[200512122030] "I/O api" cannot be removed form NBCVS/ant module using project's customizer. I tried to copy the <modulesdependencies> xml tag project.xml to standalone project configuration. It also doesn't work.
There seems to be something terribly wrong. It works very strangely. Maybe P2...
There is some mess in comparator vs. compareTo vs. equals vs. hashCode which confuses SortedSets. Will have to be fixed also for 5.0.
BTW quite good catch :)
Oops, I made a really stupid typo in ModuleDependency... if (result != -1) { should be if (result != 0) { Same bug in PlatformComponentFactory and UIUtil. Amazing that this code worked long enough to pass through all our unit tests... I guess we were not testing sorting at all. Fix should include some new unit tests, at least for ModuleDependency.
Also we should override equals (+hashCode) in ModuleDependency when we implemented Comparable.compareTo() (cf. compareTo's javadoc). And with it change natural ordering of ModuleDependencies to CNB, not localized name. And provide LOCALIZED_NAME_COMPARATOR instead of CODE_NAME_BASE_COMPARATOR. Does it make sense?
All that makes sense for the trunk. For release50 we should probably limit ourselves to undoing the damage done by my last patch, which should be accomplished by changing -1 to 0, AFAIK.
Ok. I'm afraid that there is also some other ordering problems, hopefully without others impacts. I'll write tests and fix at least this. We will see.... Or feel free to retake if you want. I'm just going home, so I'll not definitely fix it in next two hours :)
Fixed (+ few sanity-check tests). I'll go through reviewers today and backport into 5.0. ui/UIUtil.java; 1.20 -> 1.21; ui/customizer/ModuleDependency.java; 1.15 -> 1.16; ui/platform/PlatformComponentFactory.java; 1.4 -> 1.5; test/unit/BrokenPlatformReferenceTest.java; 1.5 -> 1.6; test/unit/TestBase.java; 1.28 -> 1.29; test/unit/ui/UIUtilTest.java; 1.3 -> 1.4; test/unit/ui/customizer/ModuleDependencyTest.java; 1.1 test/unit/ui/platform/PlatformComponentFactoryTest.java; 1.1
Created attachment 27835 [details] release50-patch.diff
Attached fix against release50 branch. Jesse could you review it.
verified in trunk
Looks fine to me; thanks for handling this. For the trunk, UIUtilTest.testLayerItemPresenterCompareTo and ModuleDependencyTest.testCompareTo could probably be made more robust by having them operate on temporary external modules created by the test case with controlled display names.
Yes, also ModuleDependencyTest is little artifical (could use similar approach with implementing ModuleEntry probably). I'll rewrite them together with a polishing I mentioned above.
Backported into release50 (the same diff)
*** Issue 70589 has been marked as a duplicate of this issue. ***
verified