Repository navigation
fix: resolve the open SonarCloud issues - #268
Open
adityamparikh wants to merge 1 commit into
Open
adityamparikh wants to merge 1 commit into
adityamparikh wants to merge 1 commit into
Conversation
adityamparikh
force-pushed
the
fix/sonar-issues
branch
from
October 14, 2026 19:04
7478e3f to
2193459
Compare
adityamparikh
force-pushed
the
fix/sonar-issues
branch
from
October 26, 2026 19:14
2193459 to
092bec7
Compare
Fixes the code smells SonarCloud reports on main that the nullness change does not already cover. - SolrNativeHints is now the RuntimeHintsRegistrar itself, imported by SolrConfig, instead of an empty @configuration wrapping a nested Registrar. - Empty bodies say why they are empty; Dtos record components document themselves with @PARAM instead of dangling Javadoc. - buildSrc reads SBOM licenses through LicenseChoice.getItems(), as CycloneDX 13 deprecates getLicenses() and getExpression(); a new test covers the SPDX-expression branch. - Tests: MainTest asserts the mocked context, assertThrows lambdas hold only the call under test, three DistributedTracingTest duplicates that asserted only "some span exists" are removed, and the Docker stdio test waits with Awaitility instead of Thread.sleep. - The one false positive, a '/' URL path separator flagged as a file path delimiter, is suppressed in place with the reason. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Aditya Parikh <aditya.m.parikh@gmail.com>
adityamparikh
force-pushed
the
fix/sonar-issues
branch
from
October 26, 2026 19:16
092bec7 to
bb15b33
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Stacked on #269, #266 and #267: the first three commits here are those PRs, in that order, and only the top commit (
fix: resolve the open SonarCloud issues) is new. #269 is underneath so that./gradlew buildruns the newbuildSrctest below.What
Resolves every open issue SonarCloud reports for
apache_solr-mcponmain: 44 code smells, no bugs or vulnerabilities. #267 already fixes 5 of them (four unthrownthrows Exceptionclauses and the unusedcreateMockUpdateHandlerData). This PR fixes the other 39. The "new issues" on #264–#267 are a subset of these, flagged because reformatting touched those lines.Main code
SolrNativeHints@Configurationwhose only job was to import its nestedRegistrar. The class is now theRuntimeHintsRegistraritself, andSolrConfigimports it with@ImportRuntimeHints(SolrNativeHints.class). That leaves one bean and one nested class fewer, and the same hints.Main,SolrConfigconstructorsMarkdownDocumentCreatoraddImplicitResolvers()override and thecase null -> {}branch each get a comment saying why they are empty.MarkdownDocumentCreatorrecordis now a stream, and so is the source-span loop.JsonDocumentCreatorfilter/mapstream;isContainer()replacesisObject() || isArray().Dtos@paramtags on each record, and the stray file-level comment aboveSolrMetricsis gone.CollectionServicetotalTime/requestsread as commented-out code; it's reworded.CollectionService"\n...%s\n".formatted(...). The\nis prompt text, so%nwould be wrong.SolrConfigurationProperties_.SolrConfigNOSONAR, with a comment. The"/"is a URL path separator. The rule's remedy,File.separator, would put a\into the Solr URL on Windows.buildSrcGenerateBinaryLicenseLicenseChoice.getLicenses()andgetExpression(), so licenses are now read throughgetItems(). A new test covers the SPDX-expression branch, which had no test.Tests
MainTest.contextLoadsDistributedTracingTestshouldCreateSpanHierarchy,shouldSetCorrectSpanKind, andshouldIncludeServiceNameInResourcehad identical bodies that only checked some span exists, whichshouldCreateSpanForSearchServiceMethodalready does. Their names promised checksSimpleTracercan't make, so they are removed, along with the class Javadoc's hierarchy claim.SchemaServiceTest,SearchServiceTest,SearchServiceIntegrationTest,SortClauseTestassertThrows, so only the call under test can throw.DockerImageStdioIntegrationTestThread.sleep(5000)is now Awaitility'sduring(5s), which also fails as soon as the container exits.ClientHttpmain(String[] args)is nowstatic void main(), matchingClientStdio.BuildInfoReader,ClientStdioString.formatwith plain%sslots is now concatenation.Verification
./gradlew buildpasses: 452 tests, none skipped or failed. That's fix: remove unreachable null checks and declare real nullability #267's 455 minus the three removed tracing duplicates.buildSrc's 13 tests pass as part of that build (via build: run buildSrc's tests as part of the build #269), including the new SPDX-expression test../gradlew nativeTest -Pnativepasses, with 299 tests successful and none failed. It covers theSolrNativeHintsmove, since the native binary only starts if the hints are registered.🤖 Generated with Claude Code