Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kotlin AvoidRecreatingDateTimeFormatter #304

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

stokpop
Copy link
Collaborator

@stokpop stokpop commented Apr 5, 2024

Works on basic unit tests.

Should we create more unit tests to avoid false positives and add more Kotlin syntaxes?

Copy link

sonarcloud bot commented Apr 5, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@stokpop stokpop requested a review from jborgers April 5, 2024 13:45
<value>
<![CDATA[
(: check if java.text imports exists as filter for same named classes in other packages :)
//ImportHeader[.//T-Identifier[@Text='org'] and .//T-Identifier[@Text='joda'] and .//T-Identifier[@Text='time'] and .//T-Identifier[@Text='format']][1]/ancestor::KotlinFile
Copy link
Owner

Choose a reason for hiding this comment

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

is this about java.text (1st line) or joda.time (2nd line)?
Should it not hold for both cases? So match on at least one of them?
Include threeten.bp.format? Maybe not, old.

}
}
]]></code>
</test-code>
Copy link
Owner

Choose a reason for hiding this comment

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

Can you add a separate test-code with just java.time import? (no joda.time)
and one without joda.time and without java.time and a custom DateTimeFormatter so without violation?

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.

None yet

2 participants