hmvictor / radar-netbeans

A SonarQube plugin for Netbeans
Other
33 stars 22 forks source link

NullPointer on "Show Rule Info" #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.launch "Get Issues with Sonar Runner"
2.right click on an issue
3.choose "Show Rule Info"
4.Netbeans alerts that a NullPointerException occured

What is the expected output? What do you see instead?
Expecting detail of the Rule, as shown in the snapshot on the project homepage.
Instead Netbeans alerts that an error occured.

What version of the product are you using? On what operating system?
- Netbeans 8.0.1
- radar-netbeans 2.1
- sonarqube 4.2
- Windows 7 x64

Please provide any additional information below.

StackTrace :
 :
java.lang.NullPointerException
    at qubexplorer.server.RuleSearchClient.getRule(RuleSearchClient.java:40)
    at qubexplorer.server.SonarQube.getRule(SonarQube.java:170)
    at qubexplorer.ui.RuleTask.execute(RuleTask.java:26)
    at qubexplorer.ui.RuleTask.execute(RuleTask.java:14)
    at qubexplorer.ui.task.TaskExecutor$TaskWorker.doInBackground(TaskExecutor.java:61)
    at javax.swing.SwingWorker$1.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at javax.swing.SwingWorker.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[catch] at java.lang.Thread.run(Unknown Source)

Original issue reported on code.google.com by jlama...@gmail.com on 25 Nov 2014 at 11:03

GoogleCodeExporter commented 9 years ago
Found that the /api/rules/show of Sonar 4.2 returns a JSON response with 
"description" attribute and not "htmlDesc".
A simple check on null after trying get("htmlDesc") and if null try 
"description" will be provide compatibility for at least SonarQube 4.5 and 4.2 
on the "Show Rule Info" feature;

Original comment by jlama...@gmail.com on 25 Nov 2014 at 11:35

GoogleCodeExporter commented 9 years ago

Original comment by hmvic...@gmail.com on 1 Dec 2014 at 5:22

GoogleCodeExporter commented 9 years ago
Fix applied as suggested. Will be included in Radar 2.2.

Many thanks for reporting and providing solution. 

Original comment by hmvic...@gmail.com on 3 Dec 2014 at 6:30