| Summary: | NPE in CustomizePerspectiveDialog in createMenuEntries | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Hendrik Eeckhaut <hendrik> |
| Component: | UI | Assignee: | Andrey Loskutov <loskutov> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert, ignacio, jed.anderson, jgangemi, loskutov |
| Version: | 4.3 | Keywords: | helpwanted |
| Target Milestone: | 4.5 M6 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://git.eclipse.org/r/41387 https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=681a940be7d8b5d62f2961cb856e65a6f01f853b https://git.eclipse.org/r/45843 https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=34f01a490d31a8591bf4a053d3be7192c1bb9972 |
||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 420956 | ||
|
Description
Hendrik Eeckhaut
What's your build id for your eclipse? (In the eclipse/configuration/config.ini file or in the Help>About dialog) Did you pick up an EPP from www.eclipse.org/downloads ? PW Hi Paul, my installation was not downloaded directly from eclipse.org. It was installed via Genuitec's SDC (Based on: Eclipse 4.3.0 IDE for Java and DSL Developers). I'm not sure this is exactly the same version. I just checked and have the same behaviour on Mac. Build id: I20130605-2000 Hendrik. Looks like we don't check for null after
if (menuItem instanceof MMenu) {
contributionItem = menuMngrRenderer.getManager((MMenu) menuItem);
} else {
contributionItem = menuMngrRenderer.getContribution(menuItem);
}
PW
Paul, is there a workaround we could use to dodge this missing null check while still filtering the org.eclipse.epp.mpc.ui.command.showMarketplaceWizard item? Maybe we could supply our own registration for that id but not have it be visible? Not being an e4 expert, I'm looking for a little guidance. (In reply to Jed Anderson from comment #4) > Paul, is there a workaround we could use to dodge this missing null check > while still filtering the > org.eclipse.epp.mpc.ui.command.showMarketplaceWizard item? How are you filtering that item? Setting its visibility to false? TBR? Or using activities/capabilities? PW What we found is that if we specified the following, we didn't see the NPE: element.setToBeRendered(false); element.setVisible(false); element.setParent(null); element.setOnTop(false); I'm not convinced all of this is necessary, but it does appear to work around the issue. (In reply to Jed Anderson from comment #6) > What we found is that if we specified the following, we didn't see the NPE: > > element.setToBeRendered(false); > element.setVisible(false); Using setToBeRendered(false) will remove the contribution item that is linked with the element. setVisible(false) removes the widget for an item. > element.setParent(null); This flat out removes it from the model, so it is orphaned. PW *** Bug 407453 has been marked as a duplicate of this bug. *** Proposed fix: https://git.eclipse.org/r/41387 It is a simple guard for misconfigured contributions (they will be not shown in CPD). New Gerrit change created: https://git.eclipse.org/r/41387 Gerrit change https://git.eclipse.org/r/41387 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=681a940be7d8b5d62f2961cb856e65a6f01f853b . Verified through meditation over the code in I20150318-2000 New Gerrit change created: https://git.eclipse.org/r/45843 Gerrit change https://git.eclipse.org/r/45843 was merged to [R4_4_maintenance]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=34f01a490d31a8591bf4a053d3be7192c1bb9972 |