Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 2.4
    • Component/s: Measures View
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      The following exception keep showing up in Eclipse log file:

      !ENTRY org.eclipse.core.jobs 4 2 2011-01-31 11:00:28.834
      !MESSAGE An internal error occurred during: "Loading measures".
      !STACK 0
      java.lang.NullPointerException
      	at org.sonar.ide.eclipse.internal.ui.views.MeasuresView.getMeasures(MeasuresView.java:311)
      	at org.sonar.ide.eclipse.internal.ui.views.MeasuresView$6.run(MeasuresView.java:271)
      	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
      

      By looking at Sonar code, there is an opportunity for an NPE there:

      [snip...]
      public class MeasuresView extends AbstractSonarInfoView {
      [snip...]
      final Metric metric = metricsByKey.get(measure.getMetricKey());
      // Hacks around SONAR-1620
      if ( !metric.getHidden() && !"DATA".equals(metric.getType()) && StringUtils.isNotBlank(measure.getFormattedValue()))

      { result.add(SonarCorePlugin.createSonarMeasure(sonarResource, metric, measure)); }

      [snip...]

      Adding a null check for the metric local variable would prevent the NPE from being thrown.

        Issue Links

          Activity

          Hide
          Jean-Noel Rouvignac added a comment - - edited

          I'd like to add the steps on how I got this NPE:

          Given

          • Sonar IDE plugin is activated for a project in Eclipse
          • In the Sonar perspective
          • The Sonar > Measures view is opened

          Then

          • I opened a file in Eclipse

          Expected result:

          • The measures are loaded in the view.

          Actual result:

          • I received the NPE mentionned above and the measures are not loaded in the view.
          Show
          Jean-Noel Rouvignac added a comment - - edited I'd like to add the steps on how I got this NPE: Given Sonar IDE plugin is activated for a project in Eclipse In the Sonar perspective The Sonar > Measures view is opened Then I opened a file in Eclipse Expected result: The measures are loaded in the view. Actual result: I received the NPE mentionned above and the measures are not loaded in the view.
          Show
          Jean-Noel Rouvignac added a comment - I looked at the code in: http://svn.codehaus.org/sonar-ide/trunk/eclipse/org.sonar.ide.eclipse.ui/src/org/sonar/ide/eclipse/internal/ui/views/MeasuresView.java
          Hide
          David Alves added a comment -

          Any idea if this is being considered to fix anytime soon? It seems like a very simple fix. Without it, the product is virtually not usable, as no Measures come back?

          Show
          David Alves added a comment - Any idea if this is being considered to fix anytime soon? It seems like a very simple fix. Without it, the product is virtually not usable, as no Measures come back?
          Hide
          Ramanan Sathiyanarayanan added a comment -

          Hi, Any idea when this will be fixed. Without the fix, the Measures view is not working. Most of the package/project level numbers are shown in this view. It would be really helpful it is fixed soon. Thanks.

          Show
          Ramanan Sathiyanarayanan added a comment - Hi, Any idea when this will be fixed. Without the fix, the Measures view is not working. Most of the package/project level numbers are shown in this view. It would be really helpful it is fixed soon. Thanks.
          Hide
          jerome jandot added a comment - - edited

          Hi, it's very important to fix it quickly (this bug come all the time and the plugin is difficult to use).
          2.4 -> october 2012 ... very very long time to fix this major bug.
          a workaround before the fix ?

          Thanks

          Show
          jerome jandot added a comment - - edited Hi, it's very important to fix it quickly (this bug come all the time and the plugin is difficult to use). 2.4 -> october 2012 ... very very long time to fix this major bug. a workaround before the fix ? Thanks
          Hide
          Freddy Mallet added a comment -

          Manually tested !

          Show
          Freddy Mallet added a comment - Manually tested !
          Hide
          Christian Best added a comment -

          Is this issue really fixed?

          When I click on a class instead of getting the informations for the class, I get a nullpointer. The connections works fine. Tested it in the settings. This is in the log:

          !ENTRY org.eclipse.core.jobs 4 2 2012-11-09 10:41:05.999
          !MESSAGE An internal error occurred during: "Loading measures".
          !STACK 0
          java.lang.NullPointerException
          at org.sonar.ide.eclipse.internal.ui.views.MeasuresView.getMeasures(MeasuresView.java:347)
          at org.sonar.ide.eclipse.internal.ui.views.MeasuresView$6.run(MeasuresView.java:297)
          at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

          Show
          Christian Best added a comment - Is this issue really fixed? When I click on a class instead of getting the informations for the class, I get a nullpointer. The connections works fine. Tested it in the settings. This is in the log: !ENTRY org.eclipse.core.jobs 4 2 2012-11-09 10:41:05.999 !MESSAGE An internal error occurred during: "Loading measures". !STACK 0 java.lang.NullPointerException at org.sonar.ide.eclipse.internal.ui.views.MeasuresView.getMeasures(MeasuresView.java:347) at org.sonar.ide.eclipse.internal.ui.views.MeasuresView$6.run(MeasuresView.java:297) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
          Hide
          Christian Best added a comment -

          Is there no way to edit a comment?

          My version number is: 2.4.0.20120918-1351

          Show
          Christian Best added a comment - Is there no way to edit a comment? My version number is: 2.4.0.20120918-1351
          Hide
          Freddy Mallet added a comment -

          Hi Christian, in that case this is another bug, feel free to create another ticket. Thanks

          Show
          Freddy Mallet added a comment - Hi Christian, in that case this is another bug, feel free to create another ticket. Thanks

            People

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

              Dates

              • Created:
                Updated:
                Resolved: