From e3855d005408945ea00e3bc38a0f10bef45cd627 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Wed, 29 Mar 2023 16:19:44 +0000 Subject: [PATCH] 8304840: Dangling `CharacterCodingException` in a few javadoc descriptions Reviewed-by: alanb, iris, rriggs, jpai --- .../java/nio/charset/Charset-X-Coder.java.template | 9 +++++++++ .../share/classes/java/nio/charset/CoderResult.java | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template b/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template index ccc97841632..d3d0f0e17c9 100644 --- a/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template +++ b/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template @@ -793,6 +793,15 @@ public abstract class Charset$Coder$ { * the current unmappable-character action is {@link * CodingErrorAction#REPORT} * + * @throws CharacterCodingException + * {@code MalformedInputException} if the $itype$ sequence starting at the + * input buffer's current position is $notLegal$ and the current + * malformed-input action is {@code CodingErrorAction.REPORT}; + * {@code UnmappableCharacterException} if the $itype$ sequence starting at + * the input buffer's current position cannot be mapped to an + * equivalent $otype$ sequence and the current unmappable-character + * action is {@code CodingErrorAction.REPORT} + * * @throws OutOfMemoryError * If the output $otype$ buffer for the requested size of the input * $itype$ buffer cannot be allocated diff --git a/src/java.base/share/classes/java/nio/charset/CoderResult.java b/src/java.base/share/classes/java/nio/charset/CoderResult.java index 8bfbf9f54af..fcce8774171 100644 --- a/src/java.base/share/classes/java/nio/charset/CoderResult.java +++ b/src/java.base/share/classes/java/nio/charset/CoderResult.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -264,6 +264,11 @@ public class CoderResult { * @throws UnmappableCharacterException * If this object represents an unmappable-character error; the * exception's length value will be that of this object + * + * @throws CharacterCodingException + * {@code MalformedInputException} if this object represents a + * malformed-input error; {@code UnmappableCharacterException} + * if this object represents an unmappable-character error */ public void throwException() throws CharacterCodingException