-
Notifications
You must be signed in to change notification settings - Fork 688
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix IndexOutOfBoundsException in MethodYield.getConstraint (#3669)
- Loading branch information
1 parent
7c4a26f
commit 197e5bd
Showing
5 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
java-symbolic-execution/src/test/files/se/RecordConstructorParameters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.sonar.java.checks; | ||
|
||
public record RecordConstructorParameters(List<Message> messages) { | ||
|
||
public RecordConstructorParameters { | ||
requireNonNull(messages == null && messages.isEmtpy()); // Noncompliant {{A "NullPointerException" could be thrown; "messages" is nullable here.}} | ||
} | ||
|
||
public RecordConstructorParameters() { | ||
this(new ArrayList<>()); | ||
} | ||
|
||
public static RecordConstructorParameters create(List<Message> messages) { | ||
if (messages == null) { | ||
return new RecordConstructorParameters(); | ||
} | ||
return new RecordConstructorParameters(messages); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters