Rename toURI method to convertToURI to avoid superclass clash#22
Open
sonarqube-agent[bot] wants to merge 1 commit into
Open
Rename toURI method to convertToURI to avoid superclass clash#22sonarqube-agent[bot] wants to merge 1 commit into
sonarqube-agent[bot] wants to merge 1 commit into
Conversation
Fixed issues: - AZZmtiWq2HDYqP_XyoA3 for java:S1845 rule Generated by SonarQube Agent (task: 21727296-b1a9-4b69-b99b-c85d325accd1)
Author
|
|
SonarQube reviewer guide
|
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.




Fixed a SonarQube BLOCKER issue where the method
toURIclashed with the superclass methodtoUrifromjavax.tools.SimpleJavaFileObject, differing only in capitalization. The method was renamed toconvertToURIand 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". • BLOCKER • View issue
Location:
core/src/main/java/com/webcohesion/enunciate/Enunciate.java:918Why 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
convertToURIinstead oftoURI. This is necessary because the methodtoURIwas renamed toconvertToURIto avoid confusion/clash with thetoUrimethod defined in the superclassjavax.tools.SimpleJavaFileObject, where the two names differed only by capitalization.SonarQube Remediation Agent uses AI. Check for mistakes.