Modified:
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.binary/Base64.java.html
==============================================================================
---
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.binary/Base64.java.html
(original)
+++
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.binary/Base64.java.html
Mon Jul 15 22:37:19 2024
@@ -92,7 +92,7 @@ public class Base64 extends BaseNCodec {
* Sets the URL-safe encoding policy.
*
* @param urlSafe URL-safe encoding policy, null resets to the default.
- * @return this.
+ * @return {@code this} instance.
*/
public Builder setUrlSafe(final boolean urlSafe) {
<span class="fc" id="L98"> return
setEncodeTable(toUrlSafeEncodeTable(urlSafe));</span>
@@ -219,7 +219,6 @@ public class Base64 extends BaseNCodec {
<span class="fc" id="L219"> return new
Base64().decode(base64String);</span>
}
- // Implementation of integer encoding used for crypto
/**
* Decodes a byte64-encoded integer according to crypto standards such as
W3C's XML-Signature.
*
@@ -229,7 +228,7 @@ public class Base64 extends BaseNCodec {
* @since 1.4
*/
public static BigInteger decodeInteger(final byte[] pArray) {
-<span class="fc" id="L232"> return new BigInteger(1,
decodeBase64(pArray));</span>
+<span class="fc" id="L231"> return new BigInteger(1,
decodeBase64(pArray));</span>
}
/**
@@ -240,7 +239,7 @@ public class Base64 extends BaseNCodec {
* @return byte[] containing Base64 characters in their UTF-8
representation.
*/
public static byte[] encodeBase64(final byte[] binaryData) {
-<span class="fc" id="L243"> return encodeBase64(binaryData,
false);</span>
+<span class="fc" id="L242"> return encodeBase64(binaryData,
false);</span>
}
/**
@@ -255,7 +254,7 @@ public class Base64 extends BaseNCodec {
* Thrown when the input array needs an output array bigger
than {@link Integer#MAX_VALUE}
*/
public static byte[] encodeBase64(final byte[] binaryData, final boolean
isChunked) {
-<span class="fc" id="L258"> return encodeBase64(binaryData, isChunked,
false);</span>
+<span class="fc" id="L257"> return encodeBase64(binaryData, isChunked,
false);</span>
}
/**
@@ -274,7 +273,7 @@ public class Base64 extends BaseNCodec {
* @since 1.4
*/
public static byte[] encodeBase64(final byte[] binaryData, final boolean
isChunked, final boolean urlSafe) {
-<span class="fc" id="L277"> return encodeBase64(binaryData, isChunked,
urlSafe, Integer.MAX_VALUE);</span>
+<span class="fc" id="L276"> return encodeBase64(binaryData, isChunked,
urlSafe, Integer.MAX_VALUE);</span>
}
/**
@@ -296,20 +295,20 @@ public class Base64 extends BaseNCodec {
*/
public static byte[] encodeBase64(final byte[] binaryData, final boolean
isChunked,
final boolean urlSafe, final int
maxResultSize) {
-<span class="fc bfc" id="L299" title="All 2 branches covered."> if
(BinaryCodec.isEmpty(binaryData)) {</span>
-<span class="fc" id="L300"> return binaryData;</span>
+<span class="fc bfc" id="L298" title="All 2 branches covered."> if
(BinaryCodec.isEmpty(binaryData)) {</span>
+<span class="fc" id="L299"> return binaryData;</span>
}
// Create this so can use the super-class method
// Also ensures that the same roundings are performed by the ctor and
the code
-<span class="fc bfc" id="L304" title="All 2 branches covered."> final
Base64 b64 = isChunked ? new Base64(urlSafe) : new Base64(0, CHUNK_SEPARATOR,
urlSafe);</span>
-<span class="fc" id="L305"> final long len =
b64.getEncodedLength(binaryData);</span>
-<span class="fc bfc" id="L306" title="All 2 branches covered."> if (len
> maxResultSize) {</span>
-<span class="fc" id="L307"> throw new
IllegalArgumentException("Input array too big, the output array would be
bigger (" +</span>
+<span class="fc bfc" id="L303" title="All 2 branches covered."> final
Base64 b64 = isChunked ? new Base64(urlSafe) : new Base64(0, CHUNK_SEPARATOR,
urlSafe);</span>
+<span class="fc" id="L304"> final long len =
b64.getEncodedLength(binaryData);</span>
+<span class="fc bfc" id="L305" title="All 2 branches covered."> if (len
> maxResultSize) {</span>
+<span class="fc" id="L306"> throw new
IllegalArgumentException("Input array too big, the output array would be
bigger (" +</span>
len +
") than the specified maximum size of " +
maxResultSize);
}
-<span class="fc" id="L312"> return b64.encode(binaryData);</span>
+<span class="fc" id="L311"> return b64.encode(binaryData);</span>
}
/**
@@ -320,7 +319,7 @@ public class Base64 extends BaseNCodec {
* @return Base64 characters chunked in 76 character blocks
*/
public static byte[] encodeBase64Chunked(final byte[] binaryData) {
-<span class="fc" id="L323"> return encodeBase64(binaryData,
true);</span>
+<span class="fc" id="L322"> return encodeBase64(binaryData,
true);</span>
}
/**
@@ -335,7 +334,7 @@ public class Base64 extends BaseNCodec {
* @since 1.4 (NOTE: 1.4 chunked the output, whereas 1.5 does not).
*/
public static String encodeBase64String(final byte[] binaryData) {
-<span class="fc" id="L338"> return
StringUtils.newStringUsAscii(encodeBase64(binaryData, false));</span>
+<span class="fc" id="L337"> return
StringUtils.newStringUsAscii(encodeBase64(binaryData, false));</span>
}
/**
@@ -348,7 +347,7 @@ public class Base64 extends BaseNCodec {
* @since 1.4
*/
public static byte[] encodeBase64URLSafe(final byte[] binaryData) {
-<span class="fc" id="L351"> return encodeBase64(binaryData, false,
true);</span>
+<span class="fc" id="L350"> return encodeBase64(binaryData, false,
true);</span>
}
/**
@@ -361,7 +360,7 @@ public class Base64 extends BaseNCodec {
* @since 1.4
*/
public static String encodeBase64URLSafeString(final byte[] binaryData) {
-<span class="fc" id="L364"> return
StringUtils.newStringUsAscii(encodeBase64(binaryData, false, true));</span>
+<span class="fc" id="L363"> return
StringUtils.newStringUsAscii(encodeBase64(binaryData, false, true));</span>
}
/**
@@ -375,8 +374,8 @@ public class Base64 extends BaseNCodec {
* @since 1.4
*/
public static byte[] encodeInteger(final BigInteger bigInteger) {
-<span class="fc" id="L378"> Objects.requireNonNull(bigInteger,
"bigInteger");</span>
-<span class="fc" id="L379"> return
encodeBase64(toIntegerBytes(bigInteger), false);</span>
+<span class="fc" id="L377"> Objects.requireNonNull(bigInteger,
"bigInteger");</span>
+<span class="fc" id="L378"> return
encodeBase64(toIntegerBytes(bigInteger), false);</span>
}
/**
@@ -391,7 +390,7 @@ public class Base64 extends BaseNCodec {
*/
@Deprecated
public static boolean isArrayByteBase64(final byte[] arrayOctet) {
-<span class="nc" id="L394"> return isBase64(arrayOctet);</span>
+<span class="nc" id="L393"> return isBase64(arrayOctet);</span>
}
/**
@@ -403,7 +402,7 @@ public class Base64 extends BaseNCodec {
* @since 1.4
*/
public static boolean isBase64(final byte octet) {
-<span class="fc bfc" id="L406" title="All 8 branches covered."> return
octet == PAD_DEFAULT || octet >= 0 && octet < DECODE_TABLE.length
&& DECODE_TABLE[octet] != -1;</span>
+<span class="fc bfc" id="L405" title="All 8 branches covered."> return
octet == PAD_DEFAULT || octet >= 0 && octet < DECODE_TABLE.length
&& DECODE_TABLE[octet] != -1;</span>
}
/**
@@ -417,12 +416,12 @@ public class Base64 extends BaseNCodec {
* @since 1.5
*/
public static boolean isBase64(final byte[] arrayOctet) {
-<span class="fc bfc" id="L420" title="All 2 branches covered."> for
(final byte element : arrayOctet) {</span>
-<span class="fc bfc" id="L421" title="All 4 branches covered."> if
(!isBase64(element) && !Character.isWhitespace(element)) {</span>
-<span class="fc" id="L422"> return false;</span>
+<span class="fc bfc" id="L419" title="All 2 branches covered."> for
(final byte element : arrayOctet) {</span>
+<span class="fc bfc" id="L420" title="All 4 branches covered."> if
(!isBase64(element) && !Character.isWhitespace(element)) {</span>
+<span class="fc" id="L421"> return false;</span>
}
}
-<span class="fc" id="L425"> return true;</span>
+<span class="fc" id="L424"> return true;</span>
}
/**
@@ -436,7 +435,7 @@ public class Base64 extends BaseNCodec {
* @since 1.5
*/
public static boolean isBase64(final String base64) {
-<span class="fc" id="L439"> return
isBase64(StringUtils.getBytesUtf8(base64));</span>
+<span class="fc" id="L438"> return
isBase64(StringUtils.getBytesUtf8(base64));</span>
}
/**
@@ -447,31 +446,31 @@ public class Base64 extends BaseNCodec {
* @return a byte array representation of the BigInteger parameter
*/
static byte[] toIntegerBytes(final BigInteger bigInt) {
-<span class="fc" id="L450"> int bitlen = bigInt.bitLength();</span>
+<span class="fc" id="L449"> int bitlen = bigInt.bitLength();</span>
// round bitlen
-<span class="fc" id="L452"> bitlen = bitlen + 7 >> 3 <<
3;</span>
-<span class="fc" id="L453"> final byte[] bigBytes =
bigInt.toByteArray();</span>
+<span class="fc" id="L451"> bitlen = bitlen + 7 >> 3 <<
3;</span>
+<span class="fc" id="L452"> final byte[] bigBytes =
bigInt.toByteArray();</span>
-<span class="pc bpc" id="L455" title="1 of 4 branches missed."> if
(bigInt.bitLength() % 8 != 0 && bigInt.bitLength() / 8 + 1 == bitlen /
8) {</span>
-<span class="fc" id="L456"> return bigBytes;</span>
+<span class="pc bpc" id="L454" title="1 of 4 branches missed."> if
(bigInt.bitLength() % 8 != 0 && bigInt.bitLength() / 8 + 1 == bitlen /
8) {</span>
+<span class="fc" id="L455"> return bigBytes;</span>
}
// set up params for copying everything but sign bit
-<span class="fc" id="L459"> int startSrc = 0;</span>
-<span class="fc" id="L460"> int len = bigBytes.length;</span>
+<span class="fc" id="L458"> int startSrc = 0;</span>
+<span class="fc" id="L459"> int len = bigBytes.length;</span>
// if bigInt is exactly byte-aligned, just skip signbit in copy
-<span class="pc bpc" id="L463" title="1 of 2 branches missed."> if
(bigInt.bitLength() % 8 == 0) {</span>
-<span class="fc" id="L464"> startSrc = 1;</span>
-<span class="fc" id="L465"> len--;</span>
- }
-<span class="fc" id="L467"> final int startDst = bitlen / 8 - len; //
to pad w/ nulls as per spec</span>
-<span class="fc" id="L468"> final byte[] resizedBytes = new byte[bitlen
/ 8];</span>
-<span class="fc" id="L469"> System.arraycopy(bigBytes, startSrc,
resizedBytes, startDst, len);</span>
-<span class="fc" id="L470"> return resizedBytes;</span>
+<span class="pc bpc" id="L462" title="1 of 2 branches missed."> if
(bigInt.bitLength() % 8 == 0) {</span>
+<span class="fc" id="L463"> startSrc = 1;</span>
+<span class="fc" id="L464"> len--;</span>
+ }
+<span class="fc" id="L466"> final int startDst = bitlen / 8 - len; //
to pad w/ nulls as per spec</span>
+<span class="fc" id="L467"> final byte[] resizedBytes = new byte[bitlen
/ 8];</span>
+<span class="fc" id="L468"> System.arraycopy(bigBytes, startSrc,
resizedBytes, startDst, len);</span>
+<span class="fc" id="L469"> return resizedBytes;</span>
}
private static byte[] toUrlSafeEncodeTable(final boolean urlSafe) {
-<span class="fc bfc" id="L474" title="All 2 branches covered."> return
urlSafe ? URL_SAFE_ENCODE_TABLE : STANDARD_ENCODE_TABLE;</span>
+<span class="fc bfc" id="L473" title="All 2 branches covered."> return
urlSafe ? URL_SAFE_ENCODE_TABLE : STANDARD_ENCODE_TABLE;</span>
}
/**
@@ -510,8 +509,8 @@ public class Base64 extends BaseNCodec {
* </p>
*/
public Base64() {
-<span class="fc" id="L513"> this(0);</span>
-<span class="fc" id="L514"> }</span>
+<span class="fc" id="L512"> this(0);</span>
+<span class="fc" id="L513"> }</span>
/**
* Constructs a Base64 codec used for decoding (all modes) and encoding in
the given URL-safe mode.
@@ -528,8 +527,8 @@ public class Base64 extends BaseNCodec {
* @since 1.4
*/
public Base64(final boolean urlSafe) {
-<span class="fc" id="L531"> this(MIME_CHUNK_SIZE, CHUNK_SEPARATOR,
urlSafe);</span>
-<span class="fc" id="L532"> }</span>
+<span class="fc" id="L530"> this(MIME_CHUNK_SIZE, CHUNK_SEPARATOR,
urlSafe);</span>
+<span class="fc" id="L531"> }</span>
/**
@@ -552,8 +551,8 @@ public class Base64 extends BaseNCodec {
* @since 1.4
*/
public Base64(final int lineLength) {
-<span class="fc" id="L555"> this(lineLength, CHUNK_SEPARATOR);</span>
-<span class="fc" id="L556"> }</span>
+<span class="fc" id="L554"> this(lineLength, CHUNK_SEPARATOR);</span>
+<span class="fc" id="L555"> }</span>
/**
* Constructs a Base64 codec used for decoding (all modes) and encoding in
URL-unsafe mode.
@@ -579,8 +578,8 @@ public class Base64 extends BaseNCodec {
* @since 1.4
*/
public Base64(final int lineLength, final byte[] lineSeparator) {
-<span class="fc" id="L582"> this(lineLength, lineSeparator,
false);</span>
-<span class="fc" id="L583"> }</span>
+<span class="fc" id="L581"> this(lineLength, lineSeparator,
false);</span>
+<span class="fc" id="L582"> }</span>
/**
* Constructs a Base64 codec used for decoding (all modes) and encoding in
URL-unsafe mode.
@@ -610,8 +609,8 @@ public class Base64 extends BaseNCodec {
* @since 1.4
*/
public Base64(final int lineLength, final byte[] lineSeparator, final
boolean urlSafe) {
-<span class="fc" id="L613"> this(lineLength, lineSeparator,
PAD_DEFAULT, toUrlSafeEncodeTable(urlSafe), DECODING_POLICY_DEFAULT);</span>
-<span class="fc" id="L614"> }</span>
+<span class="fc" id="L612"> this(lineLength, lineSeparator,
PAD_DEFAULT, toUrlSafeEncodeTable(urlSafe), DECODING_POLICY_DEFAULT);</span>
+<span class="fc" id="L613"> }</span>
/**
* Constructs a Base64 codec used for decoding (all modes) and encoding in
URL-unsafe mode.
@@ -642,8 +641,8 @@ public class Base64 extends BaseNCodec {
* @since 1.15
*/
public Base64(final int lineLength, final byte[] lineSeparator, final
boolean urlSafe, final CodecPolicy decodingPolicy) {
-<span class="fc" id="L645"> this(lineLength, lineSeparator,
PAD_DEFAULT, toUrlSafeEncodeTable(urlSafe), decodingPolicy);</span>
-<span class="fc" id="L646"> }</span>
+<span class="fc" id="L644"> this(lineLength, lineSeparator,
PAD_DEFAULT, toUrlSafeEncodeTable(urlSafe), decodingPolicy);</span>
+<span class="fc" id="L645"> }</span>
/**
* Constructs a Base64 codec used for decoding (all modes) and encoding in
URL-unsafe mode.
@@ -666,40 +665,40 @@ public class Base64 extends BaseNCodec {
* @throws IllegalArgumentException Thrown when the {@code lineSeparator}
contains Base64 characters.
*/
private Base64(final int lineLength, final byte[] lineSeparator, final
byte padding, final byte[] encodeTable, final CodecPolicy decodingPolicy) {
-<span class="fc" id="L669"> super(BYTES_PER_UNENCODED_BLOCK,
BYTES_PER_ENCODED_BLOCK, lineLength, toLength(lineSeparator), padding,
decodingPolicy);</span>
-<span class="fc" id="L670"> Objects.requireNonNull(encodeTable,
"encodeTable");</span>
-<span class="fc bfc" id="L671" title="All 2 branches covered."> if
(encodeTable.length != ALPHABET_LENGTH) {</span>
-<span class="fc" id="L672"> throw new
IllegalArgumentException("encodeTable must have exactly 64
entries.");</span>
- }
-<span class="fc bfc" id="L674" title="All 2 branches covered.">
this.isUrlSafe = encodeTable == URL_SAFE_ENCODE_TABLE;</span>
-<span class="fc bfc" id="L675" title="All 4 branches covered."> if
(encodeTable == STANDARD_ENCODE_TABLE || this.isUrlSafe) {</span>
-<span class="fc" id="L676"> decodeTable = DECODE_TABLE;</span>
+<span class="fc" id="L668"> super(BYTES_PER_UNENCODED_BLOCK,
BYTES_PER_ENCODED_BLOCK, lineLength, toLength(lineSeparator), padding,
decodingPolicy);</span>
+<span class="fc" id="L669"> Objects.requireNonNull(encodeTable,
"encodeTable");</span>
+<span class="fc bfc" id="L670" title="All 2 branches covered."> if
(encodeTable.length != ALPHABET_LENGTH) {</span>
+<span class="fc" id="L671"> throw new
IllegalArgumentException("encodeTable must have exactly 64
entries.");</span>
+ }
+<span class="fc bfc" id="L673" title="All 2 branches covered.">
this.isUrlSafe = encodeTable == URL_SAFE_ENCODE_TABLE;</span>
+<span class="fc bfc" id="L674" title="All 4 branches covered."> if
(encodeTable == STANDARD_ENCODE_TABLE || this.isUrlSafe) {</span>
+<span class="fc" id="L675"> decodeTable = DECODE_TABLE;</span>
// No need of a defensive copy of an internal table.
-<span class="fc" id="L678"> this.encodeTable = encodeTable;</span>
+<span class="fc" id="L677"> this.encodeTable = encodeTable;</span>
} else {
-<span class="fc" id="L680"> this.encodeTable =
encodeTable.clone();</span>
-<span class="fc" id="L681"> this.decodeTable =
calculateDecodeTable(this.encodeTable);</span>
+<span class="fc" id="L679"> this.encodeTable =
encodeTable.clone();</span>
+<span class="fc" id="L680"> this.decodeTable =
calculateDecodeTable(this.encodeTable);</span>
}
// TODO could be simplified if there is no requirement to reject
invalid line sep when length <=0
// @see test case Base64Test.testConstructors()
-<span class="fc bfc" id="L685" title="All 2 branches covered."> if
(lineSeparator != null) {</span>
-<span class="fc" id="L686"> final byte[] lineSeparatorCopy =
lineSeparator.clone();</span>
-<span class="fc bfc" id="L687" title="All 2 branches covered."> if
(containsAlphabetOrPad(lineSeparatorCopy)) {</span>
-<span class="fc" id="L688"> final String sep =
StringUtils.newStringUtf8(lineSeparatorCopy);</span>
-<span class="fc" id="L689"> throw new
IllegalArgumentException("lineSeparator must not contain base64
characters: [" + sep + "]");</span>
+<span class="fc bfc" id="L684" title="All 2 branches covered."> if
(lineSeparator != null) {</span>
+<span class="fc" id="L685"> final byte[] lineSeparatorCopy =
lineSeparator.clone();</span>
+<span class="fc bfc" id="L686" title="All 2 branches covered."> if
(containsAlphabetOrPad(lineSeparatorCopy)) {</span>
+<span class="fc" id="L687"> final String sep =
StringUtils.newStringUtf8(lineSeparatorCopy);</span>
+<span class="fc" id="L688"> throw new
IllegalArgumentException("lineSeparator must not contain base64
characters: [" + sep + "]");</span>
}
-<span class="fc bfc" id="L691" title="All 2 branches covered."> if
(lineLength > 0) { // null line-sep forces no chunking rather than throwing
IAE</span>
-<span class="fc" id="L692"> this.encodeSize =
BYTES_PER_ENCODED_BLOCK + lineSeparatorCopy.length;</span>
-<span class="fc" id="L693"> this.lineSeparator =
lineSeparatorCopy;</span>
+<span class="fc bfc" id="L690" title="All 2 branches covered."> if
(lineLength > 0) { // null line-sep forces no chunking rather than throwing
IAE</span>
+<span class="fc" id="L691"> this.encodeSize =
BYTES_PER_ENCODED_BLOCK + lineSeparatorCopy.length;</span>
+<span class="fc" id="L692"> this.lineSeparator =
lineSeparatorCopy;</span>
} else {
-<span class="fc" id="L695"> this.encodeSize =
BYTES_PER_ENCODED_BLOCK;</span>
-<span class="fc" id="L696"> this.lineSeparator = null;</span>
+<span class="fc" id="L694"> this.encodeSize =
BYTES_PER_ENCODED_BLOCK;</span>
+<span class="fc" id="L695"> this.lineSeparator = null;</span>
}
-<span class="fc" id="L698"> } else {</span>
-<span class="fc" id="L699"> this.encodeSize =
BYTES_PER_ENCODED_BLOCK;</span>
-<span class="fc" id="L700"> this.lineSeparator = null;</span>
+<span class="fc" id="L697"> } else {</span>
+<span class="fc" id="L698"> this.encodeSize =
BYTES_PER_ENCODED_BLOCK;</span>
+<span class="fc" id="L699"> this.lineSeparator = null;</span>
}
-<span class="fc" id="L702"> }</span>
+<span class="fc" id="L701"> }</span>
/**
* Calculates a decode table for a given encode table.
@@ -708,12 +707,12 @@ public class Base64 extends BaseNCodec {
* @return decodeTable
*/
private byte[] calculateDecodeTable(final byte[] encodeTable) {
-<span class="fc" id="L711"> final byte[] decodeTable = new
byte[DECODING_TABLE_LENGTH];</span>
-<span class="fc" id="L712"> Arrays.fill(decodeTable, (byte) -1);</span>
-<span class="fc bfc" id="L713" title="All 2 branches covered."> for
(int i = 0; i < encodeTable.length; i++) {</span>
-<span class="fc" id="L714"> decodeTable[encodeTable[i]] = (byte)
i;</span>
+<span class="fc" id="L710"> final byte[] decodeTable = new
byte[DECODING_TABLE_LENGTH];</span>
+<span class="fc" id="L711"> Arrays.fill(decodeTable, (byte) -1);</span>
+<span class="fc bfc" id="L712" title="All 2 branches covered."> for
(int i = 0; i < encodeTable.length; i++) {</span>
+<span class="fc" id="L713"> decodeTable[encodeTable[i]] = (byte)
i;</span>
}
-<span class="fc" id="L716"> return decodeTable;</span>
+<span class="fc" id="L715"> return decodeTable;</span>
}
/**
@@ -743,30 +742,30 @@ public class Base64 extends BaseNCodec {
*/
@Override
void decode(final byte[] input, int inPos, final int inAvail, final
Context context) {
-<span class="fc bfc" id="L746" title="All 2 branches covered."> if
(context.eof) {</span>
-<span class="fc" id="L747"> return;</span>
+<span class="fc bfc" id="L745" title="All 2 branches covered."> if
(context.eof) {</span>
+<span class="fc" id="L746"> return;</span>
}
-<span class="fc bfc" id="L749" title="All 2 branches covered."> if
(inAvail < 0) {</span>
-<span class="fc" id="L750"> context.eof = true;</span>
+<span class="fc bfc" id="L748" title="All 2 branches covered."> if
(inAvail < 0) {</span>
+<span class="fc" id="L749"> context.eof = true;</span>
}
-<span class="fc" id="L752"> final int decodeSize = this.encodeSize -
1;</span>
-<span class="fc bfc" id="L753" title="All 2 branches covered."> for
(int i = 0; i < inAvail; i++) {</span>
-<span class="fc" id="L754"> final byte[] buffer =
ensureBufferSize(decodeSize, context);</span>
-<span class="fc" id="L755"> final byte b = input[inPos++];</span>
-<span class="fc bfc" id="L756" title="All 2 branches covered."> if
(b == pad) {</span>
+<span class="fc" id="L751"> final int decodeSize = this.encodeSize -
1;</span>
+<span class="fc bfc" id="L752" title="All 2 branches covered."> for
(int i = 0; i < inAvail; i++) {</span>
+<span class="fc" id="L753"> final byte[] buffer =
ensureBufferSize(decodeSize, context);</span>
+<span class="fc" id="L754"> final byte b = input[inPos++];</span>
+<span class="fc bfc" id="L755" title="All 2 branches covered."> if
(b == pad) {</span>
// We're done.
-<span class="fc" id="L758"> context.eof = true;</span>
-<span class="fc" id="L759"> break;</span>
+<span class="fc" id="L757"> context.eof = true;</span>
+<span class="fc" id="L758"> break;</span>
}
-<span class="fc bfc" id="L761" title="All 4 branches covered."> if
(b >= 0 && b < decodeTable.length) {</span>
-<span class="fc" id="L762"> final int result =
decodeTable[b];</span>
-<span class="fc bfc" id="L763" title="All 2 branches covered.">
if (result >= 0) {</span>
-<span class="fc" id="L764"> context.modulus =
(context.modulus + 1) % BYTES_PER_ENCODED_BLOCK;</span>
-<span class="fc" id="L765"> context.ibitWorkArea =
(context.ibitWorkArea << BITS_PER_ENCODED_BYTE) + result;</span>
-<span class="fc bfc" id="L766" title="All 2 branches covered.">
if (context.modulus == 0) {</span>
-<span class="fc" id="L767"> buffer[context.pos++] =
(byte) (context.ibitWorkArea >> 16 & MASK_8BITS);</span>
-<span class="fc" id="L768"> buffer[context.pos++] =
(byte) (context.ibitWorkArea >> 8 & MASK_8BITS);</span>
-<span class="fc" id="L769"> buffer[context.pos++] =
(byte) (context.ibitWorkArea & MASK_8BITS);</span>
+<span class="fc bfc" id="L760" title="All 4 branches covered."> if
(b >= 0 && b < decodeTable.length) {</span>
+<span class="fc" id="L761"> final int result =
decodeTable[b];</span>
+<span class="fc bfc" id="L762" title="All 2 branches covered.">
if (result >= 0) {</span>
+<span class="fc" id="L763"> context.modulus =
(context.modulus + 1) % BYTES_PER_ENCODED_BLOCK;</span>
+<span class="fc" id="L764"> context.ibitWorkArea =
(context.ibitWorkArea << BITS_PER_ENCODED_BYTE) + result;</span>
+<span class="fc bfc" id="L765" title="All 2 branches covered.">
if (context.modulus == 0) {</span>
+<span class="fc" id="L766"> buffer[context.pos++] =
(byte) (context.ibitWorkArea >> 16 & MASK_8BITS);</span>
+<span class="fc" id="L767"> buffer[context.pos++] =
(byte) (context.ibitWorkArea >> 8 & MASK_8BITS);</span>
+<span class="fc" id="L768"> buffer[context.pos++] =
(byte) (context.ibitWorkArea & MASK_8BITS);</span>
}
}
}
@@ -775,32 +774,32 @@ public class Base64 extends BaseNCodec {
// Two forms of EOF as far as base64 decoder is concerned: actual
// EOF (-1) and first time '=' character is encountered in stream.
// This approach makes the '=' padding characters completely optional.
-<span class="fc bfc" id="L778" title="All 4 branches covered."> if
(context.eof && context.modulus != 0) {</span>
-<span class="fc" id="L779"> final byte[] buffer =
ensureBufferSize(decodeSize, context);</span>
+<span class="fc bfc" id="L777" title="All 4 branches covered."> if
(context.eof && context.modulus != 0) {</span>
+<span class="fc" id="L778"> final byte[] buffer =
ensureBufferSize(decodeSize, context);</span>
// We have some spare bits remaining
// Output all whole multiples of 8 bits and ignore the rest
-<span class="pc bpc" id="L783" title="1 of 4 branches missed.">
switch (context.modulus) {</span>
+<span class="pc bpc" id="L782" title="1 of 4 branches missed.">
switch (context.modulus) {</span>
// case 0 : // impossible, as excluded above
case 1 : // 6 bits - either ignore entirely, or raise an
exception
-<span class="fc" id="L786">
validateTrailingCharacter();</span>
-<span class="fc" id="L787"> break;</span>
+<span class="fc" id="L785">
validateTrailingCharacter();</span>
+<span class="fc" id="L786"> break;</span>
case 2 : // 12 bits = 8 + 4
-<span class="fc" id="L789"> validateCharacter(MASK_4BITS,
context);</span>
-<span class="fc" id="L790"> context.ibitWorkArea =
context.ibitWorkArea >> 4; // dump the extra 4 bits</span>
-<span class="fc" id="L791"> buffer[context.pos++] = (byte)
(context.ibitWorkArea & MASK_8BITS);</span>
-<span class="fc" id="L792"> break;</span>
+<span class="fc" id="L788"> validateCharacter(MASK_4BITS,
context);</span>
+<span class="fc" id="L789"> context.ibitWorkArea =
context.ibitWorkArea >> 4; // dump the extra 4 bits</span>
+<span class="fc" id="L790"> buffer[context.pos++] = (byte)
(context.ibitWorkArea & MASK_8BITS);</span>
+<span class="fc" id="L791"> break;</span>
case 3 : // 18 bits = 8 + 8 + 2
-<span class="fc" id="L794"> validateCharacter(MASK_2BITS,
context);</span>
-<span class="fc" id="L795"> context.ibitWorkArea =
context.ibitWorkArea >> 2; // dump 2 bits</span>
-<span class="fc" id="L796"> buffer[context.pos++] = (byte)
(context.ibitWorkArea >> 8 & MASK_8BITS);</span>
-<span class="fc" id="L797"> buffer[context.pos++] = (byte)
(context.ibitWorkArea & MASK_8BITS);</span>
-<span class="fc" id="L798"> break;</span>
+<span class="fc" id="L793"> validateCharacter(MASK_2BITS,
context);</span>
+<span class="fc" id="L794"> context.ibitWorkArea =
context.ibitWorkArea >> 2; // dump 2 bits</span>
+<span class="fc" id="L795"> buffer[context.pos++] = (byte)
(context.ibitWorkArea >> 8 & MASK_8BITS);</span>
+<span class="fc" id="L796"> buffer[context.pos++] = (byte)
(context.ibitWorkArea & MASK_8BITS);</span>
+<span class="fc" id="L797"> break;</span>
default:
-<span class="nc" id="L800"> throw new
IllegalStateException("Impossible modulus " + context.modulus);</span>
+<span class="nc" id="L799"> throw new
IllegalStateException("Impossible modulus " + context.modulus);</span>
}
}
-<span class="fc" id="L803"> }</span>
+<span class="fc" id="L802"> }</span>
/**
* <p>
@@ -825,75 +824,75 @@ public class Base64 extends BaseNCodec {
*/
@Override
void encode(final byte[] in, int inPos, final int inAvail, final Context
context) {
-<span class="fc bfc" id="L828" title="All 2 branches covered."> if
(context.eof) {</span>
-<span class="fc" id="L829"> return;</span>
+<span class="fc bfc" id="L827" title="All 2 branches covered."> if
(context.eof) {</span>
+<span class="fc" id="L828"> return;</span>
}
// inAvail < 0 is how we're informed of EOF in the underlying data
we're
// encoding.
-<span class="fc bfc" id="L833" title="All 2 branches covered."> if
(inAvail < 0) {</span>
-<span class="fc" id="L834"> context.eof = true;</span>
-<span class="fc bfc" id="L835" title="All 4 branches covered."> if
(0 == context.modulus && lineLength == 0) {</span>
-<span class="fc" id="L836"> return; // no leftovers to process
and not using chunking</span>
+<span class="fc bfc" id="L832" title="All 2 branches covered."> if
(inAvail < 0) {</span>
+<span class="fc" id="L833"> context.eof = true;</span>
+<span class="fc bfc" id="L834" title="All 4 branches covered."> if
(0 == context.modulus && lineLength == 0) {</span>
+<span class="fc" id="L835"> return; // no leftovers to process
and not using chunking</span>
}
-<span class="fc" id="L838"> final byte[] buffer =
ensureBufferSize(encodeSize, context);</span>
-<span class="fc" id="L839"> final int savedPos = context.pos;</span>
-<span class="pc bpc" id="L840" title="1 of 4 branches missed.">
switch (context.modulus) { // 0-2</span>
+<span class="fc" id="L837"> final byte[] buffer =
ensureBufferSize(encodeSize, context);</span>
+<span class="fc" id="L838"> final int savedPos = context.pos;</span>
+<span class="pc bpc" id="L839" title="1 of 4 branches missed.">
switch (context.modulus) { // 0-2</span>
case 0 : // nothing to do here
-<span class="fc" id="L842"> break;</span>
+<span class="fc" id="L841"> break;</span>
case 1 : // 8 bits = 6 + 2
// top 6 bits:
-<span class="fc" id="L845"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea >> 2 & MASK_6BITS];</span>
+<span class="fc" id="L844"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea >> 2 & MASK_6BITS];</span>
// remaining 2:
-<span class="fc" id="L847"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea << 4 & MASK_6BITS];</span>
+<span class="fc" id="L846"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea << 4 & MASK_6BITS];</span>
// URL-SAFE skips the padding to further reduce size.
-<span class="fc bfc" id="L849" title="All 2 branches covered.">
if (encodeTable == STANDARD_ENCODE_TABLE) {</span>
+<span class="fc bfc" id="L848" title="All 2 branches covered.">
if (encodeTable == STANDARD_ENCODE_TABLE) {</span>
+<span class="fc" id="L849"> buffer[context.pos++] =
pad;</span>
<span class="fc" id="L850"> buffer[context.pos++] =
pad;</span>
-<span class="fc" id="L851"> buffer[context.pos++] =
pad;</span>
}
break;
case 2 : // 16 bits = 6 + 6 + 4
-<span class="fc" id="L856"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea >> 10 & MASK_6BITS];</span>
-<span class="fc" id="L857"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea >> 4 & MASK_6BITS];</span>
-<span class="fc" id="L858"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea << 2 & MASK_6BITS];</span>
+<span class="fc" id="L855"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea >> 10 & MASK_6BITS];</span>
+<span class="fc" id="L856"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea >> 4 & MASK_6BITS];</span>
+<span class="fc" id="L857"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea << 2 & MASK_6BITS];</span>
// URL-SAFE skips the padding to further reduce size.
-<span class="fc bfc" id="L860" title="All 2 branches covered.">
if (encodeTable == STANDARD_ENCODE_TABLE) {</span>
-<span class="fc" id="L861"> buffer[context.pos++] =
pad;</span>
+<span class="fc bfc" id="L859" title="All 2 branches covered.">
if (encodeTable == STANDARD_ENCODE_TABLE) {</span>
+<span class="fc" id="L860"> buffer[context.pos++] =
pad;</span>
}
break;
default:
-<span class="nc" id="L865"> throw new
IllegalStateException("Impossible modulus " + context.modulus);</span>
+<span class="nc" id="L864"> throw new
IllegalStateException("Impossible modulus " + context.modulus);</span>
}
-<span class="fc" id="L867"> context.currentLinePos += context.pos -
savedPos; // keep track of current line position</span>
+<span class="fc" id="L866"> context.currentLinePos += context.pos -
savedPos; // keep track of current line position</span>
// if currentPos == 0 we are at the start of a line, so don't add
CRLF
-<span class="fc bfc" id="L869" title="All 4 branches covered."> if
(lineLength > 0 && context.currentLinePos > 0) {</span>
-<span class="fc" id="L870"> System.arraycopy(lineSeparator, 0,
buffer, context.pos, lineSeparator.length);</span>
-<span class="fc" id="L871"> context.pos +=
lineSeparator.length;</span>
+<span class="fc bfc" id="L868" title="All 4 branches covered."> if
(lineLength > 0 && context.currentLinePos > 0) {</span>
+<span class="fc" id="L869"> System.arraycopy(lineSeparator, 0,
buffer, context.pos, lineSeparator.length);</span>
+<span class="fc" id="L870"> context.pos +=
lineSeparator.length;</span>
}
-<span class="fc" id="L873"> } else {</span>
-<span class="fc bfc" id="L874" title="All 2 branches covered."> for
(int i = 0; i < inAvail; i++) {</span>
-<span class="fc" id="L875"> final byte[] buffer =
ensureBufferSize(encodeSize, context);</span>
-<span class="fc" id="L876"> context.modulus = (context.modulus
+ 1) % BYTES_PER_UNENCODED_BLOCK;</span>
-<span class="fc" id="L877"> int b = in[inPos++];</span>
-<span class="fc bfc" id="L878" title="All 2 branches covered.">
if (b < 0) {</span>
-<span class="fc" id="L879"> b += 256;</span>
+<span class="fc" id="L872"> } else {</span>
+<span class="fc bfc" id="L873" title="All 2 branches covered."> for
(int i = 0; i < inAvail; i++) {</span>
+<span class="fc" id="L874"> final byte[] buffer =
ensureBufferSize(encodeSize, context);</span>
+<span class="fc" id="L875"> context.modulus = (context.modulus
+ 1) % BYTES_PER_UNENCODED_BLOCK;</span>
+<span class="fc" id="L876"> int b = in[inPos++];</span>
+<span class="fc bfc" id="L877" title="All 2 branches covered.">
if (b < 0) {</span>
+<span class="fc" id="L878"> b += 256;</span>
}
-<span class="fc" id="L881"> context.ibitWorkArea =
(context.ibitWorkArea << 8) + b; // BITS_PER_BYTE</span>
-<span class="fc bfc" id="L882" title="All 2 branches covered.">
if (0 == context.modulus) { // 3 bytes = 24 bits = 4 * 6 bits to extract</span>
-<span class="fc" id="L883"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea >> 18 & MASK_6BITS];</span>
-<span class="fc" id="L884"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea >> 12 & MASK_6BITS];</span>
-<span class="fc" id="L885"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea >> 6 & MASK_6BITS];</span>
-<span class="fc" id="L886"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea & MASK_6BITS];</span>
-<span class="fc" id="L887"> context.currentLinePos +=
BYTES_PER_ENCODED_BLOCK;</span>
-<span class="fc bfc" id="L888" title="All 4 branches covered.">
if (lineLength > 0 && lineLength <= context.currentLinePos)
{</span>
-<span class="fc" id="L889">
System.arraycopy(lineSeparator, 0, buffer, context.pos,
lineSeparator.length);</span>
-<span class="fc" id="L890"> context.pos +=
lineSeparator.length;</span>
-<span class="fc" id="L891"> context.currentLinePos =
0;</span>
+<span class="fc" id="L880"> context.ibitWorkArea =
(context.ibitWorkArea << 8) + b; // BITS_PER_BYTE</span>
+<span class="fc bfc" id="L881" title="All 2 branches covered.">
if (0 == context.modulus) { // 3 bytes = 24 bits = 4 * 6 bits to extract</span>
+<span class="fc" id="L882"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea >> 18 & MASK_6BITS];</span>
+<span class="fc" id="L883"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea >> 12 & MASK_6BITS];</span>
+<span class="fc" id="L884"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea >> 6 & MASK_6BITS];</span>
+<span class="fc" id="L885"> buffer[context.pos++] =
encodeTable[context.ibitWorkArea & MASK_6BITS];</span>
+<span class="fc" id="L886"> context.currentLinePos +=
BYTES_PER_ENCODED_BLOCK;</span>
+<span class="fc bfc" id="L887" title="All 4 branches covered.">
if (lineLength > 0 && lineLength <= context.currentLinePos)
{</span>
+<span class="fc" id="L888">
System.arraycopy(lineSeparator, 0, buffer, context.pos,
lineSeparator.length);</span>
+<span class="fc" id="L889"> context.pos +=
lineSeparator.length;</span>
+<span class="fc" id="L890"> context.currentLinePos =
0;</span>
}
}
}
}
-<span class="fc" id="L896"> }</span>
+<span class="fc" id="L895"> }</span>
/**
* Gets the line separator (for testing only).
@@ -901,7 +900,7 @@ public class Base64 extends BaseNCodec {
* @return the line separator.
*/
byte[] getLineSeparator() {
-<span class="fc" id="L904"> return lineSeparator;</span>
+<span class="fc" id="L903"> return lineSeparator;</span>
}
/**
@@ -913,7 +912,7 @@ public class Base64 extends BaseNCodec {
*/
@Override
protected boolean isInAlphabet(final byte octet) {
-<span class="pc bpc" id="L916" title="2 of 6 branches missed."> return
octet >= 0 && octet < decodeTable.length &&
decodeTable[octet] != -1;</span>
+<span class="pc bpc" id="L915" title="2 of 6 branches missed."> return
octet >= 0 && octet < decodeTable.length &&
decodeTable[octet] != -1;</span>
}
/**
@@ -923,7 +922,7 @@ public class Base64 extends BaseNCodec {
* @since 1.4
*/
public boolean isUrlSafe() {
-<span class="fc" id="L926"> return isUrlSafe;</span>
+<span class="fc" id="L925"> return isUrlSafe;</span>
}
/**
@@ -940,13 +939,13 @@ public class Base64 extends BaseNCodec {
* @throws IllegalArgumentException if the bits being checked contain any
non-zero value
*/
private void validateCharacter(final int emptyBitsMask, final Context
context) {
-<span class="fc bfc" id="L943" title="All 4 branches covered."> if
(isStrictDecoding() && (context.ibitWorkArea & emptyBitsMask) != 0)
{</span>
-<span class="fc" id="L944"> throw new
IllegalArgumentException(</span>
+<span class="fc bfc" id="L942" title="All 4 branches covered."> if
(isStrictDecoding() && (context.ibitWorkArea & emptyBitsMask) != 0)
{</span>
+<span class="fc" id="L943"> throw new
IllegalArgumentException(</span>
"Strict decoding: Last encoded character (before the
paddings if any) is a valid " +
"base 64 alphabet but not a possible encoding. " +
"Expected the discarded bits from the character to be
zero.");
}
-<span class="fc" id="L949"> }</span>
+<span class="fc" id="L948"> }</span>
/**
* Validates whether decoding allows an entire final trailing character
that cannot be
@@ -955,13 +954,13 @@ public class Base64 extends BaseNCodec {
* @throws IllegalArgumentException if strict decoding is enabled
*/
private void validateTrailingCharacter() {
-<span class="fc bfc" id="L958" title="All 2 branches covered."> if
(isStrictDecoding()) {</span>
-<span class="fc" id="L959"> throw new
IllegalArgumentException(</span>
+<span class="fc bfc" id="L957" title="All 2 branches covered."> if
(isStrictDecoding()) {</span>
+<span class="fc" id="L958"> throw new
IllegalArgumentException(</span>
"Strict decoding: Last encoded character (before the
paddings if any) is a valid " +
"base 64 alphabet but not a possible encoding. " +
"Decoding requires at least two trailing 6-bit characters
to create bytes.");
}
-<span class="fc" id="L964"> }</span>
+<span class="fc" id="L963"> }</span>
}
</pre><div class="footer"><span class="right">Created with <a
href="http://www.jacoco.org/jacoco">JaCoCo</a>
0.8.12.202403310830</span></div></body></html>
\ No newline at end of file
Modified:
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.binary/BaseNCodec.java.html
==============================================================================
---
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.binary/BaseNCodec.java.html
(original)
+++
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.binary/BaseNCodec.java.html
Mon Jul 15 22:37:19 2024
@@ -103,7 +103,7 @@ public abstract class BaseNCodec impleme
* Sets the decoding policy.
*
* @param decodingPolicy the decoding policy, null resets to the
default.
- * @return this.
+ * @return {@code this} instance.
*/
public B setDecodingPolicy(final CodecPolicy decodingPolicy) {
<span class="fc bfc" id="L109" title="All 2 branches covered.">
this.decodingPolicy = decodingPolicy != null ? decodingPolicy :
DECODING_POLICY_DEFAULT;</span>
@@ -114,7 +114,7 @@ public abstract class BaseNCodec impleme
* Sets the encode table.
*
* @param encodeTable the encode table, null resets to the default.
- * @return this.
+ * @return {@code this} instance.
*/
public B setEncodeTable(final byte... encodeTable) {
<span class="pc bpc" id="L120" title="1 of 2 branches missed.">
this.encodeTable = encodeTable != null ? encodeTable :
defaultEncodeTable;</span>
@@ -125,7 +125,7 @@ public abstract class BaseNCodec impleme
* Sets the line length.
*
* @param lineLength the line length, less than 0 resets to the
default.
- * @return this.
+ * @return {@code this} instance.
*/
public B setLineLength(final int lineLength) {
<span class="fc" id="L131"> this.lineLength = Math.max(0,
lineLength);</span>
@@ -136,7 +136,7 @@ public abstract class BaseNCodec impleme
* Sets the line separator.
*
* @param lineSeparator the line separator, null resets to the default.
- * @return this.
+ * @return {@code this} instance.
*/
public B setLineSeparator(final byte... lineSeparator) {
<span class="fc bfc" id="L142" title="All 2 branches covered.">
this.lineSeparator = lineSeparator != null ? lineSeparator :
CHUNK_SEPARATOR;</span>
@@ -147,7 +147,7 @@ public abstract class BaseNCodec impleme
* Sets the padding byte.
*
* @param padding the padding byte.
- * @return this.
+ * @return {@code this} instance.
*/
public B setPadding(final byte padding) {
<span class="fc" id="L153"> this.padding = padding;</span>
Modified:
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.binary/Hex.java.html
==============================================================================
---
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.binary/Hex.java.html
(original)
+++
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.binary/Hex.java.html
Mon Jul 15 22:37:19 2024
@@ -480,7 +480,7 @@ public class Hex implements BinaryEncode
*/
@Override
public byte[] encode(final byte[] array) {
-<span class="fc" id="L483"> return
encodeHexString(array).getBytes(this.getCharset());</span>
+<span class="fc" id="L483"> return
encodeHexString(array).getBytes(getCharset());</span>
}
/**
@@ -500,7 +500,7 @@ public class Hex implements BinaryEncode
* @since 1.11
*/
public byte[] encode(final ByteBuffer array) {
-<span class="fc" id="L503"> return
encodeHexString(array).getBytes(this.getCharset());</span>
+<span class="fc" id="L503"> return
encodeHexString(array).getBytes(getCharset());</span>
}
/**
@@ -521,7 +521,7 @@ public class Hex implements BinaryEncode
public Object encode(final Object object) throws EncoderException {
final byte[] byteArray;
<span class="fc bfc" id="L523" title="All 2 branches covered."> if
(object instanceof String) {</span>
-<span class="fc" id="L524"> byteArray = ((String)
object).getBytes(this.getCharset());</span>
+<span class="fc" id="L524"> byteArray = ((String)
object).getBytes(getCharset());</span>
<span class="fc bfc" id="L525" title="All 2 branches covered."> } else
if (object instanceof ByteBuffer) {</span>
<span class="fc" id="L526"> byteArray = toByteArray((ByteBuffer)
object);</span>
} else {
Modified:
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.digest/Blake3.java.html
==============================================================================
---
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.digest/Blake3.java.html
(original)
+++
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.digest/Blake3.java.html
Mon Jul 15 22:37:19 2024
@@ -455,7 +455,7 @@ public final class Blake3 {
* previously finalized bytes. Note that this can finalize up to
2<sup>64</sup> bytes per instance.
*
* @param out destination array to finalize bytes into
- * @return this
+ * @return {@code this} instance.
* @throws NullPointerException if out is null
*/
public Blake3 doFinalize(final byte[] out) {
@@ -469,7 +469,7 @@ public final class Blake3 {
* @param out destination array to finalize bytes into
* @param offset where in the array to begin writing bytes to
* @param length number of bytes to finalize
- * @return this
+ * @return {@code this} instance.
* @throws NullPointerException if out is null
* @throws IndexOutOfBoundsException if offset or length are negative or
if offset + length is greater than the
* length of the provided array
@@ -498,7 +498,7 @@ public final class Blake3 {
/**
* Resets this instance back to its initial state when it was first
constructed.
- * @return this
+ * @return {@code this} instance.
*/
public Blake3 reset() {
<span class="fc" id="L504"> engineState.reset();</span>
@@ -509,7 +509,7 @@ public final class Blake3 {
* Updates this hash state using the provided bytes.
*
* @param in source array to update data from
- * @return this
+ * @return {@code this} instance.
* @throws NullPointerException if in is null
*/
public Blake3 update(final byte[] in) {
@@ -522,7 +522,7 @@ public final class Blake3 {
* @param in source array to update data from
* @param offset where in the array to begin reading bytes
* @param length number of bytes to update
- * @return this
+ * @return {@code this} instance.
* @throws NullPointerException if in is null
* @throws IndexOutOfBoundsException if offset or length are negative or
if offset + length is greater than the
* length of the provided array
Modified:
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.digest/Md5Crypt.html
==============================================================================
---
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.digest/Md5Crypt.html
(original)
+++
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.digest/Md5Crypt.html
Mon Jul 15 22:37:19 2024
@@ -1 +1 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html
xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta
http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link
rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link
rel="shortcut icon" href="../jacoco-resources/report.gif"
type="image/gif"/><title>Md5Crypt</title><script type="text/javascript"
src="../jacoco-resources/sort.js"></script></head><body
onload="initialSort(['breadcrumb'])"><div class="breadcrumb"
id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html"
class="el_session">Sessions</a></span><a href="../index.html"
class="el_report">Apache Commons Codec</a> > <a href="index.html"
class="el_package">org.apache.commons.codec.digest</a> > <span
class="el_class">Md5Crypt</span></div><h1>Md5Crypt</h1><table class="coverage"
cellspacing="0" id="coveragetable"><thead><tr><t
d class="sortable" id="a" onclick="toggleSort(this)">Element</td><td
class="down sortable bar" id="b" onclick="toggleSort(this)">Missed
Instructions</td><td class="sortable ctr2" id="c"
onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d"
onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e"
onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g"
onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i"
onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k"
onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td
class="bar">0 of 372</td><td class="ctr2">100%</td><td class="bar">0 of
24</td><td class="ctr2">100%</td><td class="ctr1">0</td><td
class="ctr2">23</td><td class
="ctr1">0</td><td class="ctr2">70</td><td class="ctr1">0</td><td
class="ctr2">11</td></tr></tfoot><tbody><tr><td id="a10"><a
href="Md5Crypt.java.html#L276" class="el_method">md5Crypt(byte[], String,
String, Random)</a></td><td class="bar" id="b0"><img
src="../jacoco-resources/greenbar.gif" width="120" height="10" title="275"
alt="275"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d0"><img
src="../jacoco-resources/greenbar.gif" width="120" height="10" title="20"
alt="20"/></td><td class="ctr2" id="e0">100%</td><td class="ctr1"
id="f0">0</td><td class="ctr2" id="g0">11</td><td class="ctr1"
id="h0">0</td><td class="ctr2" id="i0">57</td><td class="ctr1"
id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a2"><a
href="Md5Crypt.java.html#L119" class="el_method">apr1Crypt(byte[],
String)</a></td><td class="bar" id="b1"><img
src="../jacoco-resources/greenbar.gif" width="8" height="10" title="20"
alt="20"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d1"
><img src="../jacoco-resources/greenbar.gif" width="24" height="10" title="4"
>alt="4"/></td><td class="ctr2" id="e1">100%</td><td class="ctr1"
>id="f1">0</td><td class="ctr2" id="g1">3</td><td class="ctr1"
>id="h1">0</td><td class="ctr2" id="i1">3</td><td class="ctr1"
>id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a1"><a
>href="Md5Crypt.java.html#L97" class="el_method">apr1Crypt(byte[],
>Random)</a></td><td class="bar" id="b2"><img
>src="../jacoco-resources/greenbar.gif" width="5" height="10" title="13"
>alt="13"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d2"/><td
>class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">0</td><td class="ctr2"
>id="g2">1</td><td class="ctr1" id="h2">0</td><td class="ctr2"
>id="i3">1</td><td class="ctr1" id="j2">0</td><td class="ctr2"
>id="k2">1</td></tr><tr><td id="a7"><a href="Md5Crypt.java.html#L203"
>class="el_method">md5Crypt(byte[], Random)</a></td><td class="bar"
>id="b3"><img src="../jacoco-resources/greenbar.gif" width="5" h
eight="10" title="13" alt="13"/></td><td class="ctr2" id="c3">100%</td><td
class="bar" id="d3"/><td class="ctr2" id="e3">n/a</td><td class="ctr1"
id="f3">0</td><td class="ctr2" id="g3">1</td><td class="ctr1" id="h3">0</td><td
class="ctr2" id="i4">1</td><td class="ctr1" id="j3">0</td><td class="ctr2"
id="k3">1</td></tr><tr><td id="a0"><a href="Md5Crypt.java.html#L79"
class="el_method">apr1Crypt(byte[])</a></td><td class="bar" id="b4"><img
src="../jacoco-resources/greenbar.gif" width="5" height="10" title="12"
alt="12"/></td><td class="ctr2" id="c4">100%</td><td class="bar" id="d4"/><td
class="ctr2" id="e4">n/a</td><td class="ctr1" id="f4">0</td><td class="ctr2"
id="g4">1</td><td class="ctr1" id="h4">0</td><td class="ctr2" id="i5">1</td><td
class="ctr1" id="j4">0</td><td class="ctr2" id="k4">1</td></tr><tr><td
id="a6"><a href="Md5Crypt.java.html#L180"
class="el_method">md5Crypt(byte[])</a></td><td class="bar" id="b5"><img
src="../jacoco-resources/greenbar.gif" width="5" height="10" ti
tle="12" alt="12"/></td><td class="ctr2" id="c5">100%</td><td class="bar"
id="d5"/><td class="ctr2" id="e5">n/a</td><td class="ctr1" id="f5">0</td><td
class="ctr2" id="g5">1</td><td class="ctr1" id="h5">0</td><td class="ctr2"
id="i6">1</td><td class="ctr1" id="j5">0</td><td class="ctr2"
id="k5">1</td></tr><tr><td id="a9"><a href="Md5Crypt.java.html#L249"
class="el_method">md5Crypt(byte[], String, String)</a></td><td class="bar"
id="b6"><img src="../jacoco-resources/greenbar.gif" width="3" height="10"
title="8" alt="8"/></td><td class="ctr2" id="c6">100%</td><td class="bar"
id="d6"/><td class="ctr2" id="e6">n/a</td><td class="ctr1" id="f6">0</td><td
class="ctr2" id="g6">1</td><td class="ctr1" id="h6">0</td><td class="ctr2"
id="i7">1</td><td class="ctr1" id="j6">0</td><td class="ctr2"
id="k6">1</td></tr><tr><td id="a4"><a href="Md5Crypt.java.html#L161"
class="el_method">apr1Crypt(String, String)</a></td><td class="bar"
id="b7"><img src="../jacoco-resources/greenbar.gif" width="2" heig
ht="10" title="6" alt="6"/></td><td class="ctr2" id="c7">100%</td><td
class="bar" id="d7"/><td class="ctr2" id="e7">n/a</td><td class="ctr1"
id="f7">0</td><td class="ctr2" id="g7">1</td><td class="ctr1" id="h7">0</td><td
class="ctr2" id="i8">1</td><td class="ctr1" id="j7">0</td><td class="ctr2"
id="k7">1</td></tr><tr><td id="a3"><a href="Md5Crypt.java.html#L139"
class="el_method">apr1Crypt(String)</a></td><td class="bar" id="b8"><img
src="../jacoco-resources/greenbar.gif" width="2" height="10" title="5"
alt="5"/></td><td class="ctr2" id="c8">100%</td><td class="bar" id="d8"/><td
class="ctr2" id="e8">n/a</td><td class="ctr1" id="f8">0</td><td class="ctr2"
id="g8">1</td><td class="ctr1" id="h8">0</td><td class="ctr2" id="i9">1</td><td
class="ctr1" id="j8">0</td><td class="ctr2" id="k8">1</td></tr><tr><td
id="a8"><a href="Md5Crypt.java.html#L225" class="el_method">md5Crypt(byte[],
String)</a></td><td class="bar" id="b9"><img
src="../jacoco-resources/greenbar.gif" width="2" height="10"
title="5" alt="5"/></td><td class="ctr2" id="c9">100%</td><td class="bar"
id="d9"/><td class="ctr2" id="e9">n/a</td><td class="ctr1" id="f9">0</td><td
class="ctr2" id="g9">1</td><td class="ctr1" id="h9">0</td><td class="ctr2"
id="i10">1</td><td class="ctr1" id="j9">0</td><td class="ctr2"
id="k9">1</td></tr><tr><td id="a5"><a href="Md5Crypt.java.html#L405"
class="el_method">Md5Crypt()</a></td><td class="bar" id="b10"><img
src="../jacoco-resources/greenbar.gif" width="1" height="10" title="3"
alt="3"/></td><td class="ctr2" id="c10">100%</td><td class="bar" id="d10"/><td
class="ctr2" id="e10">n/a</td><td class="ctr1" id="f10">0</td><td class="ctr2"
id="g10">1</td><td class="ctr1" id="h10">0</td><td class="ctr2"
id="i2">2</td><td class="ctr1" id="j10">0</td><td class="ctr2"
id="k10">1</td></tr></tbody></table><div class="footer"><span
class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a>
0.8.12.202403310830</span></div></body></html>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html
xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta
http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link
rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link
rel="shortcut icon" href="../jacoco-resources/report.gif"
type="image/gif"/><title>Md5Crypt</title><script type="text/javascript"
src="../jacoco-resources/sort.js"></script></head><body
onload="initialSort(['breadcrumb'])"><div class="breadcrumb"
id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html"
class="el_session">Sessions</a></span><a href="../index.html"
class="el_report">Apache Commons Codec</a> > <a href="index.html"
class="el_package">org.apache.commons.codec.digest</a> > <span
class="el_class">Md5Crypt</span></div><h1>Md5Crypt</h1><table class="coverage"
cellspacing="0" id="coveragetable"><thead><tr><t
d class="sortable" id="a" onclick="toggleSort(this)">Element</td><td
class="down sortable bar" id="b" onclick="toggleSort(this)">Missed
Instructions</td><td class="sortable ctr2" id="c"
onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d"
onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e"
onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g"
onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i"
onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k"
onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td
class="bar">12 of 417</td><td class="ctr2">97%</td><td class="bar">2 of
30</td><td class="ctr2">93%</td><td class="ctr1">2</td><td
class="ctr2">26</td><td class=
"ctr1">1</td><td class="ctr2">75</td><td class="ctr1">0</td><td
class="ctr2">11</td></tr></tfoot><tbody><tr><td id="a10"><a
href="Md5Crypt.java.html#L277" class="el_method">md5Crypt(byte[], String,
String, Random)</a></td><td class="bar" id="b0"><img
src="../jacoco-resources/redbar.gif" width="4" height="10" title="12"
alt="12"/><img src="../jacoco-resources/greenbar.gif" width="115" height="10"
title="308" alt="308"/></td><td class="ctr2" id="c10">96%</td><td class="bar"
id="d0"><img src="../jacoco-resources/redbar.gif" width="9" height="10"
title="2" alt="2"/><img src="../jacoco-resources/greenbar.gif" width="110"
height="10" title="24" alt="24"/></td><td class="ctr2" id="e1">92%</td><td
class="ctr1" id="f0">2</td><td class="ctr2" id="g0">14</td><td class="ctr1"
id="h0">1</td><td class="ctr2" id="i0">62</td><td class="ctr1"
id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a2"><a
href="Md5Crypt.java.html#L120" class="el_method">apr1Crypt(byte[],
String)</a></td><td cla
ss="bar" id="b1"><img src="../jacoco-resources/greenbar.gif" width="7"
height="10" title="20" alt="20"/></td><td class="ctr2" id="c0">100%</td><td
class="bar" id="d1"><img src="../jacoco-resources/greenbar.gif" width="18"
height="10" title="4" alt="4"/></td><td class="ctr2" id="e0">100%</td><td
class="ctr1" id="f1">0</td><td class="ctr2" id="g1">3</td><td class="ctr1"
id="h1">0</td><td class="ctr2" id="i1">3</td><td class="ctr1" id="j1">0</td><td
class="ctr2" id="k1">1</td></tr><tr><td id="a1"><a
href="Md5Crypt.java.html#L98" class="el_method">apr1Crypt(byte[],
Random)</a></td><td class="bar" id="b2"><img
src="../jacoco-resources/greenbar.gif" width="4" height="10" title="13"
alt="13"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d2"/><td
class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">0</td><td class="ctr2"
id="g2">1</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i3">1</td><td
class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr><tr><td id="a7
"><a href="Md5Crypt.java.html#L204" class="el_method">md5Crypt(byte[],
Random)</a></td><td class="bar" id="b3"><img
src="../jacoco-resources/greenbar.gif" width="4" height="10" title="13"
alt="13"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d3"/><td
class="ctr2" id="e3">n/a</td><td class="ctr1" id="f3">0</td><td class="ctr2"
id="g3">1</td><td class="ctr1" id="h3">0</td><td class="ctr2" id="i4">1</td><td
class="ctr1" id="j3">0</td><td class="ctr2" id="k3">1</td></tr><tr><td
id="a0"><a href="Md5Crypt.java.html#L80"
class="el_method">apr1Crypt(byte[])</a></td><td class="bar" id="b4"><img
src="../jacoco-resources/greenbar.gif" width="4" height="10" title="12"
alt="12"/></td><td class="ctr2" id="c3">100%</td><td class="bar" id="d4"/><td
class="ctr2" id="e4">n/a</td><td class="ctr1" id="f4">0</td><td class="ctr2"
id="g4">1</td><td class="ctr1" id="h4">0</td><td class="ctr2" id="i5">1</td><td
class="ctr1" id="j4">0</td><td class="ctr2" id="k4">1</td></tr><tr><td
id="a6"><a
href="Md5Crypt.java.html#L181" class="el_method">md5Crypt(byte[])</a></td><td
class="bar" id="b5"><img src="../jacoco-resources/greenbar.gif" width="4"
height="10" title="12" alt="12"/></td><td class="ctr2" id="c4">100%</td><td
class="bar" id="d5"/><td class="ctr2" id="e5">n/a</td><td class="ctr1"
id="f5">0</td><td class="ctr2" id="g5">1</td><td class="ctr1" id="h5">0</td><td
class="ctr2" id="i6">1</td><td class="ctr1" id="j5">0</td><td class="ctr2"
id="k5">1</td></tr><tr><td id="a9"><a href="Md5Crypt.java.html#L250"
class="el_method">md5Crypt(byte[], String, String)</a></td><td class="bar"
id="b6"><img src="../jacoco-resources/greenbar.gif" width="3" height="10"
title="8" alt="8"/></td><td class="ctr2" id="c5">100%</td><td class="bar"
id="d6"/><td class="ctr2" id="e6">n/a</td><td class="ctr1" id="f6">0</td><td
class="ctr2" id="g6">1</td><td class="ctr1" id="h6">0</td><td class="ctr2"
id="i7">1</td><td class="ctr1" id="j6">0</td><td class="ctr2"
id="k6">1</td></tr><tr><td id="a4"><a
href="Md5Crypt.java.html#L162" class="el_method">apr1Crypt(String,
String)</a></td><td class="bar" id="b7"><img
src="../jacoco-resources/greenbar.gif" width="2" height="10" title="6"
alt="6"/></td><td class="ctr2" id="c6">100%</td><td class="bar" id="d7"/><td
class="ctr2" id="e7">n/a</td><td class="ctr1" id="f7">0</td><td class="ctr2"
id="g7">1</td><td class="ctr1" id="h7">0</td><td class="ctr2" id="i8">1</td><td
class="ctr1" id="j7">0</td><td class="ctr2" id="k7">1</td></tr><tr><td
id="a3"><a href="Md5Crypt.java.html#L140"
class="el_method">apr1Crypt(String)</a></td><td class="bar" id="b8"><img
src="../jacoco-resources/greenbar.gif" width="1" height="10" title="5"
alt="5"/></td><td class="ctr2" id="c7">100%</td><td class="bar" id="d8"/><td
class="ctr2" id="e8">n/a</td><td class="ctr1" id="f8">0</td><td class="ctr2"
id="g8">1</td><td class="ctr1" id="h8">0</td><td class="ctr2" id="i9">1</td><td
class="ctr1" id="j8">0</td><td class="ctr2" id="k8">1</td></tr><tr><td
id="a8"><a href="
Md5Crypt.java.html#L226" class="el_method">md5Crypt(byte[],
String)</a></td><td class="bar" id="b9"><img
src="../jacoco-resources/greenbar.gif" width="1" height="10" title="5"
alt="5"/></td><td class="ctr2" id="c8">100%</td><td class="bar" id="d9"/><td
class="ctr2" id="e9">n/a</td><td class="ctr1" id="f9">0</td><td class="ctr2"
id="g9">1</td><td class="ctr1" id="h9">0</td><td class="ctr2"
id="i10">1</td><td class="ctr1" id="j9">0</td><td class="ctr2"
id="k9">1</td></tr><tr><td id="a5"><a href="Md5Crypt.java.html#L413"
class="el_method">Md5Crypt()</a></td><td class="bar" id="b10"><img
src="../jacoco-resources/greenbar.gif" width="1" height="10" title="3"
alt="3"/></td><td class="ctr2" id="c9">100%</td><td class="bar" id="d10"/><td
class="ctr2" id="e10">n/a</td><td class="ctr1" id="f10">0</td><td class="ctr2"
id="g10">1</td><td class="ctr1" id="h10">0</td><td class="ctr2"
id="i2">2</td><td class="ctr1" id="j10">0</td><td class="ctr2"
id="k10">1</td></tr></tbody></table><div class="foo
ter"><span class="right">Created with <a
href="http://www.jacoco.org/jacoco">JaCoCo</a>
0.8.12.202403310830</span></div></body></html>
\ No newline at end of file
Modified:
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.digest/Md5Crypt.java.html
==============================================================================
---
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.digest/Md5Crypt.java.html
(original)
+++
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.digest/Md5Crypt.java.html
Mon Jul 15 22:37:19 2024
@@ -20,6 +20,7 @@ import java.nio.charset.StandardCharsets
import java.security.MessageDigest;
import java.security.SecureRandom;
import java.util.Arrays;
+import java.util.Objects;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -76,7 +77,7 @@ public class Md5Crypt {
* @see #apr1Crypt(byte[], String)
*/
public static String apr1Crypt(final byte[] keyBytes) {
-<span class="fc" id="L79"> return apr1Crypt(keyBytes, APR1_PREFIX +
B64.getRandomSalt(8));</span>
+<span class="fc" id="L80"> return apr1Crypt(keyBytes, APR1_PREFIX +
B64.getRandomSalt(8));</span>
}
/**
@@ -94,7 +95,7 @@ public class Md5Crypt {
* @since 1.12
*/
public static String apr1Crypt(final byte[] keyBytes, final Random random)
{
-<span class="fc" id="L97"> return apr1Crypt(keyBytes, APR1_PREFIX +
B64.getRandomSalt(8, random));</span>
+<span class="fc" id="L98"> return apr1Crypt(keyBytes, APR1_PREFIX +
B64.getRandomSalt(8, random));</span>
}
/**
@@ -116,10 +117,10 @@ public class Md5Crypt {
*/
public static String apr1Crypt(final byte[] keyBytes, String salt) {
// to make the md5Crypt regex happy
-<span class="fc bfc" id="L119" title="All 4 branches covered."> if
(salt != null && !salt.startsWith(APR1_PREFIX)) {</span>
-<span class="fc" id="L120"> salt = APR1_PREFIX + salt;</span>
+<span class="fc bfc" id="L120" title="All 4 branches covered."> if
(salt != null && !salt.startsWith(APR1_PREFIX)) {</span>
+<span class="fc" id="L121"> salt = APR1_PREFIX + salt;</span>
}
-<span class="fc" id="L122"> return Md5Crypt.md5Crypt(keyBytes, salt,
APR1_PREFIX);</span>
+<span class="fc" id="L123"> return Md5Crypt.md5Crypt(keyBytes, salt,
APR1_PREFIX);</span>
}
/**
@@ -136,7 +137,7 @@ public class Md5Crypt {
* @see #apr1Crypt(byte[], String)
*/
public static String apr1Crypt(final String keyBytes) {
-<span class="fc" id="L139"> return
apr1Crypt(keyBytes.getBytes(StandardCharsets.UTF_8));</span>
+<span class="fc" id="L140"> return
apr1Crypt(keyBytes.getBytes(StandardCharsets.UTF_8));</span>
}
/**
@@ -158,7 +159,7 @@ public class Md5Crypt {
* when a {@link java.security.NoSuchAlgorithmException} is
caught.
*/
public static String apr1Crypt(final String keyBytes, final String salt) {
-<span class="fc" id="L161"> return
apr1Crypt(keyBytes.getBytes(StandardCharsets.UTF_8), salt);</span>
+<span class="fc" id="L162"> return
apr1Crypt(keyBytes.getBytes(StandardCharsets.UTF_8), salt);</span>
}
/**
@@ -177,7 +178,7 @@ public class Md5Crypt {
* @see #md5Crypt(byte[], String)
*/
public static String md5Crypt(final byte[] keyBytes) {
-<span class="fc" id="L180"> return md5Crypt(keyBytes, MD5_PREFIX +
B64.getRandomSalt(8));</span>
+<span class="fc" id="L181"> return md5Crypt(keyBytes, MD5_PREFIX +
B64.getRandomSalt(8));</span>
}
/**
@@ -200,7 +201,7 @@ public class Md5Crypt {
* @since 1.12
*/
public static String md5Crypt(final byte[] keyBytes, final Random random) {
-<span class="fc" id="L203"> return md5Crypt(keyBytes, MD5_PREFIX +
B64.getRandomSalt(8, random));</span>
+<span class="fc" id="L204"> return md5Crypt(keyBytes, MD5_PREFIX +
B64.getRandomSalt(8, random));</span>
}
/**
@@ -222,7 +223,7 @@ public class Md5Crypt {
* when a {@link java.security.NoSuchAlgorithmException} is
caught.
*/
public static String md5Crypt(final byte[] keyBytes, final String salt) {
-<span class="fc" id="L225"> return md5Crypt(keyBytes, salt,
MD5_PREFIX);</span>
+<span class="fc" id="L226"> return md5Crypt(keyBytes, salt,
MD5_PREFIX);</span>
}
/**
@@ -238,7 +239,7 @@ public class Md5Crypt {
* real salt value without prefix or "rounds=". The
salt may be null, in which case a salt
* is generated for you using {@link SecureRandom}.
* @param prefix
- * salt prefix
+ * The salt prefix {@value #APR1_PREFIX}, {@value #MD5_PREFIX}.
* @return the hash value
* @throws IllegalArgumentException
* if the salt does not match the allowed pattern
@@ -246,7 +247,7 @@ public class Md5Crypt {
* when a {@link java.security.NoSuchAlgorithmException} is
caught.
*/
public static String md5Crypt(final byte[] keyBytes, final String salt,
final String prefix) {
-<span class="fc" id="L249"> return md5Crypt(keyBytes, salt, prefix, new
SecureRandom());</span>
+<span class="fc" id="L250"> return md5Crypt(keyBytes, salt, prefix, new
SecureRandom());</span>
}
/**
@@ -261,139 +262,146 @@ public class Md5Crypt {
* real salt value without prefix or "rounds=". The
salt may be null, in which case a salt
* is generated for you using {@link SecureRandom}.
* @param prefix
- * salt prefix
+ * The salt prefix {@value #APR1_PREFIX}, {@value #MD5_PREFIX}.
* @param random
* the instance of {@link Random} to use for generating the
salt.
* Consider using {@link SecureRandom} for more secure salts.
* @return the hash value
* @throws IllegalArgumentException
- * if the salt does not match the allowed pattern
+ * if the salt or prefix does not match the allowed pattern
* @throws IllegalArgumentException
* when a {@link java.security.NoSuchAlgorithmException} is
caught.
* @since 1.12
*/
public static String md5Crypt(final byte[] keyBytes, final String salt,
final String prefix, final Random random) {
-<span class="fc" id="L276"> final int keyLen = keyBytes.length;</span>
+<span class="fc" id="L277"> final int keyLen = keyBytes.length;</span>
// Extract the real salt from the given string which can be a complete
hash string.
final String saltString;
-<span class="fc bfc" id="L280" title="All 2 branches covered."> if
(salt == null) {</span>
-<span class="fc" id="L281"> saltString = B64.getRandomSalt(8,
random);</span>
+<span class="fc bfc" id="L281" title="All 2 branches covered."> if
(salt == null) {</span>
+<span class="fc" id="L282"> saltString = B64.getRandomSalt(8,
random);</span>
} else {
-<span class="fc" id="L283"> final Pattern p =
Pattern.compile("^" + prefix.replace("$", "\\$")
+ "([\\.\\/a-zA-Z0-9]{1,8}).*");</span>
-<span class="fc" id="L284"> final Matcher m =
p.matcher(salt);</span>
-<span class="fc bfc" id="L285" title="All 2 branches covered."> if
(!m.find()) {</span>
-<span class="fc" id="L286"> throw new
IllegalArgumentException("Invalid salt value: " + salt);</span>
+<span class="fc" id="L284"> Objects.requireNonNull(prefix,
"prefix");</span>
+<span class="pc bpc" id="L285" title="1 of 2 branches missed."> if
(prefix.length() < 3) {</span>
+<span class="nc" id="L286"> throw new
IllegalArgumentException("Invalid prefix value: " + prefix);</span>
+ }
+<span class="pc bpc" id="L288" title="1 of 4 branches missed."> if
(prefix.charAt(0) != '$' && prefix.charAt(prefix.length() - 1) != '$')
{</span>
+<span class="fc" id="L289"> throw new
IllegalArgumentException("Invalid prefix value: " + prefix);</span>
+ }
+<span class="fc" id="L291"> final Pattern p =
Pattern.compile("^" + prefix.replace("$", "\\$")
+ "([\\.\\/a-zA-Z0-9]{1,8}).*");</span>
+<span class="fc" id="L292"> final Matcher m =
p.matcher(salt);</span>
+<span class="fc bfc" id="L293" title="All 2 branches covered."> if
(!m.find()) {</span>
+<span class="fc" id="L294"> throw new
IllegalArgumentException("Invalid salt value: " + salt);</span>
}
-<span class="fc" id="L288"> saltString = m.group(1);</span>
+<span class="fc" id="L296"> saltString = m.group(1);</span>
}
-<span class="fc" id="L290"> final byte[] saltBytes =
saltString.getBytes(StandardCharsets.UTF_8);</span>
+<span class="fc" id="L298"> final byte[] saltBytes =
saltString.getBytes(StandardCharsets.UTF_8);</span>
-<span class="fc" id="L292"> final MessageDigest ctx =
DigestUtils.getMd5Digest();</span>
+<span class="fc" id="L300"> final MessageDigest ctx =
DigestUtils.getMd5Digest();</span>
/*
* The password first, since that is what is most unknown
*/
-<span class="fc" id="L297"> ctx.update(keyBytes);</span>
+<span class="fc" id="L305"> ctx.update(keyBytes);</span>
/*
* Then our magic string
*/
-<span class="fc" id="L302">
ctx.update(prefix.getBytes(StandardCharsets.UTF_8));</span>
+<span class="fc" id="L310">
ctx.update(prefix.getBytes(StandardCharsets.UTF_8));</span>
/*
* Then the raw salt
*/
-<span class="fc" id="L307"> ctx.update(saltBytes);</span>
+<span class="fc" id="L315"> ctx.update(saltBytes);</span>
/*
* Then just as many characters of the MD5(pw,salt,pw)
*/
-<span class="fc" id="L312"> MessageDigest ctx1 =
DigestUtils.getMd5Digest();</span>
-<span class="fc" id="L313"> ctx1.update(keyBytes);</span>
-<span class="fc" id="L314"> ctx1.update(saltBytes);</span>
-<span class="fc" id="L315"> ctx1.update(keyBytes);</span>
-<span class="fc" id="L316"> byte[] finalb = ctx1.digest();</span>
-<span class="fc" id="L317"> int ii = keyLen;</span>
-<span class="fc bfc" id="L318" title="All 2 branches covered."> while
(ii > 0) {</span>
-<span class="fc" id="L319"> ctx.update(finalb, 0, Math.min(ii,
16));</span>
-<span class="fc" id="L320"> ii -= 16;</span>
+<span class="fc" id="L320"> MessageDigest ctx1 =
DigestUtils.getMd5Digest();</span>
+<span class="fc" id="L321"> ctx1.update(keyBytes);</span>
+<span class="fc" id="L322"> ctx1.update(saltBytes);</span>
+<span class="fc" id="L323"> ctx1.update(keyBytes);</span>
+<span class="fc" id="L324"> byte[] finalb = ctx1.digest();</span>
+<span class="fc" id="L325"> int ii = keyLen;</span>
+<span class="fc bfc" id="L326" title="All 2 branches covered."> while
(ii > 0) {</span>
+<span class="fc" id="L327"> ctx.update(finalb, 0, Math.min(ii,
16));</span>
+<span class="fc" id="L328"> ii -= 16;</span>
}
/*
* Don't leave anything around in JVM they could use.
*/
-<span class="fc" id="L326"> Arrays.fill(finalb, (byte) 0);</span>
+<span class="fc" id="L334"> Arrays.fill(finalb, (byte) 0);</span>
/*
* Then something really weird...
*/
-<span class="fc" id="L331"> ii = keyLen;</span>
-<span class="fc" id="L332"> final int j = 0;</span>
-<span class="fc bfc" id="L333" title="All 2 branches covered."> while
(ii > 0) {</span>
-<span class="fc bfc" id="L334" title="All 2 branches covered."> if
((ii & 1) == 1) {</span>
-<span class="fc" id="L335"> ctx.update(finalb[j]);</span>
+<span class="fc" id="L339"> ii = keyLen;</span>
+<span class="fc" id="L340"> final int j = 0;</span>
+<span class="fc bfc" id="L341" title="All 2 branches covered."> while
(ii > 0) {</span>
+<span class="fc bfc" id="L342" title="All 2 branches covered."> if
((ii & 1) == 1) {</span>
+<span class="fc" id="L343"> ctx.update(finalb[j]);</span>
} else {
-<span class="fc" id="L337"> ctx.update(keyBytes[j]);</span>
+<span class="fc" id="L345"> ctx.update(keyBytes[j]);</span>
}
-<span class="fc" id="L339"> ii >>= 1;</span>
+<span class="fc" id="L347"> ii >>= 1;</span>
}
/*
* Now make the output string
*/
-<span class="fc" id="L345"> final StringBuilder passwd = new
StringBuilder(prefix + saltString + "$");</span>
-<span class="fc" id="L346"> finalb = ctx.digest();</span>
+<span class="fc" id="L353"> final StringBuilder passwd = new
StringBuilder(prefix + saltString + "$");</span>
+<span class="fc" id="L354"> finalb = ctx.digest();</span>
/*
* and now, just to make sure things don't run too fast On a 60 Mhz
Pentium this takes 34 milliseconds, so you
* would need 30 seconds to build a 1000 entry dictionary...
*/
-<span class="fc bfc" id="L352" title="All 2 branches covered."> for
(int i = 0; i < ROUNDS; i++) {</span>
-<span class="fc" id="L353"> ctx1 =
DigestUtils.getMd5Digest();</span>
-<span class="fc bfc" id="L354" title="All 2 branches covered."> if
((i & 1) != 0) {</span>
-<span class="fc" id="L355"> ctx1.update(keyBytes);</span>
+<span class="fc bfc" id="L360" title="All 2 branches covered."> for
(int i = 0; i < ROUNDS; i++) {</span>
+<span class="fc" id="L361"> ctx1 =
DigestUtils.getMd5Digest();</span>
+<span class="fc bfc" id="L362" title="All 2 branches covered."> if
((i & 1) != 0) {</span>
+<span class="fc" id="L363"> ctx1.update(keyBytes);</span>
} else {
-<span class="fc" id="L357"> ctx1.update(finalb, 0,
BLOCKSIZE);</span>
+<span class="fc" id="L365"> ctx1.update(finalb, 0,
BLOCKSIZE);</span>
}
-<span class="fc bfc" id="L360" title="All 2 branches covered."> if
(i % 3 != 0) {</span>
-<span class="fc" id="L361"> ctx1.update(saltBytes);</span>
+<span class="fc bfc" id="L368" title="All 2 branches covered."> if
(i % 3 != 0) {</span>
+<span class="fc" id="L369"> ctx1.update(saltBytes);</span>
}
-<span class="fc bfc" id="L364" title="All 2 branches covered."> if
(i % 7 != 0) {</span>
-<span class="fc" id="L365"> ctx1.update(keyBytes);</span>
+<span class="fc bfc" id="L372" title="All 2 branches covered."> if
(i % 7 != 0) {</span>
+<span class="fc" id="L373"> ctx1.update(keyBytes);</span>
}
-<span class="fc bfc" id="L368" title="All 2 branches covered."> if
((i & 1) != 0) {</span>
-<span class="fc" id="L369"> ctx1.update(finalb, 0,
BLOCKSIZE);</span>
+<span class="fc bfc" id="L376" title="All 2 branches covered."> if
((i & 1) != 0) {</span>
+<span class="fc" id="L377"> ctx1.update(finalb, 0,
BLOCKSIZE);</span>
} else {
-<span class="fc" id="L371"> ctx1.update(keyBytes);</span>
+<span class="fc" id="L379"> ctx1.update(keyBytes);</span>
}
-<span class="fc" id="L373"> finalb = ctx1.digest();</span>
+<span class="fc" id="L381"> finalb = ctx1.digest();</span>
}
// The following was nearly identical to the Sha2Crypt code.
// Again, the buflen is not really needed.
// int buflen = MD5_PREFIX.length() - 1 + salt_string.length() + 1 +
BLOCKSIZE + 1;
-<span class="fc" id="L379"> B64.b64from24bit(finalb[0], finalb[6],
finalb[12], 4, passwd);</span>
-<span class="fc" id="L380"> B64.b64from24bit(finalb[1], finalb[7],
finalb[13], 4, passwd);</span>
-<span class="fc" id="L381"> B64.b64from24bit(finalb[2], finalb[8],
finalb[14], 4, passwd);</span>
-<span class="fc" id="L382"> B64.b64from24bit(finalb[3], finalb[9],
finalb[15], 4, passwd);</span>
-<span class="fc" id="L383"> B64.b64from24bit(finalb[4], finalb[10],
finalb[5], 4, passwd);</span>
-<span class="fc" id="L384"> B64.b64from24bit((byte) 0, (byte) 0,
finalb[11], 2, passwd);</span>
+<span class="fc" id="L387"> B64.b64from24bit(finalb[0], finalb[6],
finalb[12], 4, passwd);</span>
+<span class="fc" id="L388"> B64.b64from24bit(finalb[1], finalb[7],
finalb[13], 4, passwd);</span>
+<span class="fc" id="L389"> B64.b64from24bit(finalb[2], finalb[8],
finalb[14], 4, passwd);</span>
+<span class="fc" id="L390"> B64.b64from24bit(finalb[3], finalb[9],
finalb[15], 4, passwd);</span>
+<span class="fc" id="L391"> B64.b64from24bit(finalb[4], finalb[10],
finalb[5], 4, passwd);</span>
+<span class="fc" id="L392"> B64.b64from24bit((byte) 0, (byte) 0,
finalb[11], 2, passwd);</span>
/*
* Don't leave anything around in JVM they could use.
*/
// Is there a better way to do this with the JVM?
-<span class="fc" id="L390"> ctx.reset();</span>
-<span class="fc" id="L391"> ctx1.reset();</span>
-<span class="fc" id="L392"> Arrays.fill(keyBytes, (byte) 0);</span>
-<span class="fc" id="L393"> Arrays.fill(saltBytes, (byte) 0);</span>
-<span class="fc" id="L394"> Arrays.fill(finalb, (byte) 0);</span>
+<span class="fc" id="L398"> ctx.reset();</span>
+<span class="fc" id="L399"> ctx1.reset();</span>
+<span class="fc" id="L400"> Arrays.fill(keyBytes, (byte) 0);</span>
+<span class="fc" id="L401"> Arrays.fill(saltBytes, (byte) 0);</span>
+<span class="fc" id="L402"> Arrays.fill(finalb, (byte) 0);</span>
-<span class="fc" id="L396"> return passwd.toString();</span>
+<span class="fc" id="L404"> return passwd.toString();</span>
}
/**
@@ -402,8 +410,8 @@ public class Md5Crypt {
* @deprecated TODO Make private in 2.0.
*/
@Deprecated
-<span class="fc" id="L405"> public Md5Crypt() {</span>
+<span class="fc" id="L413"> public Md5Crypt() {</span>
// empty
-<span class="fc" id="L407"> }</span>
+<span class="fc" id="L415"> }</span>
}
</pre><div class="footer"><span class="right">Created with <a
href="http://www.jacoco.org/jacoco">JaCoCo</a>
0.8.12.202403310830</span></div></body></html>
\ No newline at end of file
Modified:
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.digest/MurmurHash2.java.html
==============================================================================
---
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.digest/MurmurHash2.java.html
(original)
+++
websites/production/commons/content/proper/commons-codec/jacoco/org.apache.commons.codec.digest/MurmurHash2.java.html
Mon Jul 15 22:37:19 2024
@@ -20,7 +20,7 @@ package org.apache.commons.codec.digest;
import org.apache.commons.codec.binary.StringUtils;
/**
- * Implementation of the MurmurHash2 32-bit and 64-bit hash functions.
+ * Implements the MurmurHash2 32-bit and 64-bit hash functions.
*
* <p>MurmurHash is a non-cryptographic hash function suitable for
general
* hash-based lookup. The name comes from two basic operations, multiply (MU)