CharacterCodingException.java: This class must be public.

2002-11-11  Michael Koch <konqueror@gmx.de>

	* java/nio/charset/CharacterCodingException.java:
	This class must be public.
	* java/nio/charset/CoderMalfunctionError.java:
	This class must be public.
	* java/nio/charset/CodingErrorAction.java:
	This class must be public.
	* java/nio/charset/IllegalCharsetNameException.java:
	This class must be public, better implementation.
	* java/nio/charset/MalformedInputException.java:
	This class must be public, better implementation.
	* java/nio/charset/UnmappableCharacterException.java:
	This class must be public, better implementation.
	* java/nio/charset/UnsupportedCharsetException.java:
	This class must be public, better implementation.

From-SVN: r59012
This commit is contained in:
Michael Koch 2002-11-11 07:12:07 +00:00 committed by Michael Koch
parent dba90b0cc6
commit ac7bc6bb2f
8 changed files with 63 additions and 27 deletions

View File

@ -1,3 +1,20 @@
2002-11-11 Michael Koch <konqueror@gmx.de>
* java/nio/charset/CharacterCodingException.java:
This class must be public.
* java/nio/charset/CoderMalfunctionError.java:
This class must be public.
* java/nio/charset/CodingErrorAction.java:
This class must be public.
* java/nio/charset/IllegalCharsetNameException.java:
This class must be public, better implementation.
* java/nio/charset/MalformedInputException.java:
This class must be public, better implementation.
* java/nio/charset/UnmappableCharacterException.java:
This class must be public, better implementation.
* java/nio/charset/UnsupportedCharsetException.java:
This class must be public, better implementation.
2002-11-11 Michael Koch <konqueror@gmx.de> 2002-11-11 Michael Koch <konqueror@gmx.de>
* java/nio/BufferOverflowException.java, * java/nio/BufferOverflowException.java,

View File

@ -39,7 +39,10 @@ package java.nio.charset;
import java.io.IOException; import java.io.IOException;
class CharacterCodingException extends IOException /**
* @since 1.4
*/
public class CharacterCodingException extends IOException
{ {
/** /**
* Creates the exception * Creates the exception

View File

@ -40,7 +40,7 @@ package java.nio.charset;
/** /**
* @since 1.4 * @since 1.4
*/ */
class CoderMalfunctionError extends Error public class CoderMalfunctionError extends Error
{ {
/** /**
* Creates the error * Creates the error

View File

@ -37,18 +37,30 @@ exception statement from your version. */
package java.nio.charset; package java.nio.charset;
public class CodingErrorAction
class CodingErrorAction
{ {
public static final CodingErrorAction IGNORE; public static final CodingErrorAction IGNORE
public static final CodingErrorAction REPLACE; = new CodingErrorAction("ignore");
public static final CodingErrorAction REPORT; public static final CodingErrorAction REPLACE
= new CodingErrorAction("replace");
public static final CodingErrorAction REPORT
= new CodingErrorAction("report");
private final String name;
/** /**
* FIXME * Private constructor only used to create the constant CodingErrorActions.
*/
private CodingErrorAction(String name)
{
this.name = name;
}
/**
* Returns the name of the CodingErrorAction.
*/ */
public String toString () public String toString ()
{ {
return ""; return name;
} }
} }

View File

@ -37,17 +37,17 @@ exception statement from your version. */
package java.nio.charset; package java.nio.charset;
class IllegalCharsetNameException extends IllegalArgumentException /**
* @since 1.4
*/
public class IllegalCharsetNameException extends IllegalArgumentException
{ {
private String charsetName;
/** /**
* Creates the exception * Creates the exception
*/ */
public IllegalCharsetNameException (String charsetName) public IllegalCharsetNameException (String charsetName)
{ {
super (); super (charsetName);
this.charsetName = charsetName;
} }
/** /**
@ -55,6 +55,6 @@ class IllegalCharsetNameException extends IllegalArgumentException
*/ */
public String getCharsetName () public String getCharsetName ()
{ {
return charsetName; return getMessage ();
} }
} }

View File

@ -37,7 +37,10 @@ exception statement from your version. */
package java.nio.charset; package java.nio.charset;
class MalformedInputException extends CharacterCodingException /**
* @since 1.4
*/
public class MalformedInputException extends CharacterCodingException
{ {
private int inputLength; private int inputLength;
@ -63,7 +66,6 @@ class MalformedInputException extends CharacterCodingException
*/ */
public String getMessage () public String getMessage ()
{ {
// FIXME: I think this is not correct return "Input length = " + inputLength;
return "";
} }
} }

View File

@ -37,7 +37,10 @@ exception statement from your version. */
package java.nio.charset; package java.nio.charset;
class UnmappableCharacterException extends CharacterCodingException /**
* @since 1.4
*/
public class UnmappableCharacterException extends CharacterCodingException
{ {
private int inputLength; private int inputLength;
@ -63,7 +66,6 @@ class UnmappableCharacterException extends CharacterCodingException
*/ */
public String getMessage () public String getMessage ()
{ {
// FIXME: I think this is not correct return "Input length = " + inputLength;
return "";
} }
} }

View File

@ -37,17 +37,17 @@ exception statement from your version. */
package java.nio.charset; package java.nio.charset;
class UnsupportedCharsetException extends IllegalArgumentException /**
* @since 1.4
*/
public class UnsupportedCharsetException extends IllegalArgumentException
{ {
private String charsetName;
/** /**
* Creates the exception * Creates the exception
*/ */
public UnsupportedCharsetException (String charsetName) public UnsupportedCharsetException (String charsetName)
{ {
super (); super (charsetName);
this.charsetName = charsetName;
} }
/** /**
@ -55,6 +55,6 @@ class UnsupportedCharsetException extends IllegalArgumentException
*/ */
public String getCharsetName () public String getCharsetName ()
{ {
return charsetName; return getMessage ();
} }
} }