Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
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 :
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()))
[snip...]
Adding a null check for the metric local variable would prevent the NPE from being thrown.
Issue Links
- is related to
-
SONARIDE-325
NPE during 'Loading Measures'
-
I'd like to add the steps on how I got this NPE:
Given
Then
Expected result:
Actual result: