Skip to content

Commit 5e10c28

Browse files
committed
Bump actions/setup-java from 3.13.0 to 4.0.0
1 parent 82c04be commit 5e10c28

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
restore-keys: |
4040
${{ runner.os }}-maven-
4141
- name: Set up JDK ${{ matrix.java }}
42-
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
42+
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
4343
with:
4444
distribution: 'temurin'
4545
java-version: ${{ matrix.java }}

.github/workflows/maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
restore-keys: |
4545
${{ runner.os }}-maven-
4646
- name: Set up JDK ${{ matrix.java }}
47-
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
47+
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
4848
with:
4949
distribution: 'temurin'
5050
java-version: ${{ matrix.java }}

src/main/java/org/apache/commons/codec/net/PercentCodec.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ private boolean inAlwaysEncodeCharsRange(final byte c) {
231231
* @param b the byte that is candidate for min and max limit
232232
*/
233233
private void insertAlwaysEncodeChar(final byte b) {
234+
if (b < 0) {
235+
throw new IllegalArgumentException("byte must be >= 0");
236+
}
234237
this.alwaysEncodeChars.set(b);
235238
if (b < alwaysEncodeCharsMin) {
236239
alwaysEncodeCharsMin = b;

src/test/java/org/apache/commons/codec/net/PercentCodecTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ public void testEncodeUnsupportedObject() {
105105
assertThrows(EncoderException.class, () -> percentCodec.encode("test"));
106106
}
107107

108+
@Test
109+
public void testInvalidByte() throws Exception {
110+
final byte[] invalid = { (byte) -1, (byte) 'A' };
111+
assertThrows(IllegalArgumentException.class, () -> new PercentCodec(invalid, true));
112+
}
113+
108114
@Test
109115
public void testPercentEncoderDecoderWithNullOrEmptyInput() throws Exception {
110116
final PercentCodec percentCodec = new PercentCodec(null, true);

0 commit comments

Comments
 (0)