Modify rule S2251: fix diff-id (#3036)

This commit is contained in:
Marco Borgeaud 2023-09-13 16:39:32 +02:00 committed by GitHub
parent a630b5dd26
commit 11a2f3acbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,7 +57,7 @@ public void doSomething(String [] strings) {
If the intention is to have an infinite loop or a loop terminated only by a break statement, use a `while` or a `do` `while` statement instead.
[source,java,diff-id=1,diff-type=noncompliant]
[source,java,diff-id=3,diff-type=noncompliant]
----
for (int i = 0; i < 0; i++) { // Noncompliant, loop is not infinite
String event = waitForNextEvent();
@ -68,7 +68,7 @@ for (int i = 0; i < 0; i++) { // Noncompliant, loop is not infinite
==== Compliant solution
[source,java,diff-id=1,diff-type=compliant]
[source,java,diff-id=3,diff-type=compliant]
----
while (true) { // Compliant
String event = waitForNextEvent();