You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/08/10 14:46:49 UTC
[commons-compress] branch master updated: Always use blocks.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
The following commit(s) were added to refs/heads/master by this push:
new c00f900 Always use blocks.
c00f900 is described below
commit c00f900f735ff80595acb536a9c3d151c4d29909
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Aug 10 10:46:47 2021 -0400
Always use blocks.
---
.../commons/compress/harmony/pack200/tests/BHSDCodecTest.java | 4 +++-
.../apache/commons/compress/harmony/pack200/tests/CodecTest.java | 9 ++++++---
.../compress/harmony/unpack200/tests/AttributeLayoutTest.java | 3 ++-
.../commons/compress/harmony/unpack200/tests/BcBandsTest.java | 6 ++++--
4 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/src/test/java/org/apache/commons/compress/harmony/pack200/tests/BHSDCodecTest.java b/src/test/java/org/apache/commons/compress/harmony/pack200/tests/BHSDCodecTest.java
index 29e9e57..c1ed06c 100644
--- a/src/test/java/org/apache/commons/compress/harmony/pack200/tests/BHSDCodecTest.java
+++ b/src/test/java/org/apache/commons/compress/harmony/pack200/tests/BHSDCodecTest.java
@@ -42,7 +42,9 @@ public class BHSDCodecTest extends TestCase {
// range of the codec
long largest = codec.largest();
long smallest = codec.isSigned() ? codec.smallest() : 0;
- if(smallest < Integer.MIN_VALUE) smallest = Integer.MIN_VALUE;
+ if(smallest < Integer.MIN_VALUE) {
+ smallest = Integer.MIN_VALUE;
+ }
long difference = (largest - smallest) / 4;
for (long j = smallest; j <= largest; j += difference) {
if(j > Integer.MAX_VALUE) {
diff --git a/src/test/java/org/apache/commons/compress/harmony/pack200/tests/CodecTest.java b/src/test/java/org/apache/commons/compress/harmony/pack200/tests/CodecTest.java
index 2a9b242..f71df8e 100644
--- a/src/test/java/org/apache/commons/compress/harmony/pack200/tests/CodecTest.java
+++ b/src/test/java/org/apache/commons/compress/harmony/pack200/tests/CodecTest.java
@@ -44,8 +44,9 @@ public class CodecTest extends TestCase {
for (int i = 1; i <= 5; i++) {
try {
new BHSDCodec(i, 256);
- if (i == 5)
+ if (i == 5) {
fail("h=256 -> b!=5");
+ }
} catch (IllegalArgumentException e) {
assertTrue(true);
}
@@ -70,15 +71,17 @@ public class CodecTest extends TestCase {
}
public void testByte1() throws Exception {
- for (int i = 0; i < 255; i++)
+ for (int i = 0; i < 255; i++) {
decode(Codec.BYTE1, new byte[] { (byte) i }, i, 0);
+ }
}
public void testByte1Delta() throws Exception {
Codec BYTE1D = new BHSDCodec(1, 256, 0, 1);
long last = 0;
- for (int i = 1; i < 255; i++)
+ for (int i = 1; i < 255; i++) {
last = decode(BYTE1D, new byte[] { (byte) 1 }, i, last);
+ }
}
public void testByte1DeltaException() throws Exception {
diff --git a/src/test/java/org/apache/commons/compress/harmony/unpack200/tests/AttributeLayoutTest.java b/src/test/java/org/apache/commons/compress/harmony/unpack200/tests/AttributeLayoutTest.java
index b69d228..6f8693a 100644
--- a/src/test/java/org/apache/commons/compress/harmony/unpack200/tests/AttributeLayoutTest.java
+++ b/src/test/java/org/apache/commons/compress/harmony/unpack200/tests/AttributeLayoutTest.java
@@ -52,8 +52,9 @@ public class AttributeLayoutTest extends TestCase {
@Override
public ClassFileEntry getValue(int cp, long index) {
- if (index == -1)
+ if (index == -1) {
return null;
+ }
return data[cp][(int) index];
}
diff --git a/src/test/java/org/apache/commons/compress/harmony/unpack200/tests/BcBandsTest.java b/src/test/java/org/apache/commons/compress/harmony/unpack200/tests/BcBandsTest.java
index b9c9b4b..36b6d92 100644
--- a/src/test/java/org/apache/commons/compress/harmony/unpack200/tests/BcBandsTest.java
+++ b/src/test/java/org/apache/commons/compress/harmony/unpack200/tests/BcBandsTest.java
@@ -656,8 +656,9 @@ public class BcBandsTest extends AbstractBandsTestCase {
*/
public void testBcSuperMethodBand() throws IOException, Pack200Exception {
// TODO: Need to fix this testcase so it has enough data to pass.
- if (true)
+ if (true) {
return;
+ }
byte[] bytes = new byte[] { (byte) 220, (byte) 221, (byte) 222,
(byte) 227, (byte) 228, (byte) 229, (byte) 255, 8, 8, 8, 8, 8,
8 }; // bc_supermethod band
@@ -676,8 +677,9 @@ public class BcBandsTest extends AbstractBandsTestCase {
*/
public void testBcInitRefRefBand() throws IOException, Pack200Exception {
// TODO: Need to fix this testcase so it has enough data to pass.
- if (true)
+ if (true) {
return;
+ }
byte[] bytes = new byte[] { (byte) 230, (byte) 231, (byte) 232,
(byte) 255, 8, 8, 8 }; // bc_initrefref band
InputStream in = new ByteArrayInputStream(bytes);