Running into ArrayIndexOutOfBoundsException issues with PMD - spring-boot

I am trying to build a spring-boot project with pmd integrated in gradle and running into ArrayIndexOutOfBoundsException for lot of test cases. Even when I run single test case in debug mode to understand where I am hitting ArrayIndexOutOfBoundsException, by default it is throwing ArrayIndexOutOfBoundsException even before jumping into the class. I am assuming this is due some config or version mismatch or due to missing plugins. can someone please help me what could be the causes for this ? I am using below versions
Jacoco: 0.8.8, pmd: 6.5.4

Related

Gradle non-deterministically skips many tests

I'm in the process of migrating a Java project from Gradle 4.4 to Gradle 7.5. Most of this seems to be under control. However, there's one very serious problem:
The project has 692 unit tests (all using JUnit; we're using JUnit 4.13.2). When I run gradle test with 7.5, however, only about 500 tests run. To be specific, it's a number that fluctuates between 527 and 529 tests.
Does anyone have any suggestions about how I troubleshoot this issue? Is it some kind of version compatibility problem? I would have put in the content of the build file, screen output, etc., but honestly, with this kind of problem I simply have no idea what kinds of diagnostics from me would be helpful!
Thanks.

ConsumeEvent (blocking=true) is running on executor-thread

Quarkus Version 2.1.2.Final
When running in quarkusDev everything is running in the correct thread (vert.x-worker-thread-x) and is even obeying the quarkus.vertx.worker-pool-size property as I would expect.
When running the quarkus-app that is built from the build task I am seeing the thread of execution as (executor-thread-x).
Not sure why the thread of execution is changing when running the application after it's been built vs running in quarkusDev. As an aside I am using the exact same properties for both the quarkusDev and running the output of the build task.
I have created a sample project that showcases the above described issue. (https://github.com/owlkaboom/quarkus-threading-question) This sample project uses 2.2.1-final since I wanted to see if this was resolved in a later release.
You will notice it "submits 500" items into an eventbus which when you run it with quarkusDev you will notice it is actually using the worker-threads correctly and obeying the pool size limits.
When you build and run via java -jar you will now notice it does not obey worker-threads and just runs on the executor-thread instead.
The above mentioned issue is not expected behavior. Opened a new GitHub issue (https://github.com/quarkusio/quarkus/issues/19911).
This is not expected behavior and once the GitHub issue has been resolved / merged this behavior should no longer be happening.

SonarLint for IntelliJ not showing critical and blocker vulnerabilities

I have enabled sonar lint plugin to my IntelliJ IDE for capturing code violations during my development. i have connected to my remote SonarQube server for rules binding.
Plugin capture rules for major, minor issues and not capturing critical rule violations on my local IDE.
my binding updated to latest rules , but critical issues are not getting picked up by the intellji plugin.
dont know how to fix this on my machine, or should i need to raise a bug?
EDIT
All critical issues are not getting reported.
sonarqube reporting below critical issue
An 'int' is expected rather than a String
but in intellji sonarlint plugin, the above issue is not getting reported.

BuildWarner plugin doesn't work in incremental analysis - SonarQube 5.1

When I run an incremental analysis on my project through maven, build warner plugin is not called, resulting in an analysis completing successfully even if there are violations.
I have quality gate setup correctly (0 violations) and I have tried configuring sonar sonar.preview.includePlugins with buildwarner plugin in General settings, but without luck - the plugin is still not called in an incremental analysis.
The plugin works correctly with SonarQube 5.1 as it is called in full analysis without problems.
It is the expected behavior. This plugin does not work for incremental analysis for now. But maybe soon. See http://sonarqube.15.x6.nabble.com/Sonarqube-and-Build-Breaker-Plugin-td5034703.html

Sonar runner exit code is always 0

I use Sonar through the sonar runner client. Actually, I call it from NAnt build system, and the NAnt exec call should fail in case the exit code is not 0.
However, I've recently faced with an issue that sonar runner always returns 0 exit code, even if one of the plugins (e.g. NDeps) throws exception. As far as I can see, the analysis data is not committed to the database in this case, hence it is a good reason to fail.
I seem to remember that one of the previous versions of Sonar / Sonar runner used to behave the way I expected - in case a plugin fails, the exit code was not 0.
Today I use Sonar 3.2 / Sonar runner 2.0 / C# Ecosystem 1.4, which is all the latest as far as I can see.
Is there a configuration flag somewhere to return proper exit codes? Any other workaround to this issue?
For information: discussion happened on this topic is currently happening on Sonar User mailing-list. It can be followed here: http://sonar.15.n6.nabble.com/Sonar-runner-exit-code-is-always-0-tt5003433.html
EDIT: after investigation with Yan, it turns out that the Sonar BAT script behaves differently depending on the vesion of Windows that is used. Yan has suggested a way to fix this, and a ticket has been opened for next version of the Sonar Runner.

Resources