You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2006/12/13 17:01:54 UTC
svn commit: r486702 [4/4] - in
/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset:
./ spi/
Modified: harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnsupportedCharsetException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnsupportedCharsetException.java?view=diff&rev=486702&r1=486701&r2=486702
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnsupportedCharsetException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnsupportedCharsetException.java Wed Dec 13 08:01:53 2006
@@ -19,65 +19,38 @@
import org.apache.harmony.niochar.internal.nls.Messages;
-
/**
* Thrown when an unsupported charset name is encountered.
- *
*/
public class UnsupportedCharsetException extends IllegalArgumentException {
- /*
- * -------------------------------------------------------------------
- * Constants
- * -------------------------------------------------------------------
- */
-
- /*
- * This constant is used during deserialization to check the J2SE version
- * which created the serialized object.
- */
- private static final long serialVersionUID = 1490765524727386367L; // J2SE 1.4.2
-
- /*
- * -------------------------------------------------------------------
- * Instance variables
- * -------------------------------------------------------------------
- */
-
- // the unsupported charset name
- private String charsetName;
-
- /*
- * -------------------------------------------------------------------
- * Constructors
- * -------------------------------------------------------------------
- */
-
- /**
- * Constructs an instance of this exception with the supplied charset name.
- *
- * @param charset
- * the encountered unsupported charset name
- */
- public UnsupportedCharsetException(String charset) {
+ /*
+ * This constant is used during deserialization to check the J2SE version
+ * which created the serialized object.
+ */
+ private static final long serialVersionUID = 1490765524727386367L;
+
+ // the unsupported charset name
+ private String charsetName;
+
+ /**
+ * Constructs an instance of this exception with the supplied charset name.
+ *
+ * @param charset
+ * the encountered unsupported charset name
+ */
+ public UnsupportedCharsetException(String charset) {
// niochar.04=The unsupported charset name is "{0}".
- super(Messages.getString("niochar.04", charset)); //$NON-NLS-1$
- this.charsetName = charset;
- }
-
- /*
- * -------------------------------------------------------------------
- * Methods
- * -------------------------------------------------------------------
- */
-
- /**
- * Gets the encountered unsupported charset name.
- *
- * @return the encountered unsupported charset name
- */
- public String getCharsetName() {
- return this.charsetName;
- }
-
+ super(Messages.getString("niochar.04", charset)); //$NON-NLS-1$
+ this.charsetName = charset;
+ }
+
+ /**
+ * Gets the encountered unsupported charset name.
+ *
+ * @return the encountered unsupported charset name
+ */
+ public String getCharsetName() {
+ return this.charsetName;
+ }
}
Modified: harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/spi/CharsetProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/spi/CharsetProvider.java?view=diff&rev=486702&r1=486701&r2=486702
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/spi/CharsetProvider.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/spi/CharsetProvider.java Wed Dec 13 08:01:53 2006
@@ -21,42 +21,41 @@
/**
* The service provider class for character sets.
- *
*/
public abstract class CharsetProvider {
- // The permission required to construct a new provider.
- private static final RuntimePermission CONSTRUCT_PERM = new RuntimePermission(
- "charsetProvider"); //$NON-NLS-1$
+ // The permission required to construct a new provider.
+ private static final RuntimePermission CONSTRUCT_PERM = new RuntimePermission(
+ "charsetProvider"); //$NON-NLS-1$
- /**
- * Constructor for subclassing with concrete types.
- *
- * @throws SecurityException
- * if there is a security manager installed that does not permit
- * the runtime permission labeled "charsetProvider".
- */
- protected CharsetProvider() {
- SecurityManager securityManager = System.getSecurityManager();
- if (securityManager != null)
- securityManager.checkPermission(CONSTRUCT_PERM);
- }
+ /**
+ * Constructor for subclassing with concrete types.
+ *
+ * @throws SecurityException
+ * if there is a security manager installed that does not permit
+ * the runtime permission labeled "charsetProvider".
+ */
+ protected CharsetProvider() {
+ SecurityManager securityManager = System.getSecurityManager();
+ if (securityManager != null)
+ securityManager.checkPermission(CONSTRUCT_PERM);
+ }
- /**
- * Answers an iterator over all the available charsets.
- *
- * @return the iterator.
- */
- public abstract Iterator<Charset> charsets();
+ /**
+ * Answers an iterator over all the available charsets.
+ *
+ * @return the iterator.
+ */
+ public abstract Iterator<Charset> charsets();
- /**
- * Answers the named charset.
- * <p>
- * If the charset is unavailable the method returns <code>null</code>.
- *
- * @param charsetName
- * the canonical or alias name of a character set.
- * @return the charset, or <code>null</code> if unavailable.
- */
- public abstract Charset charsetForName(String charsetName);
+ /**
+ * Answers the named charset.
+ * <p>
+ * If the charset is unavailable the method returns <code>null</code>.
+ *
+ * @param charsetName
+ * the canonical or alias name of a character set.
+ * @return the charset, or <code>null</code> if unavailable.
+ */
+ public abstract Charset charsetForName(String charsetName);
}