Skip to content

Remove private constructors#455

Merged
madurangasiriwardena merged 1 commit intowso2:masterfrom
Zeta201:private-cons
Mar 4, 2026
Merged

Remove private constructors#455
madurangasiriwardena merged 1 commit intowso2:masterfrom
Zeta201:private-cons

Conversation

@Zeta201
Copy link
Contributor

@Zeta201 Zeta201 commented Mar 4, 2026

Purpose

Related PR: #453

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Developer Checklist (Mandatory)

  • Complete the Developer Checklist in the related product-is issue to track any behavioral change or migration impact.

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

Summary by CodeRabbit

  • Refactor
    • Refactored constructor visibility patterns in configuration and schema management classes to improve code architecture consistency.
    • Updated build analysis configuration to accommodate revised singleton patterns and reduce static analysis warnings.

Comment on lines 54 to 56
public static SCIMUserSchemaExtensionBuilder getInstance() {
return configReader;
}

Choose a reason for hiding this comment

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

Log Improvement Suggestion No: 1

Suggested change
public static SCIMUserSchemaExtensionBuilder getInstance() {
return configReader;
}
public static SCIMUserSchemaExtensionBuilder getInstance() {
log.debug("Getting SCIMUserSchemaExtensionBuilder instance");
return configReader;
}

Copy link

@wso2-engineering wso2-engineering bot left a comment

Choose a reason for hiding this comment

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

AI Agent Log Improvement Checklist

⚠️ Warning: AI-Generated Review Comments

  • The log-related comments and suggestions in this review were generated by an AI tool to assist with identifying potential improvements. Purpose of reviewing the code for log improvements is to improve the troubleshooting capabilities of our products.
  • Please make sure to manually review and validate all suggestions before applying any changes. Not every code suggestion would make sense or add value to our purpose. Therefore, you have the freedom to decide which of the suggestions are helpful.

✅ Before merging this pull request:

  • Review all AI-generated comments for accuracy and relevance.
  • Complete and verify the table below. We need your feedback to measure the accuracy of these suggestions and the value they add. If you are rejecting a certain code suggestion, please mention the reason briefly in the suggestion for us to capture it.
Comment Accepted (Y/N) Reason
#### Log Improvement Suggestion No: 1

@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

Walkthrough

Removed private constructors from four singleton-like classes in the configuration and schema modules, exposing default (package-private or public) constructors instead. Added a SpotBugs exclusion to suppress warnings about non-private singleton constructors.

Changes

Cohort / File(s) Summary
Constructor Visibility Changes
modules/charon-core/src/main/java/org/wso2/charon3/core/config/CharonConfiguration.java, modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMSystemSchemaExtensionBuilder.java, modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMUserSchemaExtensionBuilder.java, modules/charon-core/src/main/java/org/wso2/charon3/core/schema/SCIMResourceSchemaManager.java
Removed explicit private no-arg constructors from four classes, transitioning to implicit default (package-private or public) constructors. Affects singleton instantiation patterns but preserves existing static getInstance() methods and initialization logic.
SpotBugs Configuration
spotbugs-exclude.xml
Added exclusion rule for SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR pattern to suppress warnings generated by the constructor visibility changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Four singleton walls come tumbling down,
Their private doors now open wide,
SpotBugs spots the shift in town,
We hush the warnings, with config pride,
Constructors dance in new sunlight! 🌞

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description contains only the template structure with no actual content filled in—all sections are empty placeholders, providing no specific details about the changes, rationale, testing, or impact. Fill in all mandatory sections (Purpose, Goals, Approach, Release note, Security checks) with specific details about why private constructors were removed, what impact this has, and how it was validated.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removal of private constructors from four Java classes and addition of a SpotBugs exclusion for singleton construction patterns.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@spotbugs-exclude.xml`:
- Around line 29-31: The SpotBugs suppression currently disables
SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR globally; instead, narrow the filter
entries in spotbugs-exclude.xml to target only the four classes changed in this
PR: CharonConfiguration, SCIMSystemSchemaExtensionBuilder,
SCIMUserSchemaExtensionBuilder, and SCIMResourceSchemaManager. Update the
<Match> section so each class is specified (by fully qualified class name) with
a Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" entry (or a single
Match with multiple <Class name="..."/> children) so the suppression applies
only to those four classes and not the entire codebase. Ensure the class names
match their package-qualified names used in the codebase.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4dbca5b0-a309-477d-be1b-9ebd4aa4dca1

📥 Commits

Reviewing files that changed from the base of the PR and between 418f25f and da5ce5b.

📒 Files selected for processing (5)
  • modules/charon-core/src/main/java/org/wso2/charon3/core/config/CharonConfiguration.java
  • modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMSystemSchemaExtensionBuilder.java
  • modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMUserSchemaExtensionBuilder.java
  • modules/charon-core/src/main/java/org/wso2/charon3/core/schema/SCIMResourceSchemaManager.java
  • spotbugs-exclude.xml
💤 Files with no reviewable changes (4)
  • modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMSystemSchemaExtensionBuilder.java
  • modules/charon-core/src/main/java/org/wso2/charon3/core/config/CharonConfiguration.java
  • modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMUserSchemaExtensionBuilder.java
  • modules/charon-core/src/main/java/org/wso2/charon3/core/schema/SCIMResourceSchemaManager.java

Comment on lines +29 to +31
<Match>
<Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" />
</Match>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, examine the spotbugs-exclude.xml file to see the current suppression
cat -n spotbugs-exclude.xml | head -40

Repository: wso2/charon

Length of output: 1486


🏁 Script executed:

# Check the specific lines mentioned in the review
sed -n '25,35p' spotbugs-exclude.xml

Repository: wso2/charon

Length of output: 298


🏁 Script executed:

# Search for all SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR suppressions
rg -n 'SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR' spotbugs-exclude.xml -B2 -A2

Repository: wso2/charon

Length of output: 168


🏁 Script executed:

# Find Java files that were likely modified in this PR (those with singleton pattern changes)
# Look for classes that have getInstance() methods and constructors
fd --type f --name "*.java" modules | head -20

Repository: wso2/charon

Length of output: 305


🏁 Script executed:

# Check the suggested classes to see if they exist and their constructor visibility
for class_path in \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/config/CharonConfiguration.java" \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMSystemSchemaExtensionBuilder.java" \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMUserSchemaExtensionBuilder.java" \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/schema/SCIMResourceSchemaManager.java"
do
  echo "=== Checking $class_path ==="
  if [ -f "$class_path" ]; then
    rg -n 'class |getInstance|private|public|protected' "$class_path" | head -15
  else
    echo "File not found"
  fi
done

Repository: wso2/charon

Length of output: 4875


🏁 Script executed:

# Check CharonConfiguration constructor
rg -n 'public|private|protected' modules/charon-core/src/main/java/org/wso2/charon3/core/config/CharonConfiguration.java | grep -i "CharonConfiguration\s*("

Repository: wso2/charon

Length of output: 145


🏁 Script executed:

# Check SCIMSystemSchemaExtensionBuilder constructor
rg -n 'public|private|protected' modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMSystemSchemaExtensionBuilder.java | grep -i "SCIMSystemSchemaExtensionBuilder\s*("

Repository: wso2/charon

Length of output: 166


🏁 Script executed:

# Check SCIMUserSchemaExtensionBuilder constructor
rg -n 'public|private|protected' modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMUserSchemaExtensionBuilder.java | grep -i "SCIMUserSchemaExtensionBuilder\s*("

Repository: wso2/charon

Length of output: 160


🏁 Script executed:

# Check SCIMResourceSchemaManager constructor
rg -n 'public|private|protected' modules/charon-core/src/main/java/org/wso2/charon3/core/schema/SCIMResourceSchemaManager.java | grep -i "SCIMResourceSchemaManager\s*("

Repository: wso2/charon

Length of output: 145


🏁 Script executed:

# Use a more direct approach - check for explicit constructor declarations in these files
for file in \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/config/CharonConfiguration.java" \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMSystemSchemaExtensionBuilder.java" \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMUserSchemaExtensionBuilder.java" \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/schema/SCIMResourceSchemaManager.java"
do
  echo "=== $file ==="
  rg -n '\s+(public|private|protected)\s+\w+\s*\(\s*\)' "$file" | head -5
done

Repository: wso2/charon

Length of output: 468


🏁 Script executed:

# Check each file for all constructor declarations (explicit or implicit)
for file in \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/config/CharonConfiguration.java" \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMSystemSchemaExtensionBuilder.java" \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMUserSchemaExtensionBuilder.java" \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/schema/SCIMResourceSchemaManager.java"
do
  echo "=== $(basename $file) ==="
  class_name=$(basename "$file" .java)
  # Look for constructor with class name
  rg -n "$class_name\s*\(" "$file" | head -10
done

Repository: wso2/charon

Length of output: 616


🏁 Script executed:

# Get full file content to check constructor declarations for CharonConfiguration
cat modules/charon-core/src/main/java/org/wso2/charon3/core/config/CharonConfiguration.java | head -80

Repository: wso2/charon

Length of output: 2437


🏁 Script executed:

# Get full file content to check constructor declarations for SCIMSystemSchemaExtensionBuilder
cat modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMSystemSchemaExtensionBuilder.java | head -100

Repository: wso2/charon

Length of output: 3834


🏁 Script executed:

# Check if any of these classes were modified in recent commits
git log --oneline --name-only -20 | head -50

Repository: wso2/charon

Length of output: 3478


🏁 Script executed:

# Get the full list of changed files in the "Remove private constructors" commit
git show --name-only da5ce5b | grep -E "\.java$" | head -50

Repository: wso2/charon

Length of output: 4181


🏁 Script executed:

# Get more detail on what changed in the key files
git show da5ce5b -- modules/charon-core/src/main/java/org/wso2/charon3/core/config/CharonConfiguration.java | head -100

Repository: wso2/charon

Length of output: 3249


🏁 Script executed:

# Check if there are other classes in the codebase with non-private constructors that might trigger this warning
rg -l 'getInstance\s*\(' --type java modules | xargs -I {} sh -c 'rg -n "class |getInstance|private|public" {} | head -5 && echo "---"' | head -100

Repository: wso2/charon

Length of output: 6353


🏁 Script executed:

# Get the full diff for the commit to see which classes had constructors changed
git show da5ce5b --stat | grep "\.java$"

Repository: wso2/charon

Length of output: 37


🏁 Script executed:

# Check if the classes mentioned in the review actually had private constructors removed
git show da5ce5b -- modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMUserSchemaExtensionBuilder.java | grep -A5 -B5 "public\|private" | head -80

Repository: wso2/charon

Length of output: 3243


🏁 Script executed:

# Search for explicit constructor declarations in all modified files
git diff da5ce5b~1..da5ce5b --name-only | while read file; do
  if [[ "$file" == *.java ]]; then
    echo "=== $file ==="
    git show da5ce5b:"$file" 2>/dev/null | grep -n "^\s*\(public\|private\|protected\)\s*$(basename "$file" .java)\s*(" || echo "No explicit constructor found"
  fi
done | head -100

Repository: wso2/charon

Length of output: 253


🏁 Script executed:

# Check all classes in the entire repository to find which ones have getInstance() with package-private constructors
find modules -name "*.java" -type f | while read file; do
  if grep -q "getInstance()" "$file"; then
    has_private=$(grep -c "private\s*$(basename "$file" .java)\s*(" "$file" 2>/dev/null || echo 0)
    has_public=$(grep -c "public\s*$(basename "$file" .java)\s*(" "$file" 2>/dev/null || echo 0)
    has_protected=$(grep -c "protected\s*$(basename "$file" .java)\s*(" "$file" 2>/dev/null || echo 0)
    has_default=$(grep -c "^\s*$(basename "$file" .java)\s*(" "$file" 2>/dev/null || echo 0)
    
    if [ "$has_private" -eq 0 ] && [ "$has_public" -eq 0 ] && [ "$has_protected" -eq 0 ]; then
      echo "PACKAGE-PRIVATE: $file"
    fi
  fi
done | head -20

Repository: wso2/charon

Length of output: 1704


🏁 Script executed:

# Get the full list of files changed in the commit
git log --oneline -1 da5ce5b
git show da5ce5b --name-only --pretty=format: | grep "\.java$" | sort

Repository: wso2/charon

Length of output: 16660


🏁 Script executed:

# Check if these classes have explicit constructor definitions or rely on default constructors
for file in \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/config/CharonConfiguration.java" \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMSystemSchemaExtensionBuilder.java" \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMUserSchemaExtensionBuilder.java" \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/schema/SCIMResourceSchemaManager.java"
do
  class_name=$(basename "$file" .java)
  echo "=== $class_name ==="
  # Search for explicit constructor declaration
  if grep -q "$class_name\s*(" "$file"; then
    grep -n "$class_name\s*(" "$file" | head -5
  else
    echo "No explicit constructor found - uses default/package-private"
  fi
  echo
done

Repository: wso2/charon

Length of output: 600


🏁 Script executed:

# Verify if the default constructor approach (no private) could cause issues
# by checking how many singleton-like classes exist in the codebase
echo "Classes with getInstance() method:"
rg -l "getInstance\s*\(\)" --type java modules | wc -l
echo
echo "Sample of classes with getInstance():"
rg -l "getInstance\s*\(\)" --type java modules | head -10

Repository: wso2/charon

Length of output: 1111


🏁 Script executed:

# Check the three classes mentioned as still having private constructors
for file in \
  "modules/charon-utils/src/main/java/org/wso2/charon3/utils/DefaultCharonManager.java" \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMCustomSchemaExtensionBuilder.java" \
  "modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMAgentSchemaExtensionBuilder.java"
do
  echo "=== $(basename $file) ==="
  class_name=$(basename "$file" .java)
  if grep -q "private\s*$class_name\s*(" "$file" 2>/dev/null; then
    echo "HAS private constructor"
    grep -n "private\s*$class_name\s*(" "$file"
  else
    echo "NO private constructor found"
  fi
  # Also show getInstance if it has one
  if grep -q "getInstance" "$file"; then
    echo "Has getInstance method"
  fi
  echo
done

Repository: wso2/charon

Length of output: 489


🏁 Script executed:

# List all the specific classes that were modified in this commit and have constructors changed
git show da5ce5b --pretty=format: --name-only | grep -E "(SCIMCustomSchemaExtensionBuilder|SCIMAgentSchemaExtensionBuilder|CharonConfiguration|SCIMSystemSchemaExtensionBuilder|SCIMUserSchemaExtensionBuilder|SCIMResourceSchemaManager)\.java"

Repository: wso2/charon

Length of output: 637


🏁 Script executed:

# Check if SCIMCustomSchemaExtensionBuilder and SCIMAgentSchemaExtensionBuilder were actually modified to remove private constructors
# or if they still have them
git show da5ce5b -- modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMCustomSchemaExtensionBuilder.java | grep -A10 -B10 "private\|public" | head -60

Repository: wso2/charon

Length of output: 1886


🏁 Script executed:

# Check the diff more carefully to see what changed with SCIMAgentSchemaExtensionBuilder
git show da5ce5b -- modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMAgentSchemaExtensionBuilder.java | grep -C15 "SchemaExtensionBuilder\s*(" | head -80

Repository: wso2/charon

Length of output: 1153


🏁 Script executed:

# Get a clearer picture: check current state vs what the review claims
# The review says these 6 classes were modified to remove private constructors
# Let's verify the current constructor visibility for all 6
python3 << 'EOF'
import subprocess
import re

files = [
    "modules/charon-core/src/main/java/org/wso2/charon3/core/config/CharonConfiguration.java",
    "modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMAgentSchemaExtensionBuilder.java",
    "modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMCustomSchemaExtensionBuilder.java",
    "modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMSystemSchemaExtensionBuilder.java",
    "modules/charon-core/src/main/java/org/wso2/charon3/core/config/SCIMUserSchemaExtensionBuilder.java",
    "modules/charon-core/src/main/java/org/wso2/charon3/core/schema/SCIMResourceSchemaManager.java"
]

for filepath in files:
    class_name = filepath.split("/")[-1].replace(".java", "")
    print(f"\n=== {class_name} ===")
    try:
        with open(filepath, 'r') as f:
            content = f.read()
            # Look for constructor declarations
            pattern = r'(public|private|protected)?\s+' + class_name + r'\s*\('
            matches = re.finditer(pattern, content)
            found = False
            for match in matches:
                start = max(0, match.start() - 100)
                end = min(len(content), match.end() + 200)
                print(f"Found: {content[match.start():match.end()]}")
                print(f"Context: ...{content[start:end]}...")
                found = True
            if not found:
                print("No explicit constructor found - uses default/package-private")
    except FileNotFoundError:
        print("File not found")
EOF

Repository: wso2/charon

Length of output: 3399


Scope this SpotBugs suppression to the specific classes modified, not globally.

The suppression at lines 29-31 disables SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR for the entire codebase. This can mask regressions if future singleton classes are introduced with non-private constructors. Four classes in this PR had their private constructors removed and now use package-private constructors: CharonConfiguration, SCIMSystemSchemaExtensionBuilder, SCIMUserSchemaExtensionBuilder, and SCIMResourceSchemaManager. Restrict the exclusion to only these classes.

Proposed scoped filter update
-    <Match>
-        <Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" />
-    </Match>
+    <Match>
+        <Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" />
+        <Class name="org.wso2.charon3.core.config.CharonConfiguration" />
+    </Match>
+    <Match>
+        <Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" />
+        <Class name="org.wso2.charon3.core.config.SCIMSystemSchemaExtensionBuilder" />
+    </Match>
+    <Match>
+        <Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" />
+        <Class name="org.wso2.charon3.core.config.SCIMUserSchemaExtensionBuilder" />
+    </Match>
+    <Match>
+        <Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" />
+        <Class name="org.wso2.charon3.core.schema.SCIMResourceSchemaManager" />
+    </Match>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Match>
<Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" />
</Match>
<Match>
<Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" />
<Class name="org.wso2.charon3.core.config.CharonConfiguration" />
</Match>
<Match>
<Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" />
<Class name="org.wso2.charon3.core.config.SCIMSystemSchemaExtensionBuilder" />
</Match>
<Match>
<Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" />
<Class name="org.wso2.charon3.core.config.SCIMUserSchemaExtensionBuilder" />
</Match>
<Match>
<Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" />
<Class name="org.wso2.charon3.core.schema.SCIMResourceSchemaManager" />
</Match>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@spotbugs-exclude.xml` around lines 29 - 31, The SpotBugs suppression
currently disables SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR globally; instead,
narrow the filter entries in spotbugs-exclude.xml to target only the four
classes changed in this PR: CharonConfiguration,
SCIMSystemSchemaExtensionBuilder, SCIMUserSchemaExtensionBuilder, and
SCIMResourceSchemaManager. Update the <Match> section so each class is specified
(by fully qualified class name) with a Bug
pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" entry (or a single Match
with multiple <Class name="..."/> children) so the suppression applies only to
those four classes and not the entire codebase. Ensure the class names match
their package-qualified names used in the codebase.

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 31.77%. Comparing base (a06eb46) to head (da5ce5b).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #455      +/-   ##
============================================
- Coverage     31.78%   31.77%   -0.02%     
- Complexity     1114     1115       +1     
============================================
  Files           137      137              
  Lines         13553    13551       -2     
  Branches       2599     2599              
============================================
- Hits           4308     4306       -2     
  Misses         8713     8713              
  Partials        532      532              
Flag Coverage Δ
unit 31.06% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@madurangasiriwardena madurangasiriwardena merged commit 9a1aa72 into wso2:master Mar 4, 2026
5 checks passed
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.

2 participants