Skip to content

Commit ac2dfe4

Browse files
committedSep 12, 2023
8313865: Always true condition in sun.nio.cs.CharsetMapping#readINDEXC2B
Reviewed-by: aturbanov, vtewari, rriggs, iris
1 parent 947dee7 commit ac2dfe4

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed
 

‎src/java.base/share/classes/sun/nio/cs/CharsetMapping.java

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,12 +26,7 @@
2626
package sun.nio.cs;
2727

2828
import java.io.InputStream;
29-
import java.io.InputStreamReader;
30-
import java.io.OutputStream;
31-
import java.io.BufferedReader;
3229
import java.io.IOException;
33-
import java.util.regex.Matcher;
34-
import java.util.regex.Pattern;
3530
import java.util.*;
3631
import java.security.*;
3732

@@ -244,7 +239,7 @@ void readSINGLEBYTE() {
244239
void readINDEXC2B() {
245240
char[] map = readCharArray();
246241
for (int i = map.length - 1; i >= 0; i--) {
247-
if (c2b == null && map[i] != -1) {
242+
if (c2b == null) {
248243
c2b = new char[map[i] + 256];
249244
Arrays.fill(c2b, (char)UNMAPPABLE_ENCODING);
250245
break;

0 commit comments

Comments
 (0)
Please sign in to comment.