You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2022/10/28 00:33:40 UTC

[GitHub] [lucenenet] NightOwl888 commented on a diff in pull request #724: changes made for Redundant jump statements #684

NightOwl888 commented on code in PR #724:
URL: https://github.com/apache/lucenenet/pull/724#discussion_r1007466865


##########
src/Lucene.Net/Codecs/BlockTreeTermsReader.cs:
##########
@@ -1241,7 +1241,8 @@ private void SeekToStartTerm(BytesRef target)
                                             return;
                                         }
                                     }
-                                    continue;
+                                    // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                                    continue; //NOSONAR

Review Comment:
   Please comment out this continue statement, it is not a labeled continue statement in Lucene.



##########
src/Lucene.Net.Suggest/Suggest/DocumentDictionary.cs:
##########
@@ -176,7 +176,8 @@ public bool MoveNext()
                         {
                             if (contextField.GetBinaryValue() is null && contextField.GetStringValue() is null)
                             {
-                                continue;
+                                // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                                continue; //NOSONAR

Review Comment:
   Please comment out this continue statement, it is not a labeled continue statement in Lucene.



##########
src/Lucene.Net/Util/Fst/FSTEnum.cs:
##########
@@ -216,7 +216,8 @@ protected virtual void DoSeekCeil()
                         Incr();
                         arc = m_fst.ReadFirstTargetArc(arc, GetArc(m_upto), m_fstReader);
                         targetLabel = TargetLabel;
-                        continue;
+                        // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                        continue; //NOSONAR

Review Comment:
   Please comment out this continue statement, it is not a labeled continue statement in Lucene.



##########
src/Lucene.Net/Util/Fst/FSTEnum.cs:
##########
@@ -390,7 +391,8 @@ protected virtual void DoSeekFloor()
                         Incr();
                         arc = m_fst.ReadFirstTargetArc(arc, GetArc(m_upto), m_fstReader);
                         targetLabel = TargetLabel;
-                        continue;
+                        // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                        continue; //NOSONAR

Review Comment:
   Please comment out this continue statement, it is not a labeled continue statement in Lucene.



##########
src/Lucene.Net/Codecs/Compressing/LZ4.cs:
##########
@@ -640,7 +640,8 @@ public static void CompressHC(byte[] src, int srcOff, int srcLen, DataOutput @ou
                         CopyTo(match2, match1);
                         CopyTo(match3, match2);
 
-                        goto search3Continue;
+                        // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                        goto search3Continue; //NOSONAR

Review Comment:
   Please comment out this continue statement. Although it is a labeled continue statement, it is simply jumping to the following line:
   
   ```c#
                       search3Continue: ;
   ```
   
   We will need that line to remain in place, though, because it has other `goto` statements referring to it.



##########
src/Lucene.Net/Support/IO/FileSupport.cs:
##########
@@ -192,7 +192,8 @@ public static FileInfo CreateTempFile(string prefix, string suffix, DirectoryInf
                 catch (IOException e) when (IsFileAlreadyExistsException(e, fileName))
                 {
                     // If the error was because the file exists, try again.
-                    continue;
+                    // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                    continue; //NOSONAR

Review Comment:
   `FileSupport` is not a direct port from Java, but a shim that we added to help support Lucene.NET. Since this is technically a file that we own (as are most of the files in Lucene.Net.Support), let's just remove the `continue` statement and not leave a comment (other than the original `// If the error was because the file exists, try again.` which describes the intent).



##########
src/Lucene.Net/Codecs/MultiLevelSkipListReader.cs:
##########
@@ -159,7 +159,8 @@ public virtual int SkipTo(int target)
                 {
                     if (!LoadNextSkip(level))
                     {
-                        continue;
+                        // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                        continue; //NOSONAR

Review Comment:
   Please comment out this continue statement, it is not a labeled continue statement in Lucene.



##########
src/dotnet/tools/lucene-cli/SourceCode/SourceCodeSectionReader.cs:
##########
@@ -106,7 +106,8 @@ public override string ReadLine()
                     if (COMMENT_END.IsMatch(line))
                     {
                         inComment = false;
-                        continue; // Skip this line
+                        // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                        continue; // Skip this line //NOSONAR

Review Comment:
   Please comment out this continue statement, it is not a labeled continue statement in Lucene. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org