8216140: Correct UnicodeDecoder U+FFFE handling

Reviewed-by: rriggs
This commit is contained in:
Naoto Sato 2019-01-11 14:24:23 -08:00
parent b8bf6b95a3
commit 1dc9d4d9cb
2 changed files with 76 additions and 6 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2019, 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
@ -91,11 +91,6 @@ abstract class UnicodeDecoder extends CharsetDecoder {
char c = decode(b1, b2);
if (c == REVERSED_MARK) {
// A reversed BOM cannot occur within middle of stream
return CoderResult.malformedForLength(2);
}
// Surrogates
if (Character.isSurrogate(c)) {
if (Character.isHighSurrogate(c)) {