[RFF] Java Analyzer 4.0

259 views
Skip to first unread message

Nicolas Peru

unread,
Jun 28, 2016, 4:19:08 PM6/28/16
to SonarQube
Hi all, 

We are requesting your feedback on the new Java analyzer 4.0

Compatibility : 
Note  that compatibility has been upgraded to Latest LTS : 5.6 
Therefore this version requires Java 8 to run an analysis (but can still analyze older version of java code).

New features:
This version brings many improvement on the semantic analysis : mainly the resolution of parameterized method and on type inference. 
This lead us to finally solve SONARJAVA-958 which made us resolve false positive on unused private methods regarding method references : SONARJAVA-583 
It also brings 6 new rules and numerous bug fixes.

Deprecations:
As per migration to SonarQube 5.6 : Accessor metric has been dropped : SONARJAVA-398 which can lead to some variation on the complexity metric and variation on issues that might have been relying on this (documented API etc...).

Deprecated rules have been removed : SONARJAVA-1718

Drop of deprecated API : the addIssue method marked as deprecated in JavaFileScannerContext have been dropped: This might impact your custom rules. (please use the reportIssue methods) see SONARJAVA-1754


Special thanks :
Kudos to Krzysztof Suszyński aka cardil for his contribution
Thanks Michael Gumowski for his work on this release.


Tests can be made with this release candidate : 

As there was a lot of improvements on semantic analysis and some breaking changes on compatibility, we strongly encourage you to test this version and report us any false positive or odd behavior you may encounter ! 
Thanks a lot in advance for your feedback that help us to improve the analyzer !

RFF is open until friday. 

Cheers,
--
Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com

jtie...@gmail.com

unread,
Jun 29, 2016, 9:05:14 AM6/29/16
to SonarQube
Hello!

Great to see that the method reference support has been improved! On my hobby project this will greatly reduce the amount of false positives. In the company code I also see several fixed issues

My test results on the usual company projects (200K Java 6 / 80K Java 8) with 4.0RC-1 (3.15-build5996)

New Rules:
Rule S2148: Underscores should be used to make large numbers readable: OK
Rule S3631: "Arrays.stream" should be used for primitive arrays: No hits, not sure if we should have any hits of this one.
Rule S3599: Double Brace Initialization should not be used: No hits, thought we had one of those but might have been fixed since then. A quick search says that it doesn't exist either, so probably has been fixed.
Rule S3578: Test methods should comply with a naming convention: OK
- Apparently we are awful at following this convention, got hundreds of hits on this one so I didn't thoroughly check the results.
Rule S3577: Test classes should comply with a naming convention: OK with note
- The regex is to strict for me, a common pattern for integration tests is the suffix IT which fails for this rule's default regex.
Rule S3553: "Optional" should not be used for parameters: No hits, quick search says there shouldn't be any either: OK.

New Issues:
S1481: I have a new false positive on this one, will try to make a reproducer as I can't just plainly copy-paste this section of our code.
- As an outline: Within a lambda block (so one with multiple-statements) a local variable is declared as the result of a method call which is marked as unused even though it has two references in that block. The type of the variable is a child class.
SONARJAVA-398: Looks like we've got 3 new cases of the complexity exceeding the (stupidly high) limit, but I trust that the count isn't wrong as the class is way nearly 1.5K lines...

Falsy Fixed Issues:
S1172: A parameter is still unused. Will try to make a reproducer later on as well. But this one seems related to Annotated methods, but can't exactly pinpoint what is is (Several cases use @SuppressWarnings unchecked/rawtypes). But it also fixes corrects ones with @PostConstruct. So maybe related to SONARJAVA-1179 or SONARJAVA-1559.

I hope I can create some reproducers but as we are near the end of a sprint I don't have that much time to spare.

Kind regards,

Johan.

pass...@gmail.com

unread,
Jun 29, 2016, 9:52:23 AM6/29/16
to SonarQube, jtie...@gmail.com
Hello 

I had an sonar-analysis which was running successfully.
Then I replaced the  plugin sonar-java-plugin-3.14.jar with sonar-java-plugin-3.15-build5996.jar Then I get the following error

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project esfbund: Accessing the filesystem before the Sensor phase is not supported. Please update your plugin. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE

Did I miss something.





The sonar log files show no problems



2016.06.29 15:21:21 INFO  web[o.s.s.p.DefaultServerFileSystem] SonarQube home: /opt/sonarqube-5.6
2016.06.29 15:21:21 INFO  web[o.e.plugins] [sonar-1467206455251] loaded [], sites []
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin C# / 5.3 / afe693cc59ab1c8b4b20dc0f56ea1f7081a34b6d
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin CSS / 1.10 / 4dbbeb4af69a9e0012d05002217f1e6800a9bb7d
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Checkstyle / 2.4 / abe1e23436ed7b227a3a325cbf12e204a7c90fc9
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Cobertura / 1.6.3 / 1b2e281814f22ff8a5f89cc15701de2de522a167
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Findbugs / 3.3 / e1a76544ee6aed765106e7e2bb64072adf63ccaf
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Git / 1.2 / a713dd64daf8719ba4e7f551f9a1966c62690c17
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Groovy / 1.3.1 / 641399aaf84ae740ee415809f4f2e12d97966c0d
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin JSON / 1.4 / 0
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Java / 3.15-build5996 / 997f1d0b48de3bbe42a905c5077d7a2b83968b94
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Java Properties / 1.7 / 0
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin JavaScript / 2.14 / 8e37a262d72dd863345f9c6e87421e2d1853a2e6
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin LDAP / 2.0 / 2910f3981167a70a201ccfae01471dfd26c794b7
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Motion Chart / 1.7 / e9c4a5c95c75564b3c3b5a887b63ef50fc59a156
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin PMD / 2.5 / 2b4e2b9de568d5436e02cd874442e005f45bf3db
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin SVN / 1.3 / aff503d48bc77b07c2b62abf93249d0a20bd355c
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Tab Metrics / 1.4.1 / f575baba797d28be52a4fed5ee23159dd2e4a83a
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Timeline / 1.5 / a9cae1328fd455a128b5d7d603381f47398c6e2a
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Web / 2.4 / 61c14c00da36f77d18c019ad2bd7942708e99c13
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Widget Lab / 1.8.1 / d0293be59a6eddb33224d093b8b559490798b7a2
2016.06.29 15:21:22 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin XML / 1.4.1 / d2c0388961fcbe78ac597ca3fb3e262d3e733988
2016.06.29 15:21:23 INFO  web[o.s.d.c.MysqlCharsetHandler] Verify that database collation is case-sensitive
2016.06.29 15:21:23 INFO  web[o.s.s.p.RailsAppsDeployer] Deploying Ruby on Rails applications



If I run the analysis with debug options (-X and -e)
I get

INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project esfbund: Unable to load component class org.sonar.java.DefaultJavaResourceLocator: Unable to load component class org.sonar.java.JavaClasspath: Accessing the filesystem before the Sensor phase is not supported. Please update your plugin. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project esfbund: Unable to load component class org.sonar.java.DefaultJavaResourceLocator
        at org
.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org
.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org
.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org
.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org
.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org
.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org
.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org
.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org
.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org
.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org
.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org
.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org
.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java
.lang.reflect.Method.invoke(Method.java:498)
        at org
.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org
.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org
.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org
.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to load component class org.sonar.java.DefaultJavaResourceLocator
        at org
.sonarsource.scanner.maven.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:36)
        at org
.sonarsource.scanner.maven.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:81)
        at org
.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:112)
        at org
.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org
.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
       
... 20 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.java.DefaultJavaResourceLocator
        at org
.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:69)
        at org
.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
        at org
.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
        at org
.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
        at org
.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
        at org
.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
        at org
.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
        at org
.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
        at org
.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
        at org
.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
        at org
.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
        at org
.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
        at org
.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034)
        at org
.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026)
        at org
.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003)
        at org
.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
        at org
.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:141)
        at org
.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
        at org
.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
        at org
.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
        at org
.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:234)
        at org
.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
        at org
.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
        at org
.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
        at org
.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
        at org
.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
        at org
.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
        at org
.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
        at org
.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
        at org
.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
        at org
.sonar.runner.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:67)
        at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java
.lang.reflect.Method.invoke(Method.java:498)
        at org
.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61)
        at com
.sun.proxy.$Proxy23.execute(Unknown Source)
        at org
.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:274)
        at org
.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:165)
        at org
.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:152)
        at org
.sonarsource.scanner.maven.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:78)
       
... 23 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.java.JavaClasspath
        at org
.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:69)
        at org
.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
        at org
.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
        at org
.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
        at org
.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
        at org
.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
        at org
.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
        at org
.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
        at org
.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
        at org
.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
        at org
.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
        at org
.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
        at org
.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
        at org
.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
        at org
.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:67)
       
... 63 more
Caused by: Accessing the filesystem before the Sensor phase is not supported. Please update your plugin.
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:




Michael Gumowski

unread,
Jun 29, 2016, 10:28:49 AM6/29/16
to pass...@gmail.com, SonarQube, Johan Tiesinga
Hey all,

Thank you both for your valuable feedback.

@Johan: great to hear feedback about each rule. We will be definitely interested by your reproducer.

@Frank: Okay, it seems that we are having incompatibility issues with other plugin. It would help us identifying the issue if you could provide the full log of your analysis! As you are using a lot of other plugins, would you be able to identify which plugin fails during analysis?

Regards,

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

...

[Message clipped]  

jtie...@gmail.com

unread,
Jun 29, 2016, 10:34:05 AM6/29/16
to SonarQube, pass...@gmail.com, jtie...@gmail.com
I've boiled the reproducers down to these two snippets:

public void foo() {
   
Collections.emptyList().stream()
           
.forEach(e -> {
               
// FP on S1481
               
List<Object> myList = new ArrayList<>();
                myList
.add(e);
               
// In the actual code the 'myList' is added to a collection which is scoped outside of the lambda but this is enough for reproduction.
           
});
}


@SuppressWarnings("unchecked")
public static String foo(String bar, boolean foobar) {
   
// FN on S1172 for foobar.
   
return bar.toLowerCase();
}

Kind regards,

Johan.

Michael Gumowski

unread,
Jun 29, 2016, 12:28:22 PM6/29/16
to Johan Tiesinga, SonarQube, pass...@gmail.com
Thanks Johan!

The FN you report is related to S1172 is not a False Negative, but related to this ticket: https://jira.sonarsource.com/browse/SONARJAVA-1691
To make it short, as soon as a method with an unused parameter is annotated (whatever the annotation), then the rule won't raise an issue.

About the FP on unused local variable (S1481), it is related to our current handling of type inference which still need some improvement. It is especially visible when dealing with the stream API.
We will work on improving this aspect in next versions of the Java Analyzer. Thanks for the reproducer anyway, it will still help us when working on the subject!

@Frank: By dichotomy, we identified the incompatibility issue with other plugins, and discovered that we introduced an incompatibility with the Findbugs plugin exclusively. All the others plugins are doing fine when used in combination of the RC of the Java Analyzer. Thanks a lot for the info you provided, it helped!

We are going to provide a new RC soon with a few bug fix, including the incompatibility!

Regards,

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

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/5f31eb8a-2d43-4438-afeb-e4ce69efefd2%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

jtie...@gmail.com

unread,
Jun 30, 2016, 2:34:04 AM6/30/16
to SonarQube, jtie...@gmail.com, pass...@gmail.com
I can definitely see the value of SONARJAVA-1691 but I'd also argue that it is a false positive for when it is only @SupressWarnings for rawtypes or unchecked casts is being used. We're only removing some compiler warnings and not indicating that the unused variable is used by some reflective mechanism. So I'd argue that 'blindly' accepting all annotations is a step towards hiding code smell.

Kind regards,

Johan.

Nicolas Peru

unread,
Jun 30, 2016, 4:30:48 AM6/30/16
to jtie...@gmail.com, SonarQube, pass...@gmail.com
Hi Johan, 

regarding SONARJAVA-1691, this is fine by our standards : we value false negatives over false positives.
As per S3577 I reopen the ticket to take your feedback into account and will rework the default regexp to match surefire and failsafe conventions.

Stay tuned for next RC :) 
Cheers, 


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

For more options, visit https://groups.google.com/d/optout.

Nicolas Peru

unread,
Jun 30, 2016, 9:38:11 AM6/30/16
to jtie...@gmail.com, SonarQube, pass...@gmail.com
Hi All, 

Thanks to your feedback we work on a second release candidate : 
This one include a small improvement on performance as well as a fix for the compatibility with findbugs raised by Frank and a refinement of the test class name convention rule thanks to Johan.

Feedback is more than welcome ! Thanks for your help ! 



Cheers, 

Johan "Johnnei"

unread,
Jun 30, 2016, 1:41:35 PM6/30/16
to SonarQube, jtie...@gmail.com, pass...@gmail.com
Hello!

I've ran an analysis on my hobby project with 3.15-build6036. Tomorrow morning I'll try to find a moment to run the analysis on the company projects. If you don't hear from me assume it's all OK.

Change on S3577: OK. Got no hit on the IT classes in my hobby project.

I found two more FP's which are probably related to the type inference. So far I've only managed to reproduce one of the two in a smaller class. I'm not really sure what's different in my reproducer.

FP on UnusedPrivateMethod combined with lambdas.
- Today I learned localVariable::method is a valid method reference :)
- Original Hit: https://sonarqube.johnnei.org/issues/search#issues=AVWiOKZ3stsS28tfbnUw
- Reproducer Attempt: https://sonarqube.johnnei.org/component/index?id=org.johnnei%3Asonarqube-bugs%3Asrc%2Fmain%2Fjava%2Forg%2Fjohnnei%2Fsonarqube%2Fbugs%2FUnusedPrivateMethod.java
- Source: https://git.johnnei.org/Johnnei/JavaTorrent/blob/40761223717fd37f501dc03e048b2489ef0aa1f2/bittorrent/src/main/java/org/johnnei/javatorrent/network/InStream.java
- Analysis log: https://git.johnnei.org/Johnnei/JavaTorrent/builds/411

FP on S2275 combined with lambdas.
- Original hit: https://sonarqube.johnnei.org/issues/search#issues=AVWiOKPtstsS28tfbnUv
- Reproducer: https://sonarqube.johnnei.org/issues/search#issues=AVWiSr8gstsS28tfbnee

Kind regards,

Johan.

Andreas Mandel

unread,
Jul 1, 2016, 6:35:49 AM7/1/16
to SonarQube, jtie...@gmail.com, pass...@gmail.com
Hi,

I'm not sure if this is similar to the the API issue reported above.

I have:
Findbugs / 3.3 / e1a76544ee6aed765106e7e2bb64072adf63ccaf
and
Java / 3.15-build6036 / 2059e9f472a4acc6bd085179ccf584b707757610

And I get: 

sonar-maven-plugin:3.0.2:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar: java.lang.NoSuchMethodError: org.sonar.plugins.java.api.JavaResourceLocator.findResourceByClassName(Ljava/lang/String;)Lorg/sonar/api/resources/Resource;

SQ Server5.6

Kind Regards,
Andreas.

Michael Gumowski

unread,
Jul 1, 2016, 12:12:12 PM7/1/16
to Andreas Mandel, SonarQube, Johan Tiesinga, PASS IT Consulting GmbH Research
Hey Andreas,

Thanks for the feedback, that was unexpected.

After investigation, we had to do some change in the API of the Java Analyzer in order to align with new SonarQube LTS API. Consequently, we also removed some usages of deprecated API from SonarQube, which apparently beaks compatibility with the Findbugs plugin. As far as I tested, no issue with other plugins extending the Java Analyzer.

As we are releasing a new Major version, with new LTS compatibility, we are going to continue with the release process. The findbugs plugin will have to align with Java Analyzer 4.0.

Regards,

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

Nicolas Peru

unread,
Jul 4, 2016, 2:53:42 AM7/4/16
to Michael Gumowski, Andreas Mandel, SonarQube, Johan Tiesinga, PASS IT Consulting GmbH Research
Hi all,

The feedback period is now over. Thanks a lot for your tests and feedback that helped us catch some bugs before release : Thanks Johan, Frank and Andreas. 
As pointed out by Michael, we are aware that this release brings compatibility with Findbugs 3.3 thanks to your tests and we'll make this more explicit.

Release will happen shortly. 

Cheers, 







For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages