[RFF] SonarLint for Eclipse 2.5.0

413 views
Skip to first unread message

Julien HENRY

unread,
Dec 9, 2016, 4:45:09 AM12/9/16
to SonarLint
Hi everybody,

I'm starting request for feedback period for SonarLint for Eclipse 2.5.0.

You can install it using this update site:

New features:
  • support of C/C++ projects in connected mode. You need the SonarSource commercial C/C++ plugin installed on your SonarQube server. And also don't forget to install the optional CDT configuration helper (this will properly configure analysis by reusing CDT metadata).
Images intégrées 1
  • analysis of all changed files (pre-commit analysis). This new feature will interact with the SCM to collect all locally changed files, analyze them all, and publish results in a new dedicated view.
Images intégrées 2
Images intégrées 3

We also fixed many other issues. You can see the full changelog here:

Feedback is welcome until next Wednesday.

++

Julien

gilbert...@googlemail.com

unread,
Dec 12, 2016, 6:32:24 AM12/12/16
to SonarLint
Hi,
any chance to get the zipped update site as usual ?
Regards, Gilbert

alpe...@gmail.com

unread,
Dec 12, 2016, 6:42:00 AM12/12/16
to SonarLint
Hell Julien,

Thanks and congratulations for new version. I am really waiting for this future to analyse changed files.  So I immediately pickup it and install on my eclipse (Kepler).  I found 2 issues here (Note that no problem is viewing all issues with existing sonar issues window (renamed as SonarLint on-the-fly).

When I open file from project (in connected mode), I saw below exception on console. Note that it still shown me exactly same issue as server (may be with local analyzer)

error while fetching and matching server issues
java.lang.IllegalStateException: No issues in cache for file: 
at org.sonarlint.eclipse.core.internal.tracking.PersistentIssueTrackerCache.getLiveOrFail(PersistentIssueTrackerCache.java:80)
at org.sonarlint.eclipse.core.internal.tracking.IssueTracker.matchAndTrackAsBase(IssueTracker.java:64)
at org.sonarlint.eclipse.core.internal.tracking.ServerIssueUpdater$IssueUpdateRunnable.run(ServerIssueUpdater.java:111)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


When in "SonarLint report" view I clicked on "Current project" for SCM change set, I got below error

Unable to analyze changed files
java.lang.NullPointerException
at org.sonarlint.eclipse.core.internal.jobs.AnalyzeChangedFilesJob.collectChangedFiles(AnalyzeChangedFilesJob.java:109)
at org.sonarlint.eclipse.core.internal.jobs.AnalyzeChangedFilesJob.run(AnalyzeChangedFilesJob.java:59)



Not sure how is SonarLint identifying changes when no option to configure my SCM.  I am using IBM Clear Case 8.0.1 version and have installed eclipse plugin for that.

Regards,
Alpesh

Julien HENRY

unread,
Dec 12, 2016, 9:01:03 AM12/12/16
to gilbert...@googlemail.com, SonarLint
Hi Gilbert,

2016-12-12 12:32 GMT+01:00 gilbert.rebhan via SonarLint <sona...@googlegroups.com>:
any chance to get the zipped update site as usual ?

Julien HENRY

unread,
Dec 12, 2016, 9:13:22 AM12/12/16
to Alpesh Shah, SonarLint
Hi Alpesh,

2016-12-12 12:42 GMT+01:00 <alpe...@gmail.com>:
When I open file from project (in connected mode), I saw below exception on console. Note that it still shown me exactly same issue as server (may be with local analyzer)

I will try to reproduce, but in the meantime, could you please:
  - enable verbose output + analyser logs in SonarLint console
  - clean SonarLint console, and then close/reopen the offending file
  - collect all logs and post them here (or send them to me if you are afraid of possible sensitive data)
 
When in "SonarLint report" view I clicked on "Current project" for SCM change set, I got below error

Unable to analyze changed files
java.lang.NullPointerException
at org.sonarlint.eclipse.core.internal.jobs.AnalyzeChangedFilesJob.collectChangedFiles(AnalyzeChangedFilesJob.java:109)
at org.sonarlint.eclipse.core.internal.jobs.AnalyzeChangedFilesJob.run(AnalyzeChangedFilesJob.java:59)

Not sure how is SonarLint identifying changes when no option to configure my SCM.  I am using IBM Clear Case 8.0.1 version and have installed eclipse plugin for that.

SonarLint is using standard Eclipse Team Provider API to collect changed files. I don't have much experience with IBM ClearCase so there is maybe some difference in the way the API is implemented. I will add a defensive check to protect against NPE, but that would probably mean the feature will not work for you (no files will be reported as changed). We did our tests with egit only, I will try to test with other SCM implementations (like Subversive) and see how it goes.

Any way thanks a lot for testing and reporting the issues prior the final release!

++

Julien

apu...@redhat.com

unread,
Dec 12, 2016, 10:09:58 AM12/12/16
to SonarLint
Hi,

I'm testing the 2.5.0 version and I hit a false positive which was not reported before. I have "NullPointerException might be thrown as 'NODE_KIND_ATTRIBUTE' is nullable here" on a private static final attribute...

private static final String NODE_KIND_ATTRIBUTE = "attribute";

and error is reported on NODE_KIND_ATTRIBUTE.equalsIgnoreCase(kind)


if I close and reopen editor, the error is still here.

You can find the analysis log when reopening the file: https://gist.github.com/apupier/815a2ceeeaa91ba055e5b8acee5265fb


Regards,

Julien HENRY

unread,
Dec 12, 2016, 10:24:32 AM12/12/16
to Alpesh Shah, SonarLint

2016-12-12 15:13 GMT+01:00 Julien HENRY <julien...@sonarsource.com>:
When in "SonarLint report" view I clicked on "Current project" for SCM change set, I got below error

Unable to analyze changed files
java.lang.NullPointerException
at org.sonarlint.eclipse.core.internal.jobs.AnalyzeChangedFilesJob.collectChangedFiles(AnalyzeChangedFilesJob.java:109)
at org.sonarlint.eclipse.core.internal.jobs.AnalyzeChangedFilesJob.run(AnalyzeChangedFilesJob.java:59)

Not sure how is SonarLint identifying changes when no option to configure my SCM.  I am using IBM Clear Case 8.0.1 version and have installed eclipse plugin for that.

SonarLint is using standard Eclipse Team Provider API to collect changed files. I don't have much experience with IBM ClearCase so there is maybe some difference in the way the API is implemented. I will add a defensive check to protect against NPE, but that would probably mean the feature will not work for you (no files will be reported as changed). We did our tests with egit only, I will try to test with other SCM implementations (like Subversive) and see how it goes.

I made some tests with Subversive and it is working fine. So your second issue should be specific to ClearCase. Since we don't have way to test it will be hard (to not say impossible) for us to support that SCM. So I'll simply add a defensive null check here except is someone has an idea why RepositoryProvider::getSubscriber() returns null with ClearCase.


gilbert...@googlemail.com

unread,
Dec 13, 2016, 2:01:56 AM12/13/16
to SonarLint, gilbert...@googlemail.com
Hi Julien,

thanks for quick response. Note you have to get rid of the ':' in the provided link to make it work :

Regards, Gilbert

gilbert...@googlemail.com

unread,
Dec 13, 2016, 2:45:57 AM12/13/16
to SonarLint
Hi Julien,

seems as issues from custom rules are not fetched from Server !?
The binding is correct, did an 'Update all server bindings', console has
Connected mode (using configuration of '...' in server 'sonarts')
Starting analysis with configuration:
[
  moduleKey: ...
  baseDir: ...
  workDir: ...
  extraProperties: {sonar.java.source=1.7, sonar.java.target=1.7, sonar.libraries= ...}
  inputFiles: [
    ...
  ]
]
Found 0 issue(s)
Done in 212 ms
fetchServerIssues moduleKey= ...

Server has an issue for a custom rule, but it isn't fetched.

Regards, Gilbert



gilbert...@googlemail.com

unread,
Dec 13, 2016, 5:47:58 AM12/13/16
to SonarLint
Hi Julien,

curiously the issues for the custom rules where fetched when i did the update after
popup "Updates available .." appeared.
Seems like that update is different from "Update all Project bindings" ?

Regards, Gilbert

Michael Gumowski

unread,
Dec 13, 2016, 6:00:57 AM12/13/16
to apu...@redhat.com, SonarLint
Hey @apupier,

This is obviously an issue with the latest version of the SonarQube Java Analyzer (4.3), which is now part of SonarLint Eclipse 2.5.0. It of course an FP, but I'll need a bit more information.

As it does not relate directly to SonarLint, can you please report the issue in this group ? https://groups.google.com/forum/#!forum/sonarqube

It would allow users of version 4.3 to also see the issue, and how we are going to solve it.
Now, in order to reproduce the issue locally, I would also need a bit more than a screenshot. Can you provide a minimal self-contained reproducer, which raise the FP ? or show the whole method?

Regards,
Michael

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/00020fba-773a-4520-9415-940180760e34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Michael GUMOWSKI | SonarSource
Software Developer @ Language Team
http://sonarsource.com

alpe...@gmail.com

unread,
Dec 13, 2016, 6:04:12 AM12/13/16
to SonarLint, alpe...@gmail.com
Hello Julien,

About issue I am getting while opening file

I will try to reproduce, but in the meantime, could you please:
  - enable verbose output + analyser logs in SonarLint console
  - clean SonarLint console, and then close/reopen the offending file
  - collect all logs and post them here (or send them to me if you are afraid of possible sensitive data)

I did this and I found logs are exactly same as what it prints when I edit file and analysis run again on file. Only difference is the exception I mentioned and 2 queries before the exception (SonarLint is sonar branch name I am using for my project)

 
fetchServerIssues moduleKey=com.mypackage:myservice:SonarLint, filepath=/myservice/src/main/java/com/mypackage/MyHandler.java
fetchServerIssues moduleKey=com.mypackage:myservice:SonarLint, filepath=/myservice

I notice that second request returning 403 code and that could be reason for the error. If you notice there is %3A at the end in second request URL and it seems to be culprit. When I remove it and then just browse url in browser, it is working fine which otherwise giving "Insufficient privileges" error message. So i think something wrong with handling for branch.

regards,
Alpesh

Julien HENRY

unread,
Dec 13, 2016, 7:42:40 AM12/13/16
to gilbert...@googlemail.com, SonarLint

2016-12-13 11:47 GMT+01:00 gilbert.rebhan via SonarLint <sona...@googlegroups.com>:
curiously the issues for the custom rules where fetched when i did the update after
popup "Updates available .." appeared.
Seems like that update is different from "Update all Project bindings" ?

The two actions should do exactly the same. So I suggest to close that issue for now, and reopen a new thread if you face it again (it is not specific to version 2.5 anyway).

janos....@sonarsource.com

unread,
Dec 13, 2016, 8:47:41 AM12/13/16
to SonarLint, gilbert...@googlemail.com
Hi Alpesh,

The logs helped a lot tracking down the problem. It is fixed and will be in the next release. 
Note that the stack trace you get is simply noise, it doesn't affect the analysis in any way.

Cheers,
Janos

Julien HENRY

unread,
Dec 13, 2016, 9:29:37 AM12/13/16
to SonarLint, Janos Gyerik, Alpesh Shah
Hi guys,

I just published a new milestone (2.5.0.201612131345) on the same update site. We tried to fix most of the reported issues:
  - fix NPE when using "analyze changed files" with ClearCase (but it will not report any changed file)
  - improve performance of "analyze changed files"
  - fix progress monitor when doing "analyze changed files"
  - fix stacktrace reporter by Alpesh when opening file

Please test again and if everything goes well we will release tomorrow.


++

Julien

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/7a7f2042-01f2-4bae-b52f-a2aa49029705%40googlegroups.com.

alpe...@gmail.com

unread,
Dec 14, 2016, 7:12:38 AM12/14/16
to SonarLint, janos....@sonarsource.com, alpe...@gmail.com
Hello Julien,

Just to update you that, latest version is fixing IllegalStateException while opening file. I can now also see there is no NPE while checking issues for changed file and I see log saying "No Subscriber for provider .....".  So everything as expected.

I have cloned the code and see if I can fix issue with Clear case scm.  Presently I am not able to do build because I have retriction to http://download.eclipse.org/releases/ at my company.

regards,
Alpesh


On Tuesday, December 13, 2016 at 7:59:37 PM UTC+5:30, Julien HENRY wrote:
Hi guys,

I just published a new milestone (2.5.0.201612131345) on the same update site. We tried to fix most of the reported issues:
  - fix NPE when using "analyze changed files" with ClearCase (but it will not report any changed file)
  - improve performance of "analyze changed files"
  - fix progress monitor when doing "analyze changed files"
  - fix stacktrace reporter by Alpesh when opening file

Please test again and if everything goes well we will release tomorrow.


++

Julien
2016-12-13 14:47 GMT+01:00 <janos....@sonarsource.com>:
Hi Alpesh,

The logs helped a lot tracking down the problem. It is fixed and will be in the next release. 
Note that the stack trace you get is simply noise, it doesn't affect the analysis in any way.

Cheers,
Janos

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.

Julien HENRY

unread,
Dec 14, 2016, 7:18:32 AM12/14/16
to Alpesh Shah, SonarLint
Thanks a lot for the update Alpesh. I will proceed with the release. If you manage to find a way to support ClearCase, we would add that to next version.

++

Julien

To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/7ac95eb7-c553-40a6-a61b-269353feb674%40googlegroups.com.

alpe...@gmail.com

unread,
Dec 14, 2016, 9:07:35 AM12/14/16
to SonarLint
Hello Julien,
 
Thanks a lot for the update Alpesh. I will proceed with the release. If you manage to find a way to support ClearCase, we would add that to next version.



I found that Clear case plugin jar has issue. RepositoryProviderType implementation didn't  override getSubscriber() method and so by default from parent you get null (don't understand why default implementation provided and not enforcing implementor to implement). I couldn't find their implementation for org.eclipse.team.core.subscribers.Subscriber.  I will update you if I can do something myself. Meanwhile let me know if you know if I can do some patching myself.
  

alpe...@gmail.com

unread,
Jan 6, 2017, 2:44:27 AM1/6/17
to SonarLint, alpe...@gmail.com
Hello Julien,

I upgraded my clear case eclipse plugin version as old version had issue mentioned earlier.  I saw that now with new Clear Case plugin I have implementation for getSubscriber() which was missing in earlier version. 

However, with new version when I click on Current project for report for SCM change set, I don't get anything but popup saying "An internal error occurred during: "Analyze changeset". java.lang.StackOverflowError".  No log on console and not a single line in log.  Any idea ? Same behavior for both snapshot and released version of 2.5.0 Sonarlint eclipse plugin.  Note that the fly feedback working properly.

Regards,
Alpesh

Julien HENRY

unread,
Jan 6, 2017, 3:52:48 AM1/6/17
to Alpesh Shah, SonarLint
Hi Alpesh,

Would have been great to start a new thread dedicated to investigate ClearCase issue since RFF period is over.

2017-01-06 8:44 GMT+01:00 <alpe...@gmail.com>:
I upgraded my clear case eclipse plugin version as old version had issue mentioned earlier.  I saw that now with new Clear Case plugin I have implementation for getSubscriber() which was missing in earlier version. 

Cool!
 

However, with new version when I click on Current project for report for SCM change set, I don't get anything but popup saying "An internal error occurred during: "Analyze changeset". java.lang.StackOverflowError".  No log on console and not a single line in log.  Any idea ? Same behavior for both snapshot and released version of 2.5.0 Sonarlint eclipse plugin.  Note that the fly feedback working properly.

- Does it work with button "All projects" in SonarLint Report view?
- Do you have anything special in your project that would make visiting project files stuck in an infinite loop? For example some kind of virtual resource or symbolic link?

++

Julien

alpe...@gmail.com

unread,
Jan 6, 2017, 5:29:43 AM1/6/17
to SonarLint, alpe...@gmail.com
Hello Julien,

Same behavior for "All projects" in SonarLint Report view.  

- Do you have anything special in your project that would make visiting project files stuck in an infinite loop? For example some kind of virtual resource or symbolic link?

As far as I know there is nothing like symbolic link or virtual resource. There could be inter dependency between 2 projects but I can't figure out exactly which files. Is it possible for you to provide some debug version where something more printed before I get this error? Presently nothing is printed in log and directly (almost immediately) pops up this error in eclipse (tried with 4.4 Luna & 4.6 Neon).  


alpe...@gmail.com

unread,
Jan 6, 2017, 5:45:44 AM1/6/17
to SonarLint, alpe...@gmail.com
Hello Julien,

Would have been great to start a new thread dedicated to investigate ClearCase issue since RFF period is over.


Sorry I missed this first line. I am creating new thread now.

Regards,
Alpesh 

alpe...@gmail.com

unread,
Jan 6, 2017, 6:37:07 AM1/6/17
to SonarLint, alpe...@gmail.com
Hello Julien,

I created new thread now, please have a look.  


Regards,
Alpesh
Reply all
Reply to author
Forward
0 new messages