Skip to content

Resolve Sonar findings (#279) - #27

Closed
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1788588527-sonar-279
Closed

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1788588527-sonar-279

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Summary

Fixes the three code-level Sonar findings from java-helpers#279 (the fork-sonar.yml untrusted-fork hotspot is intentionally left for its own ticket). No behavior changes.

  • ProcessorTestUtils.extractTopLevelTypeName — regex with super-linear backtracking (^\s*(?:mod)?(?:\s+(?:mods))*\s* stacks whitespace quantifiers). Now each modifier consumes its own trailing whitespace, ^[ \t]* no longer spans lines, and both patterns in the file are static final Pattern constants instead of being compiled per call:
    (?m)^[ \t]*(?:(?:public|protected|private|abstract|final|static|sealed|non-sealed|strictfp)\s+)*(?:@?interface|class|enum|record)\s+([A-Za-z_]\w*)\b
    
  • RoasterCodeGenerator.addParameter — conditional moved inside the operation; one varArgs boolean replaces two instanceof checks:
    boolean varArgs = lastParameter && paramDto.getParameterType() instanceof TypeNameArray;
    TypeName parameterType = varArgs ? ((TypeNameArray) ...).getTypeOfArray() : paramDto.getParameterType();
    method.addParameter(mapType(parameterType), ...);
  • ConfigurationProcessingTest.allConfigurationOptions_MustBeSettableViaBuilder — 27 assertions > 25 limit. The builder chain moved into buildFullyConfigured(); the OptionState assertions stay in the original test and the AccessModifier/suffix/formattingMode assertions moved to allConfigurationOptions_AccessNamingAndFormatting_MustBeReadable. No assertion dropped.

Processor module: 420 tests green. Generated example builders unchanged (CI drift check passes).

Link to Devin session: https://app.devin.ai/sessions/d691231fba0842a4b842b275ca4b35ed
Open in Devin Desktop: https://app.devin.ai/desktop/session/d691231fba0842a4b842b275ca4b35ed?variant=devin
Requested by: @AndreasIgel


Devin Review

Co-Authored-By: Andreas Igel <andreas.igel@computacenter.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@AndreasIgel
AndreasIgel changed the base branch from main to devin/1788589722-fork-sonar-232 September 5, 2026 15:18
@AndreasIgel
AndreasIgel changed the base branch from devin/1788589722-fork-sonar-232 to main September 5, 2026 15:18
@AndreasIgel

Copy link
Copy Markdown
Owner

moved to java-helpers#282

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant