From f14210b101b707b4ce09d87a1d0720ac0c696caf Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Thu, 20 Oct 2016 01:54:56 +0000 Subject: Eclipse automated refactor/cleanup: convert for loops to for-each loops git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765736 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/poifs/filesystem/TestDocumentInputStream.java | 5 ++--- .../org/apache/poi/poifs/storage/TestSmallDocumentBlock.java | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src/testcases/org/apache/poi/poifs') diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentInputStream.java b/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentInputStream.java index 6aebd7488d..bbe1e39f6f 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentInputStream.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestDocumentInputStream.java @@ -340,10 +340,9 @@ public final class TestDocumentInputStream extends TestCase { while (stream.available() >= buffer.length) { assertEquals(_buffer_size, stream.read(buffer)); - for (int j = 0; j < buffer.length; j++) - { + for (byte data : buffer) { assertEquals("in main loop, byte " + offset, - _workbook_data[ offset ], buffer[ j ]); + _workbook_data[ offset ], data); offset++; } assertEquals("offset " + offset, _workbook_size - offset, diff --git a/src/testcases/org/apache/poi/poifs/storage/TestSmallDocumentBlock.java b/src/testcases/org/apache/poi/poifs/storage/TestSmallDocumentBlock.java index a2ff6ceb1f..2d6ef1845c 100644 --- a/src/testcases/org/apache/poi/poifs/storage/TestSmallDocumentBlock.java +++ b/src/testcases/org/apache/poi/poifs/storage/TestSmallDocumentBlock.java @@ -213,10 +213,9 @@ public final class TestSmallDocumentBlock extends TestCase { assertEquals("testing block at offset " + offset, 64, out_data.length); - for (int j = 0; j < out_data.length; j++) - { + for (byte b : out_data) { assertEquals("testing byte at offset " + offset, - data[ offset ], out_data[ j ]); + data[ offset ], b); offset++; } } -- cgit v1.2.3