SonarQube Eclipse
  1. SonarQube Eclipse
  2. SONARIDE-193

NPE - Problems occurred when invoking code from plug-in: "org.sonar.ide.eclipse.ui".

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.0
    • Fix Version/s: 2.4
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Hello,

      I got the following exception showing up in the Eclipse logs. Unfortunately I am unale to say what I was doing when I got it.

      !ENTRY org.sonar.ide.eclipse.ui 4 2 2011-01-31 10:56:37.631
      !MESSAGE Problems occurred when invoking code from plug-in: "org.sonar.ide.eclipse.ui".
      !STACK 0
      java.lang.NullPointerException
      	at org.sonar.ide.eclipse.internal.ui.views.MeasuresView$1.updated(MeasuresView.java:100)
      	at org.sonar.ide.eclipse.internal.ui.FavouriteMetricsManager$1.run(FavouriteMetricsManager.java:73)
      	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
      	at org.sonar.ide.eclipse.internal.ui.FavouriteMetricsManager.notifyListeners(FavouriteMetricsManager.java:71)
      	at org.sonar.ide.eclipse.internal.ui.FavouriteMetricsManager.set(FavouriteMetricsManager.java:57)
      	at org.sonar.ide.eclipse.internal.ui.preferences.FavouriteMetricsPreferencePage.performOk(FavouriteMetricsPreferencePage.java:113)
      	at org.eclipse.jface.preference.PreferenceDialog$13.run(PreferenceDialog.java:964)
      	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
      	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
      	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
      	at org.eclipse.jface.preference.PreferenceDialog.okPressed(PreferenceDialog.java:944)
      	at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.okPressed(FilteredPreferenceDialog.java:447)
      	at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.okPressed(WorkbenchPreferenceDialog.java:169)
      	at org.eclipse.jface.preference.PreferenceDialog.buttonPressed(PreferenceDialog.java:233)
      	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
      	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
      	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:4066)
      	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
      	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
      	at org.eclipse.jface.window.Window.open(Window.java:801)
      	at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPreferenceDialog.java:211)
      	at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65)
      	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
      	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
      	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
      	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
      	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:4066)
      	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
      	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
      	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
      	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
      	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
      	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
      	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
      	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
      	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
      	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:369)
      	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:619)
      	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
      	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
      	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
      

        Activity

        Hide
        Evgeny Mandrikov added a comment -

        Hi,
        May I ask you to stop creation of similar issues? And switch to users mailing list (http://www.sonarsource.org/support) to investigate your problem. Looks like you have incorrect server configuration (wrong url, wrong version, ...)

        Show
        Evgeny Mandrikov added a comment - Hi, May I ask you to stop creation of similar issues? And switch to users mailing list ( http://www.sonarsource.org/support ) to investigate your problem. Looks like you have incorrect server configuration (wrong url, wrong version, ...)
        Hide
        Jean-Noel Rouvignac added a comment -

        By looking at this code:
        http://svn.codehaus.org/sonar-ide/trunk/eclipse/org.sonar.ide.eclipse.ui/src/org/sonar/ide/eclipse/internal/ui/views/MeasuresView.java

        private FavouriteMetricsManager.Listener favouriteMetricsListener = new FavouriteMetricsManager.Listener() {
        public void updated() {
        // FIXME: NPE on next line
        Collection<ISonarMeasure> favourites = measuresByDomain.get(FAVORITES_CATEGORY);
        if (favourites == null) {
        [snip...]

        Indeed, the instance member measuresByDomain can be null if the method run() from the anonymous AbstractRemoteSonarJob class is not executed before the updated() method frm the anonymous FavouriteMetricsManager.Listener class.
        It looks like a hard to reproduce bug.

        Show
        Jean-Noel Rouvignac added a comment - By looking at this code: http://svn.codehaus.org/sonar-ide/trunk/eclipse/org.sonar.ide.eclipse.ui/src/org/sonar/ide/eclipse/internal/ui/views/MeasuresView.java private FavouriteMetricsManager.Listener favouriteMetricsListener = new FavouriteMetricsManager.Listener() { public void updated() { // FIXME: NPE on next line Collection<ISonarMeasure> favourites = measuresByDomain.get(FAVORITES_CATEGORY); if (favourites == null) { [snip...] Indeed, the instance member measuresByDomain can be null if the method run() from the anonymous AbstractRemoteSonarJob class is not executed before the updated() method frm the anonymous FavouriteMetricsManager.Listener class. It looks like a hard to reproduce bug.
        Hide
        David Gageot added a comment -

        Could not reproduce but fixed the code to avoid NPE

        Show
        David Gageot added a comment - Could not reproduce but fixed the code to avoid NPE

          People

          • Assignee:
            David Gageot
            Reporter:
            Jean-Noel Rouvignac
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: