prabalpratap123 / radar-netbeans

Automatically exported from code.google.com/p/radar-netbeans
0 stars 0 forks source link

Wrong SimpleDateFormat in JSON report analysis #18

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The plugin doesn't works during the parsing of JSON sonar's result (bad date 
format).

I tried with several Sonar versions:
- SonarQube 4.4
- SonarQube 4.3.3
- SonarQube 4.2
- SonarQube 3.7.4

The problem is in the Java file qubexplorer/runner/SonarRunnerResult.java (at 
line 168).
The declared SimpleDateFormat is "yyyy-MM-dd'T'HH:mm:ss-SSSS" but it's wrong. 
The final 5 chars represent an RFC 822 time zone, not 4 milliseconds separated 
by an '-'.

The correct SimpleDateFormat should be the following: "yyyy-MM-dd'T'HH:mm:ssZ" 
(I compiled the plugin by myself and it's working now).

The problem will be visible if you change your timezone to someone with 
positive offset from Greenwich (I live in Italy with +0100 timezone plus 
daylight savings time). The final timezone for me is "+0200" and the old code 
generate an exception.

Thanks for the excellent plugin,
Sergio

Original issue reported on code.google.com by montanar...@gmail.com on 22 Aug 2014 at 10:19

GoogleCodeExporter commented 8 years ago
Many thanks for the bug report and fix, Sergio.

Original comment by hmvic...@gmail.com on 24 Aug 2014 at 11:38

GoogleCodeExporter commented 8 years ago
The fix by Sergio was applied in the code and released. Thank you so much for 
your contribution.

Original comment by hmvic...@gmail.com on 25 Aug 2014 at 3:47