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

Moved transaction handling into Handle instead of @Transactional #4966

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

EricWittmann
Copy link
Member

Copy link

github-actions bot commented Aug 1, 2024

Qodana Community for JVM

38 new problems were found

Inspection name Severity Problems
Auto-unboxing 🔶 Warning 11
Unchecked exception declared in 'throws' clause 🔶 Warning 4
Overly complex class 🔶 Warning 3
Class with too many methods 🔶 Warning 3
Overly long lambda expression 🔶 Warning 3
Overly broad 'catch' block 🔶 Warning 3
Unnecessary modifier 🔶 Warning 2
'null' assignment 🔶 Warning 1
Prohibited exception thrown 🔶 Warning 1
Duplicate throws 🔶 Warning 1
Field can be local 🔶 Warning 1
Field has setter but no getter 🔶 Warning 1
Javadoc declaration problems 🔶 Warning 1
Method with too many parameters 🔶 Warning 1
'throw' caught by containing 'try' statement 🔶 Warning 1
Wrapper type may be primitive 🔶 Warning 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@EricWittmann EricWittmann requested a review from jsenko August 1, 2024 18:07
Copy link
Member

@jsenko jsenko left a comment

Choose a reason for hiding this comment

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

LGTM, I liked the automatic thread-local nesting, but nothing wrong with being explicit.

@@ -687,7 +679,6 @@ private void insertReferences(Handle handle, Long contentId, List<ArtifactRefere
}

@Override
@Transactional
public List<String> deleteArtifact(String groupId, String artifactId)
Copy link
Member

@jsenko jsenko Aug 2, 2024

Choose a reason for hiding this comment

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

We should use the GA/GAV value types everywhere to reduce accidental errors, since String is a String is a String. I'd like to add value types for other identifiers in the future, such as hashes and numeric IDs.

Copy link
Member

Choose a reason for hiding this comment

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

This is out-of-scope for this PR though.

if (canonical) {
var artifactMetaData = getArtifactMetaData(groupId, artifactId);
var artifactMetaData = getArtifactMetaDataRaw(handle, groupId, artifactId);
Function<List<ArtifactReferenceDto>, Map<String, TypedContent>> referenceResolver = (refs) -> {
Copy link
Member

Choose a reason for hiding this comment

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

Duplicate lambda.

Copy link
Member Author

Choose a reason for hiding this comment

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

If you mean because this lamba is the same as another one in this same class, it's because they need to be local in order to pass the local Handle reference.

@EricWittmann EricWittmann merged commit efc7ebd into main Aug 2, 2024
20 checks passed
@EricWittmann EricWittmann deleted the feat/handle-based-txs branch August 2, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants