Skip to content

Rename toURI method to convertToURI to avoid superclass clash#22

Open
sonarqube-agent[bot] wants to merge 1 commit into
masterfrom
remediate-master-20260608-010123-26041bdf
Open

Rename toURI method to convertToURI to avoid superclass clash#22
sonarqube-agent[bot] wants to merge 1 commit into
masterfrom
remediate-master-20260608-010123-26041bdf

Conversation

@sonarqube-agent

Copy link
Copy Markdown

This PR was automatically created by the Remediation Agent's Scheduled backlog remediation feature.

Why these issues? This BLOCKER-level issue was prioritized for automated remediation as it represents a critical naming conflict that could cause confusion and maintainability issues. Renaming the method to convertToURI eliminates the ambiguity while preserving functionality across the codebase.

Fixed a SonarQube BLOCKER issue where the method toURI clashed with the superclass method toUri from javax.tools.SimpleJavaFileObject, differing only in capitalization. The method was renamed to convertToURI and all call sites were updated to use the new name, eliminating the naming conflict and improving code clarity.

View Project in SonarCloud


Fixed Issues

java:S1845 - Rename method "toURI" to prevent any misunderstanding/clash with method "toUri" defined in superclass "javax.tools.SimpleJavaFileObject". • BLOCKERView issue

Location: core/src/main/java/com/webcohesion/enunciate/Enunciate.java:918

Why is this an issue?

Looking at the set of methods in a class, including superclass methods, and finding two methods or fields that differ only by capitalization is confusing to users of the class. It is similarly confusing to have a method and a field which differ only in capitalization or a method and a field with exactly the same name and visibility.

What changed

Updates the call site to use the renamed method convertToURI instead of toURI. This is necessary because the method toURI was renamed to convertToURI to avoid confusion/clash with the toUri method defined in the superclass javax.tools.SimpleJavaFileObject, where the two names differed only by capitalization.

--- a/core/src/main/java/com/webcohesion/enunciate/Enunciate.java
+++ b/core/src/main/java/com/webcohesion/enunciate/Enunciate.java
@@ -913,1 +913,1 @@ public class Enunciate implements Runnable {
-      super(toURI(source), Kind.SOURCE);
+      super(convertToURI(source), Kind.SOURCE);

Have a suggestion or found an issue? Share your feedback here.


SonarQube Remediation Agent uses AI. Check for mistakes.

Fixed issues:
- AZZmtiWq2HDYqP_XyoA3 for java:S1845 rule

Generated by SonarQube Agent (task: 21727296-b1a9-4b69-b99b-c85d325accd1)
@sonarqube-agent

Copy link
Copy Markdown
Author

⚠️ This repository does not have a CODEOWNERS file. The PR has been created but has not been automatically assigned to any reviewer. To ensure PRs are reviewed promptly, consider adding a CODEOWNERS file to your repository.

@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant