Skip to content

Commit

Permalink
8313865: Always true condition in sun.nio.cs.CharsetMapping#readINDEXC2B
Browse files Browse the repository at this point in the history
Reviewed-by: aturbanov, vtewari, rriggs, iris
  • Loading branch information
naotoj committed Sep 12, 2023
1 parent 947dee7 commit ac2dfe4
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/java.base/share/classes/sun/nio/cs/CharsetMapping.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,12 +26,7 @@
package sun.nio.cs;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.*;
import java.security.*;

Expand Down Expand Up @@ -244,7 +239,7 @@ void readSINGLEBYTE() {
void readINDEXC2B() {
char[] map = readCharArray();
for (int i = map.length - 1; i >= 0; i--) {
if (c2b == null && map[i] != -1) {
if (c2b == null) {
c2b = new char[map[i] + 256];
Arrays.fill(c2b, (char)UNMAPPABLE_ENCODING);
break;
Expand Down

1 comment on commit ac2dfe4

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.