Uploaded image for project: 'Directory Studio'
  1. Directory Studio
  2. DIRSTUDIO-1046

EntryEditorManager constructor can throw NPE

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0.0-M8 (2.0.0.v20130628)
    • Fix Version/s: None
    • Component/s: studio-ldapbrowser
    • Labels:
      None

      Description

      Using the BrowserWidget in a wizard rather than the BrowserView can result in a NullPointerException being thrown.

      The BrowseWidget is embedded in a WizardPage so the org.apache.directory.ldapbrowser.ui plugin has not necessarily been activated. However, during a refresh of the BrowserWidget's tree view, a worker-runnable calls on resources of the ldapbrowser.ui plugin and it is activated.

      The activation of the ldapbrowser.ui plugin calls

      entryEditorManager = new EntryEditorManager();
      

      The constructor of the EntryEditorManager contains

      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener( partListener );
      

      This code only works if called from the UI thread. Otherwise, getActiveWorkbenchWindow() returns null hence the NPE.

      Since a runnable is responsible for the plugin activation in this use-case then this behaviour occurs.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              phantomjinx Paul Richardson
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: