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

Handle warning regarding double locking #1228

Merged
merged 10 commits into from
Aug 8, 2024

Conversation

luis-pabon-tf
Copy link
Contributor

@luis-pabon-tf luis-pabon-tf commented Aug 5, 2024

Handle warning regarding double locking

Instead of double-locking, we're now using a synchronized list inside a sync block.

Issue

#1210

Checklist

  • I have added tests to cover my changes
  • I have added logging where useful (with appropriate log level)
  • I have added JavaDocs where required
  • I have updated the documentation accordingly

Note: You may remove items that are not applicable

@luis-pabon-tf luis-pabon-tf changed the title Set volatile flag on rules arraylists to satisfy double-lock standards Handle warning regarding double locking Aug 5, 2024
@luis-pabon-tf luis-pabon-tf marked this pull request as ready for review August 5, 2024 22:07
Copy link
Member

@halprin halprin left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!

@luis-pabon-tf luis-pabon-tf requested a review from halprin August 6, 2024 19:25
Copy link
Member

@halprin halprin left a comment

Choose a reason for hiding this comment

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

Do you think we still need Collections.synchronizedList? I don't believe that's needed to do synchronized (list).

@luis-pabon-tf
Copy link
Contributor Author

Do you think we still need Collections.synchronizedList? I don't believe that's needed to do synchronized (list).

Checking and it seems that the way we're handling synchronized code we don't need the syncList anymore. Removing it...

Copy link
Member

@halprin halprin left a comment

Choose a reason for hiding this comment

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

The second if statement needs to have the same check as the first. I'm unsure if this is just stylistic, but I'm unsure how volatile affects this. So I rather be safe than sorry.

luis-pabon-tf and others added 2 commits August 8, 2024 13:48
…gine/transformation/TransformationRuleEngine.java

Co-authored-by: halprin <[email protected]>
…gine/validation/ValidationRuleEngine.java

Co-authored-by: halprin <[email protected]>
@luis-pabon-tf luis-pabon-tf requested a review from halprin August 8, 2024 17:49
Copy link

sonarqubecloud bot commented Aug 8, 2024

Copy link
Member

@halprin halprin left a comment

Choose a reason for hiding this comment

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

Score!

@luis-pabon-tf luis-pabon-tf merged commit 1cfa840 into main Aug 8, 2024
16 checks passed
@luis-pabon-tf luis-pabon-tf deleted the chores/add-volatile-keywords branch August 8, 2024 18:31
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.

2 participants