Skip to content

Conversation

@rombirli
Copy link
Contributor

@rombirli rombirli commented Dec 17, 2025

@hashicorp-vault-sonar-prod
Copy link

hashicorp-vault-sonar-prod bot commented Dec 17, 2025

SONARJAVA-4960

@rombirli rombirli force-pushed the rombirli/S1854-false-positive branch from 19d09dc to 947f918 Compare December 18, 2025 08:39
@rombirli rombirli marked this pull request as ready for review December 19, 2025 13:41
@github-actions
Copy link
Contributor

This PR is stale because it has been open 7 days with no activity. If there is no activity in the next 7 days it will be closed automatically

@github-actions github-actions bot added the stale label Dec 27, 2025
@github-actions github-actions bot closed this Jan 4, 2026
@rombirli rombirli reopened this Jan 5, 2026
@rombirli rombirli requested a review from a team January 5, 2026 07:40
@sonarqube-next
Copy link

sonarqube-next bot commented Jan 5, 2026

}

@Test
void test_fp() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Test name should be more precise.


@Override
public Type[] getIntersectionTypes() {
return new Type[] { this };
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's avoid reformatting unrelated code.

}

static class EnhancedSwitch {
// private enum DocumentStatus {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is commented out, so that the parser does not generate semantics, right? Could you please add a comment about it?

// }

public String doSomething(AClass.BClass<String> instance) {
String c = "Hi"; // Rule S1854
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the place where we had FP, right? We typically use // Compliant comment in such case. Could you please add this in all places where FPs where happening before the change.

assertThat(unknownSymbol.isPackageSymbol()).isFalse();
assertThat(unknownSymbol.isTypeSymbol()).isFalse();
assertThat(unknownSymbol.isVariableSymbol()).isFalse();
assertThat(unknownSymbol.isMethodSymbol()).isFalse();
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't read this carefully, but I'm wondering why this is removed instead of reverting the condition.

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