Skip to content

Commit d0c1eff

Browse files
committed
Update dependencies
1 parent 5f0b2d4 commit d0c1eff

2 files changed

Lines changed: 8 additions & 12 deletions

File tree

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
<properties>
4949
<!-- slf4j -->
50-
<slf4j.version>1.7.30</slf4j.version>
50+
<slf4j.version>1.7.32</slf4j.version>
5151
</properties>
5252

5353
<dependencies>
@@ -67,15 +67,15 @@
6767
<dependency>
6868
<groupId>org.apache.logging.log4j</groupId>
6969
<artifactId>log4j-core</artifactId>
70-
<version>2.13.2</version>
70+
<version>2.17.0</version>
7171
<scope>test</scope>
7272
</dependency>
7373

7474
<!-- Unit test -->
7575
<dependency>
7676
<groupId>junit</groupId>
7777
<artifactId>junit</artifactId>
78-
<version>4.13</version>
78+
<version>4.13.2</version>
7979
<scope>test</scope>
8080
</dependency>
8181
<dependency>

src/main/java/fr/devnied/bitlib/BitUtils.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public final class BitUtils {
6565
* @param pByte
6666
* byte read
6767
*/
68-
public BitUtils(final byte pByte[]) {
68+
public BitUtils(final byte[] pByte) {
6969
byteTab = new byte[pByte.length];
7070
System.arraycopy(pByte, 0, byteTab, 0, pByte.length);
7171
size = pByte.length * BYTE_SIZE;
@@ -144,11 +144,7 @@ public byte getMask(final int pIndex, final int pLength) {
144144
* @return true or false
145145
*/
146146
public boolean getNextBoolean() {
147-
boolean ret = false;
148-
if (getNextInteger(1) == 1) {
149-
ret = true;
150-
}
151-
return ret;
147+
return getNextInteger(1) == 1;
152148
}
153149

154150
/**
@@ -284,7 +280,7 @@ public long getNextLongSigned(final int pLength) {
284280
throw new IllegalArgumentException("Long overflow with length > 64");
285281
}
286282
long decimal = getNextLong(pLength);
287-
long signMask = 1 << pLength - 1;
283+
long signMask = 1L << pLength - 1;
288284

289285
if ( (decimal & signMask) != 0) {
290286
return - (signMask - (signMask ^ decimal));
@@ -487,7 +483,7 @@ public void setNextByte(final byte[] pValue, final int pLength, final boolean pP
487483
buffer.put((byte) 0);
488484
}
489485
}
490-
byte tab[] = buffer.array();
486+
byte[] tab = buffer.array();
491487
if (currentBitIndex % BYTE_SIZE != 0) {
492488
int index = 0;
493489
int max = currentBitIndex + pLength;
@@ -588,7 +584,7 @@ public void setNextLong(final long pValue, final int pLength) {
588584
* @param pMaxSize
589585
* max size in bits
590586
*/
591-
protected void setNextValue(final long pValue, final int pLength, final int pMaxSize) {
587+
private void setNextValue(final long pValue, final int pLength, final int pMaxSize) {
592588
long value = pValue;
593589
// Set to max value if pValue cannot be stored on pLength bits.
594590
long bitMax = (long) Math.pow(2, Math.min(pLength, pMaxSize));

0 commit comments

Comments
 (0)