-
Notifications
You must be signed in to change notification settings - Fork 13
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
MCR-3285 pmd: UnsynchronizedStaticFormatter #2344
base: 2024.06.x
Are you sure you want to change the base?
MCR-3285 pmd: UnsynchronizedStaticFormatter #2344
Conversation
fd68723
to
a78ab70
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Files not reviewed (1)
- ruleset.xml: Language not supported
Comments suppressed due to low confidence (1)
mycore-indexing/src/main/java/org/mycore/frontend/indexbrowser/MCRGoogleSitemapCommon.java:213
- [nitpick] The method parameter 'number' should be renamed to 'numberPart' for consistency with the renamed variable 'NUMBER_FORMAT'.
String getFileName(int number, boolean withPath) {
|
||
/** date formatter */ | ||
private static SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd", SITEMAP_LOCALE); | ||
private static final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd", SITEMAP_LOCALE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be replaced with https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/format/DateTimeFormatter.html which is thread safe
@@ -106,7 +106,7 @@ private enum Mode { | |||
|
|||
private static Logger LOGGER = LogManager.getLogger(MCRRestAPIObjectsHelper.class); | |||
|
|||
private static SimpleDateFormat SDF_UTC = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US); | |||
private static final SimpleDateFormat SDF_UTC = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be replaced with https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/format/DateTimeFormatter.html which is thread safe
Link to jira.