Reorder modifiers in Ref.tag field to comply with JLS#2
Open
sonarqube-agent[bot] wants to merge 1 commit into
Open
Reorder modifiers in Ref.tag field to comply with JLS#2sonarqube-agent[bot] wants to merge 1 commit into
sonarqube-agent[bot] wants to merge 1 commit into
Conversation
Fixed issues: - AZ6wRBfmQw83x_y7ZeMO for java:S1124 rule Generated by SonarQube Agent (task: 49bb2634-a635-411d-b503-5d90c3a4d100)
|
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 MINOR issue by reordering the modifiers on the 'tag' field in Ref.java to comply with the Java Language Specification. The @nullable annotation is now correctly placed after the 'final' modifier rather than between access and non-access modifiers.
View Project in SonarCloud
Fixed Issues
java:S1124 - Reorder the modifiers to comply with the Java Language Specification. • MINOR • View issue
Location:
src/main/java/land/oras/Ref.java:37Why is this an issue?
The Java Language Specification recommends listing modifiers in the following order:
What changed
This hunk reorders the modifiers on the 'tag' field from 'protected @nullable final' to 'protected final @nullable'. The original code had the @nullable annotation placed between 'protected' and 'final', which caused the static analyzer to flag it as non-compliant with the Java Language Specification's recommended modifier ordering. By moving 'final' before the @nullable annotation, the modifiers now follow the correct order: access modifier (protected), then final, then the type annotation (@nullable) on the type itself (String).
SonarQube Remediation Agent uses AI. Check for mistakes.