cpoerschke commented on code in PR #929:
URL: https://github.com/apache/solr/pull/929#discussion_r914909077


##########
solr/core/src/test/org/apache/solr/internal/csv/CSVParserTest.java:
##########
@@ -330,8 +330,8 @@ public void testEndOfFileBehaviorCSV() throws Exception {
       {"world", ""}
     };
     String code;
-    for (int codeIndex = 0; codeIndex < codes.length; codeIndex++) {
-      code = codes[codeIndex];
+    for (String s : codes) {

Review Comment:
   as above w.r.t. eliminating the `code` variable before the loop here, also 
similar changes in below



##########
solr/core/src/test/org/apache/solr/internal/csv/CSVParserTest.java:
##########
@@ -302,8 +302,8 @@ public void testEndOfFileBehaviourExcel() throws Exception {
       {"world", ""}
     };
     String code;
-    for (int codeIndex = 0; codeIndex < codes.length; codeIndex++) {
-      code = codes[codeIndex];
+    for (String s : codes) {
+      code = s;

Review Comment:
   ```suggestion
       for (String code : codes) {
   ```



##########
solr/core/src/test/org/apache/solr/internal/csv/CSVParserTest.java:
##########
@@ -579,10 +579,10 @@ public void testLineTokenConsistency() throws IOException 
{
     String[][] data = parser.getAllValues();
     parser = new CSVParser(new StringReader(code));
     CSVParser parser1 = new CSVParser(new StringReader(code));
-    for (int i = 0; i < data.length; i++) {
-      assertTrue(Arrays.equals(parser1.getLine(), data[i]));
-      for (int j = 0; j < data[i].length; j++) {
-        assertEquals(parser.nextValue(), data[i][j]);
+    for (String[] datum : data) {
+      assertTrue(Arrays.equals(parser1.getLine(), datum));
+      for (int j = 0; j < datum.length; j++) {
+        assertEquals(parser.nextValue(), datum[j]);

Review Comment:
   ```suggestion
         for (String d : datum) {
           assertEquals(parser.nextValue(), d);
   ```



##########
solr/core/src/test/org/apache/solr/internal/csv/CSVParserTest.java:
##########
@@ -227,10 +227,10 @@ public void testGetLine() throws IOException {
   public void testNextValue() throws IOException {
     CSVParser parser = new CSVParser(new StringReader(code));
     String tmp = null;
-    for (int i = 0; i < res.length; i++) {
-      for (int j = 0; j < res[i].length; j++) {
+    for (String[] re : res) {
+      for (int j = 0; j < re.length; j++) {
         tmp = parser.nextValue();
-        assertEquals(res[i][j], tmp);
+        assertEquals(re[j], tmp);

Review Comment:
   ```suggestion
           assertEquals(r, tmp);
   ```



##########
solr/core/src/test/org/apache/solr/internal/csv/CSVParserTest.java:
##########
@@ -227,10 +227,10 @@ public void testGetLine() throws IOException {
   public void testNextValue() throws IOException {
     CSVParser parser = new CSVParser(new StringReader(code));
     String tmp = null;
-    for (int i = 0; i < res.length; i++) {
-      for (int j = 0; j < res[i].length; j++) {
+    for (String[] re : res) {
+      for (int j = 0; j < re.length; j++) {

Review Comment:
   ```suggestion
         for (String r : re) {
   ```



##########
solr/core/src/test/org/apache/solr/internal/csv/CSVParserTest.java:
##########
@@ -302,8 +302,8 @@ public void testEndOfFileBehaviourExcel() throws Exception {
       {"world", ""}
     };
     String code;

Review Comment:
   ```suggestion
   ```



-- 
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: issues-unsubscr...@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to